diff --git a/changelog.txt b/CHANGELOG similarity index 100% rename from changelog.txt rename to CHANGELOG diff --git a/LICENSE b/COPYING similarity index 100% rename from LICENSE rename to COPYING diff --git a/audit.php b/audit.php index e2d334ae..7486967e 100644 --- a/audit.php +++ b/audit.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/auth.php b/auth.php index adc26e0f..0e8036a0 100644 --- a/auth.php +++ b/auth.php @@ -10,10 +10,17 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ + //! Authorization/authentication plug-in class Auth { diff --git a/base.php b/base.php index 330b202c..f6411269 100644 --- a/base.php +++ b/base.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ @@ -39,7 +45,7 @@ final class Base extends Prefab implements ArrayAccess { //@{ Framework details const PACKAGE='Fat-Free Framework', - VERSION='3.4.0-Release'; + VERSION='3.4.1-Dev'; //@} //@{ HTTP status codes (RFC 2616) @@ -1126,7 +1132,7 @@ function($frame) use($debug) { $handler=$this->hive['ONERROR']; $this->hive['ONERROR']=NULL; if ((!$handler || - $this->call($handler,array($this,$this->get('PARAMS')), + $this->call($handler,array($this,$this->hive['PARAMS']), 'beforeroute,afterroute')===FALSE) && !$prior && PHP_SAPI!='cli' && !$this->hive['QUIET']) echo $this->hive['AJAX']? @@ -1372,6 +1378,11 @@ function run() { foreach (array_keys($args) as $key) if (is_numeric($key) && $key) unset($args[$key]); + // Capture values of route pattern tokens + $this->hive['PARAMS']=$args=array_map('urldecode',$args); + // Save matching route + $this->hive['ALIAS']=$alias; + $this->hive['PATTERN']=$url; if (is_string($handler)) { // Replace route pattern tokens in handler if any $handler=preg_replace_callback('/@(\w+\b)/', @@ -1384,11 +1395,6 @@ function($id) use($args) { !class_exists($match[1])) $this->error(404); } - // Capture values of route pattern tokens - $this->hive['PARAMS']=$args=array_map('urldecode',$args); - // Save matching route - $this->hive['ALIAS']=$alias; - $this->hive['PATTERN']=$url; // Process request $result=NULL; $body=''; diff --git a/basket.php b/basket.php index dd8a1004..5e1e332e 100644 --- a/basket.php +++ b/basket.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/bcrypt.php b/bcrypt.php index 709db1de..1bea272f 100644 --- a/bcrypt.php +++ b/bcrypt.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/db/cursor.php b/db/cursor.php index 7ae1cae4..12c5c048 100644 --- a/db/cursor.php +++ b/db/cursor.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/db/jig.php b/db/jig.php index 811e0b79..766384e1 100644 --- a/db/jig.php +++ b/db/jig.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/db/jig/mapper.php b/db/jig/mapper.php index 0808cfbe..8e212a35 100644 --- a/db/jig/mapper.php +++ b/db/jig/mapper.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/db/jig/session.php b/db/jig/session.php index 5be319c7..49757921 100644 --- a/db/jig/session.php +++ b/db/jig/session.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/db/mongo.php b/db/mongo.php index 4dfef583..ffe772e0 100644 --- a/db/mongo.php +++ b/db/mongo.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/db/mongo/mapper.php b/db/mongo/mapper.php index 82ba94c7..6285c4f2 100644 --- a/db/mongo/mapper.php +++ b/db/mongo/mapper.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/db/mongo/session.php b/db/mongo/session.php index e547cb14..62a25021 100644 --- a/db/mongo/session.php +++ b/db/mongo/session.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/db/sql/mapper.php b/db/sql/mapper.php index a308967a..f12f0db6 100644 --- a/db/sql/mapper.php +++ b/db/sql/mapper.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ @@ -179,11 +185,9 @@ function select($fields,$filter=NULL,array $options=NULL,$ttl=0) { 'offset'=>0 ); $db=$this->db; - $remap=''; - foreach (explode(',',$fields) as $field) - $remap.=($remap?',':''). - (preg_match('/[()]/',$field)?'':($this->table.'.')).$field; - $sql='SELECT '.$remap.' FROM '.$this->table; + $sql='SELECT '. + ($options['group'] && !preg_match('/mysql|sqlite/',$this->engine)? + $options['group']:$fields).' FROM '.$this->table; $args=array(); if ($filter) { if (is_array($filter)) { @@ -195,32 +199,16 @@ function select($fields,$filter=NULL,array $options=NULL,$ttl=0) { } $sql.=' WHERE '.$filter; } - $pkeys=array(); - foreach ($this->fields as $key=>$field) - if ($field['pkey']) - $pkeys[]=$key; - if ($options['group']) { - $group=array_unique(array_merge($pkeys, - $spec=explode(',',$options['group']))); - foreach ($group as &$field) { - $field=$db->quotekey($field); - unset($field); - } - $sql.=' JOIN (SELECT '.implode(',',$group).' FROM '. - $this->table.' GROUP BY '.implode(',',array_map( + if ($options['group']) + $sql.=' GROUP BY '.implode(',',array_map( function($str) use($db) { return preg_match('/^(\w+)(?:\h+HAVING|\h*(?:,|$))/i', $str,$parts)? ($db->quotekey($parts[1]). (isset($parts[2])?(' '.$parts[2]):'')):$str; }, - $spec)).') AS '.$db->quotekey('sub').' ON '; - $flag=''; - foreach ($pkeys as $pkey) - $sql.=($flag?' AND ':'').$this->table.'.'. - $db->quotekey($pkey).'='. - $db->quotekey('sub').'.'.$db->quotekey($pkey); - } + explode(',',$options['group']))); + if ($options['order']) { $sql.=' ORDER BY '.implode(',',array_map( function($str) use($db) { @@ -233,6 +221,10 @@ function($str) use($db) { } if (preg_match('/mssql|sqlsrv|odbc/', $this->engine) && ($options['limit'] || $options['offset'])) { + $pkeys=array(); + foreach ($this->fields as $key=>$field) + if ($field['pkey']) + $pkeys[]=$key; $ofs=$options['offset']?(int)$options['offset']:0; $lmt=$options['limit']?(int)$options['limit']:0; if (strncmp($db->version(),'11',2)>=0) { @@ -441,14 +433,13 @@ function update() { } foreach ($this->fields as $key=>$field) if ($field['pkey']) { - $filter.=($filter?' AND ':'').$this->db->quotekey($key).'=?'; + $filter.=($filter?' AND ':' WHERE '). + $this->db->quotekey($key).'=?'; $args[$ctr+1]=array($field['previous'],$field['pdo_type']); $ctr++; } if ($pairs) { - $sql='UPDATE '.$this->table.' SET '.$pairs; - if ($filter) - $sql.=' WHERE '.$filter; + $sql='UPDATE '.$this->table.' SET '.$pairs.$filter; $this->db->exec($sql,$args); if (isset($this->trigger['afterupdate'])) \Base::instance()->call($this->trigger['afterupdate'], diff --git a/db/sql/session.php b/db/sql/session.php index 6fdb9750..f7df2a53 100644 --- a/db/sql/session.php +++ b/db/sql/session.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/f3.php b/f3.php index b4127bd6..96c7845e 100644 --- a/f3.php +++ b/f3.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/image.php b/image.php index e5d96cc9..3132f552 100644 --- a/image.php +++ b/image.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/log.php b/log.php index c995526d..6583cedb 100644 --- a/log.php +++ b/log.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/magic.php b/magic.php index d38407c3..5669908a 100644 --- a/magic.php +++ b/magic.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/markdown.php b/markdown.php index 31cbf940..9863d911 100644 --- a/markdown.php +++ b/markdown.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/matrix.php b/matrix.php index 682474b4..1ebce6b9 100644 --- a/matrix.php +++ b/matrix.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/session.php b/session.php index 0f5ef45a..a29ec62b 100644 --- a/session.php +++ b/session.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/smtp.php b/smtp.php index 842ece66..b70f56e1 100644 --- a/smtp.php +++ b/smtp.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/template.php b/template.php index 16938ca0..2f24690b 100644 --- a/template.php +++ b/template.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/test.php b/test.php index 605b636d..a11b3cb4 100644 --- a/test.php +++ b/test.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/utf.php b/utf.php index 9fe4c91a..fbfe0005 100644 --- a/utf.php +++ b/utf.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/web.php b/web.php index 930a192c..b5f76c0b 100644 --- a/web.php +++ b/web.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/web/geo.php b/web/geo.php index 8be1af7c..2d768d5e 100644 --- a/web/geo.php +++ b/web/geo.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/web/google/staticmap.php b/web/google/staticmap.php index 8f6728f1..71acc550 100644 --- a/web/google/staticmap.php +++ b/web/google/staticmap.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/web/openid.php b/web/openid.php index 1988387f..89173d0b 100644 --- a/web/openid.php +++ b/web/openid.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */ diff --git a/web/pingback.php b/web/pingback.php index bbb32cf7..9dd750a3 100644 --- a/web/pingback.php +++ b/web/pingback.php @@ -10,7 +10,13 @@ terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or later. - Please see the LICENSE file for more information. + Fat-Free Framework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Fat-Free Framework. If not, see . */