Changeset 278

Show
Ignore:
Timestamp:
07/04/07 19:39:53 (1 year ago)
Author:
bermiferrer
Message:

Deprecating Akelos args. From this moment it is disabled by default except on console and test mode.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/AkActiveRecord.php

    r277 r278  
    1919 
    2020require_once(AK_LIB_DIR.DS.'AkActiveRecord'.DS.'AkAssociatedActiveRecord.php'); 
     21 
     22// Akelos args is a short way to call functions that is only intended for fast prototyping 
     23defined('AK_ENABLE_AKELOS_ARGS') ? null : define('AK_ENABLE_AKELOS_ARGS', false);  
    2124 
    2225// Use setColumnName if available when using set('column_name', $value); 
     
    14671470    * 
    14681471    * Use this syntax only for quick testings, not for production environments. If the number of arguments varies, the result might be unpredictable. 
     1472    * 
     1473    * This function syntax is disabled by default. You need to define('AK_ENABLE_AKELOS_ARGS', true) 
     1474    * if you need this functionality. 
     1475    * 
     1476    * @deprecated 
    14691477    */ 
    14701478    function parseAkelosArgs(&$args) 
    14711479    { 
     1480        if(!AK_ENABLE_AKELOS_ARGS){ 
     1481            return ; 
     1482        } 
    14721483        $k = array_keys($args); 
    1473         if(isset($k[1]) && substr($args[$k[0]],-1) == '>' && preg_match('/$[a-zA-Z0-9_]+>^/', $k[0])){ 
     1484        if(isset($k[1]) && substr($args[$k[0]],-1) == '>'){ 
    14741485            $size = sizeOf($k); 
    14751486            $params = array(); 
    14761487            for($i = 0; $i < $size; $i++ ) { 
    14771488                $v = $args[$k[$i]]; 
    1478                 if(!isset($key) && is_string($args[$k[$i]]) && substr($v,-1) == '>' && preg_match('/$[a-zA-Z0-9_]+>^/', $v)){ 
     1489                if(!isset($key) && is_string($args[$k[$i]]) && substr($v,-1) == '>'){ 
    14791490                    $key = rtrim($v, '=-> '); 
    14801491                }elseif(isset($key)) { 
  • trunk/script/console

    r37 r278  
    2222define('AK_CONSOLE_MODE', true); 
    2323defined('AK_ENVIRONMENT') ? null : define('AK_ENVIRONMENT', 'development'); 
     24define('AK_ENABLE_AKELOS_ARGS', true);  
    2425include(dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php'); 
    2526 
  • trunk/test/fixtures/config/config.php

    r255 r278  
    2020(array)@explode('/',@$_SERVER['REQUEST_URI']))),DIRECTORY_SEPARATOR),array('','/'),AK_TEST_DIR)); 
    2121 
    22  
     22defined('AK_ENABLE_AKELOS_ARGS') ? null : define('AK_ENABLE_AKELOS_ARGS', true);  
    2323//define('AK_SKIP_DB_CONNECTION',isset($db) && $db === false); 
    2424