diff --git a/app/config/core.php b/app/config/core.php index 34e1b1523..1a75484e0 100644 --- a/app/config/core.php +++ b/app/config/core.php @@ -98,7 +98,7 @@ /** * A random string used in session management. */ - define('CAKE_SESSION_STRING', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi'); + define('CAKE_SESSION_STRING', '0qyJfIxDYhG93bfs2guVoUubWwvniR2G0FgaC9mi'); /** * The name of CakePHP's session cookie. */ @@ -157,55 +157,60 @@ * The classname and database used in CakePHP's * access control lists. */ - define('ACL_CLASSNAME', 'DB_ACL'); - define('ACL_DATABASE', 'default'); + Configure::write('Acl.classname', 'DB_ACL'); + Configure::write('Acl.database', 'default'); /** * Cache Engine Configuration * * File storage engine. * default dir is /app/tmp/cache/ - * $cakeCache = array('File', array( - * [optional] 'duration'=> 3600, - * [optional] 'probability'=> 100, - * [optional] 'dir' => '/tmp', // use system tmp directory - remember to use absolute path - * [optional] 'prefix' => 'cake_', // prefix every cache file with this string - * [optional] 'lock' => false, // use file locking - * [optional] 'serialize' => true, - * )); + * Cache::config('default', array('engine' => 'File' //[required] + * 'duration'=> 3600, //[optional] + * 'probability'=> 100, //[optional] + * 'path' => '/tmp', //[optional] use system tmp directory - remember to use absolute path + * 'prefix' => 'cake_', //[optional] prefix every cache file with this string + * 'lock' => false, //[optional] use file locking + * 'serialize' => true, [optional] + * ) + * ); * * APC (Alternative PHP Cache) - * $cakeCache = array('Apc', array( - * [optional] 'duration'=> 3600, - * [optional] 'probability'=> 100 - * )); + * Cache::config('default', array('engine' => 'Apc' //[required] + * 'duration'=> 3600, //[optional] + * 'probability'=> 100, //[optional] + * ) + * ); * * Xcache (PHP opcode cacher) - * $cakeCache = array('Xcache', array( - * [optional] 'duration'=> 3600, - * [optional] 'probability'=> 100, - * 'user' => 'admin', // user from xcache.admin.user settings - * 'password' => 'your_password', // plaintext password (xcache.admin.pass) - * )); + * Cache::config('default', array('engine' => 'Xcache' //[required] + * 'duration'=> 3600, //[optional] + * 'probability'=> 100, //[optional] + * 'user' => 'admin', //user from xcache.admin.user settings + * password' => 'your_password', //plaintext password (xcache.admin.pass) + * ) + * ); * * Memcache - * $cakeCache = array('Memcache', array( - * [optional] 'duration'=> 3600, - * [optional] 'probability'=> 100, - * [optional] 'servers' => array( - * '127.0.0.1', // localhost, default port - * '10.0.0.1:12345', // port 12345 - * ), - * [optional] 'compress' => true, // compress data in Memcache (slower, but uses less memory) - * )); + * Cache::config('default', array('engine' => 'Memcache' //[required] + * 'duration'=> 3600, //[optional] + * 'probability'=> 100, //[optional] + * 'servers' => array( + * '127.0.0.1', // localhost, default port + * '10.0.0.1:12345', // port 12345 + * ), //[optional] + * 'compress' => true, // [optional] compress data in Memcache (slower, but uses less memory) + * ) + * ); * * Cake Model - * $cakeCache = array('Model', array( - * [optional] 'duration'=> 3600, - * [optional] 'probability'=> 100, - * [optional] 'className' => 'Cache', - * [optional] 'fields' => array('data' => 'data', 'expires => 'expires'), - * [optional] 'serialize' => true, - * )); + * Cache::config('default', array('engine' => 'Model' //[required] + * 'duration'=> 3600, //[optional] + * 'probability'=> 100, //[optional] + * 'className' => 'Cache', //[optional] + * 'fields' => array('data' => 'data', 'expires => 'expires'), //[optional] + * 'serialize' => true, [optional] + * ) + * ); */ - $cakeCache = array('File'); + Cache::config('default', array('engine' => 'File')); ?> \ No newline at end of file diff --git a/cake/bootstrap.php b/cake/bootstrap.php index cbe757b40..5ac9f268a 100644 --- a/cake/bootstrap.php +++ b/cake/bootstrap.php @@ -43,25 +43,20 @@ if (!defined('SERVER_IIS') && php_sapi_name() == 'isapi') { require LIBS . 'inflector.php'; require LIBS . 'configure.php'; } - require LIBS . 'cache.php'; + + Configure::getInstance(); + + $cache = Cache::settings(); + if(empty($cache)) { + trigger_error('Cache not configured. Please use Cache::config(); in APP/config/core.php', E_USER_WARNING); + Cache::config('default', array('engine' => 'File')); + } + require LIBS . 'session.php'; require LIBS . 'security.php'; require LIBS . 'string.php'; - if (isset($cakeCache)) { - $cache = 'File'; - if (isset($cakeCache[0])) { - $cache = $cakeCache[0]; - } - $settings = array(); - if (isset($cakeCache[1])) { - $settings = $cakeCache[1]; - } - Cache::engine($cache, $settings); - } else { - Cache::engine(); - } Configure::store(null, 'class.paths'); Configure::load('class.paths'); diff --git a/cake/console/libs/acl.php b/cake/console/libs/acl.php index 07c04ea16..8ff546c1c 100644 --- a/cake/console/libs/acl.php +++ b/cake/console/libs/acl.php @@ -40,8 +40,7 @@ class AclShell extends Shell { * @var object * @access public */ - var $acl; -/** + var $Acl; /** * Contains arguments parsed from the command line. * @@ -238,6 +237,7 @@ class AclShell extends Shell { //add existence checks for nodes involved $aro = ife(is_numeric($this->args[0]), intval($this->args[0]), $this->args[0]); $aco = ife(is_numeric($this->args[1]), intval($this->args[1]), $this->args[1]); + if ($this->Acl->allow($aro, $aco, $this->args[2])) { $this->out(__("Permission granted.", true), true); } diff --git a/cake/console/libs/templates/skel/config/core.php b/cake/console/libs/templates/skel/config/core.php index f340e7c44..9262ab861 100644 --- a/cake/console/libs/templates/skel/config/core.php +++ b/cake/console/libs/templates/skel/config/core.php @@ -156,55 +156,61 @@ * The classname and database used in CakePHP's * access control lists. */ - define('ACL_CLASSNAME', 'DB_ACL'); - define('ACL_DATABASE', 'default'); + Configure::write('Acl.classname', 'DB_ACL'); + Configure::write('Acl.database', 'default'); /** * Cache Engine Configuration * * File storage engine. * default dir is /app/tmp/cache/ - * $cakeCache = array('File', array( - * [optional] 'duration'=> 3600, - * [optional] 'probability'=> 100, - * [optional] 'dir' => '/tmp', // use system tmp directory - remember to use absolute path - * [optional] 'prefix' => 'cake_', // prefix every cache file with this string - * [optional] 'lock' => false, // use file locking - * [optional] 'serialize' => true, - * )); + * Cache::config('default', array('engine' => 'File' //[required] + * 'duration'=> 3600, //[optional] + * 'probability'=> 100, //[optional] + * 'path' => '/tmp', //[optional] use system tmp directory - remember to use absolute path + * 'prefix' => 'cake_', //[optional] prefix every cache file with this string + * 'lock' => false, //[optional] use file locking + * 'serialize' => true, [optional] + * ) + * ); * * APC (Alternative PHP Cache) - * $cakeCache = array('Apc', array( - * [optional] 'duration'=> 3600, - * [optional] 'probability'=> 100 - * )); + * Cache::config('default', array('engine' => 'Apc' //[required] + * 'duration'=> 3600, //[optional] + * 'probability'=> 100, //[optional] + * ) + * ); * * Xcache (PHP opcode cacher) - * $cakeCache = array('Xcache', array( - * [optional] 'duration'=> 3600, - * [optional] 'probability'=> 100, - * 'user' => 'admin', // user from xcache.admin.user settings - * 'password' => 'your_password', // plaintext password (xcache.admin.pass) - * )); + * Cache::config('default', array('engine' => 'Xcache' //[required] + * 'duration'=> 3600, //[optional] + * 'probability'=> 100, //[optional] + * 'user' => 'admin', //user from xcache.admin.user settings + * password' => 'your_password', //plaintext password (xcache.admin.pass) + * ) + * ); * * Memcache - * $cakeCache = array('Memcache', array( - * [optional] 'duration'=> 3600, - * [optional] 'probability'=> 100, - * [optional] 'servers' => array( - * '127.0.0.1', // localhost, default port - * '10.0.0.1:12345', // port 12345 - * ), - * [optional] 'compress' => true, // compress data in Memcache (slower, but uses less memory) - * )); + * Cache::config('default', array('engine' => 'Memcache' //[required] + * 'duration'=> 3600, //[optional] + * 'probability'=> 100, //[optional] + * 'servers' => array( + * '127.0.0.1', // localhost, default port + * '10.0.0.1:12345', // port 12345 + * ), //[optional] + * 'compress' => true, // [optional] compress data in Memcache (slower, but uses less memory) + * ) + * ); * * Cake Model - * $cakeCache = array('Model', array( - * [optional] 'duration'=> 3600, - * [optional] 'probability'=> 100, - * [optional] 'className' => 'Cache', - * [optional] 'fields' => array('data' => 'data', 'expires => 'expires'), - * [optional] 'serialize' => true, - * )); + * Cache::config('default', array('engine' => 'Model' //[required] + * 'duration'=> 3600, //[optional] + * 'probability'=> 100, //[optional] + * 'className' => 'Cache', //[optional] + * 'fields' => array('data' => 'data', 'expires => 'expires'), //[optional] + * 'serialize' => true, [optional] + * ) + * ); */ - $cakeCache = array('File'); + Cache::config('default', array('engine' => 'File')); + ?> \ No newline at end of file diff --git a/cake/console/libs/templates/views/home.ctp b/cake/console/libs/templates/views/home.ctp index 9d96e26c8..e4288fb9b 100644 --- a/cake/console/libs/templates/views/home.ctp +++ b/cake/console/libs/templates/views/home.ctp @@ -24,7 +24,7 @@ endif; __('Your cache is set up and initialized properly.'); \$settings = Cache::settings(); echo '

'; - echo sprintf(__('%s is being used to cache, to change this edit config'.DS.'core.php ', true), \$settings['name'] . 'Engine'); + echo sprintf(__('%s is being used to cache, to change this edit config'.DS.'core.php ', true), \$settings['engine'] . 'Engine'); echo '

'; echo 'Settings: