Skip to content

Commit

Permalink
Update source headers
Browse files Browse the repository at this point in the history
  • Loading branch information
bcosca committed Jan 6, 2015
1 parent ce857cd commit 4dc52c5
Show file tree
Hide file tree
Showing 32 changed files with 232 additions and 66 deletions.
File renamed without changes.
File renamed without changes.
8 changes: 7 additions & 1 deletion audit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
*/

Expand Down
9 changes: 8 additions & 1 deletion auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
*/


//! Authorization/authentication plug-in
class Auth {

Expand Down
22 changes: 14 additions & 8 deletions base.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
*/

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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']?
Expand Down Expand Up @@ -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)/',
Expand All @@ -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='';
Expand Down
8 changes: 7 additions & 1 deletion basket.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
*/

Expand Down
8 changes: 7 additions & 1 deletion bcrypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
*/

Expand Down
8 changes: 7 additions & 1 deletion db/cursor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
*/

Expand Down
8 changes: 7 additions & 1 deletion db/jig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
*/

Expand Down
8 changes: 7 additions & 1 deletion db/jig/mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
*/

Expand Down
8 changes: 7 additions & 1 deletion db/jig/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
*/

Expand Down
8 changes: 7 additions & 1 deletion db/mongo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
*/

Expand Down
8 changes: 7 additions & 1 deletion db/mongo/mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
*/

Expand Down
8 changes: 7 additions & 1 deletion db/mongo/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
*/

Expand Down
51 changes: 21 additions & 30 deletions db/sql/mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
*/

Expand Down Expand Up @@ -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)) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -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'],
Expand Down
8 changes: 7 additions & 1 deletion db/sql/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
*/

Expand Down
8 changes: 7 additions & 1 deletion f3.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
*/

Expand Down
8 changes: 7 additions & 1 deletion image.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
*/

Expand Down
8 changes: 7 additions & 1 deletion log.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
*/

Expand Down
8 changes: 7 additions & 1 deletion magic.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
*/

Expand Down
Loading

0 comments on commit 4dc52c5

Please sign in to comment.