diff --git a/app/View/Pages/home.ctp b/app/View/Pages/home.ctp index 687401792..81d66f70f 100644 --- a/app/View/Pages/home.ctp +++ b/app/View/Pages/home.ctp @@ -58,11 +58,11 @@ endif; $settings = Cache::settings(); if (!empty($settings)): echo ''; - echo __d('cake_dev', 'The %s is being used for core caching. To change the config edit %s', '' . $settings['engine'] . 'Engine', 'APP/Config/core.php'); + echo __d('cake_dev', 'The %s is being used for core caching. To change the config edit %s', '' . $settings['engine'] . 'Engine', CONFIG . 'core.php'); echo ''; else: echo ''; - echo __d('cake_dev', 'Your cache is NOT working. Please check the settings in %s', 'APP/Config/core.php'); + echo __d('cake_dev', 'Your cache is NOT working. Please check the settings in %s', CONFIG . 'core.php'); echo ''; endif; ?> @@ -70,7 +70,7 @@ endif;

'; echo __d('cake_dev', 'Your database configuration file is present.'); $filePresent = true; @@ -79,7 +79,7 @@ endif; echo ''; echo __d('cake_dev', 'Your database configuration file is NOT present.'); echo '
'; - echo __d('cake_dev', 'Rename %s to %s', 'APP/Config/database.php.default', 'APP/Config/database.php'); + echo __d('cake_dev', 'Rename %s to %s', CONFIG . 'database.php.default', CONFIG . 'database.php'); echo '
'; endif; ?> diff --git a/app/webroot/index.php b/app/webroot/index.php index 15643e4c6..174ba69f9 100644 --- a/app/webroot/index.php +++ b/app/webroot/index.php @@ -43,6 +43,13 @@ if (!defined('APP_DIR')) { define('APP_DIR', basename(dirname(dirname(__FILE__)))); } +/** + * Config Directory + */ +if (!defined('CONFIG')) { + define('CONFIG', ROOT . DS . APP_DIR . DS . 'Config' . DS); +} + /** * The absolute path to the "cake" directory, WITHOUT a trailing DS. * diff --git a/app/webroot/test.php b/app/webroot/test.php index a41f0af74..efadadc49 100644 --- a/app/webroot/test.php +++ b/app/webroot/test.php @@ -46,6 +46,13 @@ if (!defined('APP_DIR')) { define('APP_DIR', basename(dirname(dirname(__FILE__)))); } +/** + * Config Directory + */ +if (!defined('CONFIG')) { + define('CONFIG', ROOT . DS . APP_DIR . DS . 'Config' . DS); +} + /** * The absolute path to the "Cake" directory, WITHOUT a trailing DS. * diff --git a/lib/Cake/Config/routes.php b/lib/Cake/Config/routes.php index 7bcc0c06b..9fbca5842 100644 --- a/lib/Cake/Config/routes.php +++ b/lib/Cake/Config/routes.php @@ -38,7 +38,7 @@ * - `/:controller' * - `/:controller/:action/*' * - * You can disable the connection of default routes by deleting the require inside APP/Config/routes.php. + * You can disable the connection of default routes by deleting the require inside CONFIG/routes.php. */ $prefixes = Router::prefixes(); diff --git a/lib/Cake/Configure/IniReader.php b/lib/Cake/Configure/IniReader.php index ad3b88145..941b05924 100644 --- a/lib/Cake/Configure/IniReader.php +++ b/lib/Cake/Configure/IniReader.php @@ -73,13 +73,13 @@ class IniReader implements ConfigReaderInterface { * Build and construct a new ini file parser. The parser can be used to read * ini files that are on the filesystem. * - * @param string $path Path to load ini config files from. Defaults to APP . 'Config' . DS + * @param string $path Path to load ini config files from. Defaults to CONFIG * @param string $section Only get one section, leave null to parse and fetch * all sections in the ini file. */ public function __construct($path = null, $section = null) { if (!$path) { - $path = APP . 'Config' . DS; + $path = CONFIG; } $this->_path = $path; $this->_section = $section; diff --git a/lib/Cake/Configure/PhpReader.php b/lib/Cake/Configure/PhpReader.php index d15a41b83..308843e6a 100644 --- a/lib/Cake/Configure/PhpReader.php +++ b/lib/Cake/Configure/PhpReader.php @@ -38,11 +38,11 @@ class PhpReader implements ConfigReaderInterface { /** * Constructor for PHP Config file reading. * - * @param string $path The path to read config files from. Defaults to APP . 'Config' . DS + * @param string $path The path to read config files from. Defaults to CONFIG */ public function __construct($path = null) { if (!$path) { - $path = APP . 'Config' . DS; + $path = CONFIG; } $this->_path = $path; } diff --git a/lib/Cake/Console/Command/AclShell.php b/lib/Cake/Console/Command/AclShell.php index 15536ebb6..dce3ed97a 100644 --- a/lib/Cake/Console/Command/AclShell.php +++ b/lib/Cake/Console/Command/AclShell.php @@ -89,7 +89,7 @@ class AclShell extends AppShell { $this->args = null; return $this->DbConfig->execute(); } - require_once APP . 'Config' . DS . 'database.php'; + require_once CONFIG . 'database.php'; if (!in_array($this->command, array('initdb'))) { $collection = new ComponentCollection(); diff --git a/lib/Cake/Console/Command/ConsoleShell.php b/lib/Cake/Console/Command/ConsoleShell.php index ac270e19b..8301ac670 100644 --- a/lib/Cake/Console/Command/ConsoleShell.php +++ b/lib/Cake/Console/Command/ConsoleShell.php @@ -501,7 +501,7 @@ class ConsoleShell extends AppShell { extract(Router::getNamedExpressions()); //@codingStandardsIgnoreStart - if (!@include APP . 'Config' . DS . 'routes.php') { + if (!@include CONFIG . 'routes.php') { //@codingStandardsIgnoreEnd return false; } diff --git a/lib/Cake/Console/Command/SchemaShell.php b/lib/Cake/Console/Command/SchemaShell.php index a2ddfcc0a..4556a56a5 100644 --- a/lib/Cake/Console/Command/SchemaShell.php +++ b/lib/Cake/Console/Command/SchemaShell.php @@ -476,7 +476,7 @@ class SchemaShell extends AppShell { ); $path = array( 'help' => __d('cake_console', 'Path to read and write schema.php'), - 'default' => APP . 'Config' . DS . 'Schema' + 'default' => CONFIG . 'Schema' ); $file = array( 'help' => __d('cake_console', 'File name to read and write.'), diff --git a/lib/Cake/Console/Command/Task/DbConfigTask.php b/lib/Cake/Console/Command/Task/DbConfigTask.php index ee1aa6c99..9eee53a72 100644 --- a/lib/Cake/Console/Command/Task/DbConfigTask.php +++ b/lib/Cake/Console/Command/Task/DbConfigTask.php @@ -64,7 +64,7 @@ class DbConfigTask extends AppShell { * @return void */ public function initialize() { - $this->path = APP . 'Config' . DS; + $this->path = CONFIG; } /** diff --git a/lib/Cake/Console/Command/Task/PluginTask.php b/lib/Cake/Console/Command/Task/PluginTask.php index 7cd507942..a75220787 100644 --- a/lib/Cake/Console/Command/Task/PluginTask.php +++ b/lib/Cake/Console/Command/Task/PluginTask.php @@ -45,7 +45,7 @@ class PluginTask extends AppShell { */ public function initialize() { $this->path = current(App::path('plugins')); - $this->bootstrap = APP . 'Config' . DS . 'bootstrap.php'; + $this->bootstrap = CONFIG . 'bootstrap.php'; } /** diff --git a/lib/Cake/Console/Command/Task/ProjectTask.php b/lib/Cake/Console/Command/Task/ProjectTask.php index df1ab19db..b047b7748 100644 --- a/lib/Cake/Console/Command/Task/ProjectTask.php +++ b/lib/Cake/Console/Command/Task/ProjectTask.php @@ -79,14 +79,14 @@ class ProjectTask extends AppShell { if ($this->securitySalt($path) === true) { $this->out(__d('cake_console', ' * Random hash key created for \'Security.salt\'')); } else { - $this->err(__d('cake_console', 'Unable to generate random hash for \'Security.salt\', you should change it in %s', APP . 'Config' . DS . 'core.php')); + $this->err(__d('cake_console', 'Unable to generate random hash for \'Security.salt\', you should change it in %s', CONFIG . 'core.php')); $success = false; } if ($this->securityCipherSeed($path) === true) { $this->out(__d('cake_console', ' * Random seed created for \'Security.cipherSeed\'')); } else { - $this->err(__d('cake_console', 'Unable to generate random seed for \'Security.cipherSeed\', you should change it in %s', APP . 'Config' . DS . 'core.php')); + $this->err(__d('cake_console', 'Unable to generate random seed for \'Security.cipherSeed\', you should change it in %s', CONFIG . 'core.php')); $success = false; } @@ -362,7 +362,7 @@ class ProjectTask extends AppShell { * @return bool Success */ public function cakeAdmin($name) { - $path = (empty($this->configPath)) ? APP . 'Config' . DS : $this->configPath; + $path = (empty($this->configPath)) ? CONFIG : $this->configPath; $File = new File($path . 'core.php'); $contents = $File->read(); if (preg_match('%(\s*[/]*Configure::write\(\'Routing.prefixes\',[\s\'a-z,\)\(]*\);)%', $contents, $match)) { diff --git a/lib/Cake/Console/ShellDispatcher.php b/lib/Cake/Console/ShellDispatcher.php index 9882dd9c9..eafd98b96 100644 --- a/lib/Cake/Console/ShellDispatcher.php +++ b/lib/Cake/Console/ShellDispatcher.php @@ -144,7 +144,7 @@ class ShellDispatcher { $boot = file_exists(ROOT . DS . APP_DIR . DS . 'Config' . DS . 'bootstrap.php'); require CORE_PATH . 'Cake' . DS . 'bootstrap.php'; - if (!file_exists(APP . 'Config' . DS . 'core.php')) { + if (!file_exists(CONFIG . 'core.php')) { include_once CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'Config' . DS . 'core.php'; App::build(); } diff --git a/lib/Cake/Console/Templates/skel/View/Pages/home.ctp b/lib/Cake/Console/Templates/skel/View/Pages/home.ctp index 6484c83d9..d39f4365d 100644 --- a/lib/Cake/Console/Templates/skel/View/Pages/home.ctp +++ b/lib/Cake/Console/Templates/skel/View/Pages/home.ctp @@ -62,11 +62,11 @@ endif; $settings = Cache::settings(); if (!empty($settings)): echo ''; - echo __d('cake_dev', 'The %s is being used for core caching. To change the config edit %s', '' . $settings['engine'] . 'Engine', 'APP/Config/core.php'); + echo __d('cake_dev', 'The %s is being used for core caching. To change the config edit %s', '' . $settings['engine'] . 'Engine', CONFIG . 'core.php'); echo ''; else: echo ''; - echo __d('cake_dev', 'Your cache is NOT working. Please check the settings in %s', 'APP/Config/core.php'); + echo __d('cake_dev', 'Your cache is NOT working. Please check the settings in %s', CONFIG . 'core.php'); echo ''; endif; ?> @@ -74,7 +74,7 @@ endif;

'; echo __d('cake_dev', 'Your database configuration file is present.'); $filePresent = true; @@ -83,7 +83,7 @@ endif; echo ''; echo __d('cake_dev', 'Your database configuration file is NOT present.'); echo '
'; - echo __d('cake_dev', 'Rename %s to %s', 'APP/Config/database.php.default', 'APP/Config/database.php'); + echo __d('cake_dev', 'Rename %s to %s', CONFIG . 'database.php.default', CONFIG . 'database.php'); echo '
'; endif; ?> diff --git a/lib/Cake/Controller/Component/Acl/IniAcl.php b/lib/Cake/Controller/Component/Acl/IniAcl.php index 64afa1941..8f9a3cec3 100644 --- a/lib/Cake/Controller/Component/Acl/IniAcl.php +++ b/lib/Cake/Controller/Component/Acl/IniAcl.php @@ -94,7 +94,7 @@ class IniAcl extends CakeObject implements AclInterface { */ public function check($aro, $aco, $action = null) { if (!$this->config) { - $this->config = $this->readConfigFile(APP . 'Config' . DS . 'acl.ini.php'); + $this->config = $this->readConfigFile(CONFIG . 'acl.ini.php'); } $aclConfig = $this->config; diff --git a/lib/Cake/Controller/Component/Acl/PhpAcl.php b/lib/Cake/Controller/Component/Acl/PhpAcl.php index a75d92532..115485017 100644 --- a/lib/Cake/Controller/Component/Acl/PhpAcl.php +++ b/lib/Cake/Controller/Component/Acl/PhpAcl.php @@ -69,7 +69,7 @@ class PhpAcl extends CakeObject implements AclInterface { public function __construct() { $this->options = array( 'policy' => static::DENY, - 'config' => APP . 'Config' . DS . 'acl.php', + 'config' => CONFIG . 'acl.php', ); } diff --git a/lib/Cake/Core/Configure.php b/lib/Cake/Core/Configure.php index 36f29895b..d9c1f63ec 100644 --- a/lib/Cake/Core/Configure.php +++ b/lib/Cake/Core/Configure.php @@ -69,10 +69,10 @@ class Configure { if ($boot) { static::_appDefaults(); - if (!include APP . 'Config' . DS . 'core.php') { + if (!include CONFIG . 'core.php') { trigger_error(__d('cake_dev', "Can't find application core file. Please create %s, and make sure it is readable by PHP.", - APP . 'Config' . DS . 'core.php'), + CONFIG . 'core.php'), E_USER_ERROR ); } @@ -95,10 +95,10 @@ class Configure { } static::_setErrorHandlers($error, $exception); - if (!include APP . 'Config' . DS . 'bootstrap.php') { + if (!include CONFIG . 'bootstrap.php') { trigger_error(__d('cake_dev', "Can't find application bootstrap file. Please create %s, and make sure it is readable by PHP.", - APP . 'Config' . DS . 'bootstrap.php'), + CONFIG . 'bootstrap.php'), E_USER_ERROR ); } diff --git a/lib/Cake/Model/CakeSchema.php b/lib/Cake/Model/CakeSchema.php index 9f68f86da..4a9e16b57 100644 --- a/lib/Cake/Model/CakeSchema.php +++ b/lib/Cake/Model/CakeSchema.php @@ -90,7 +90,7 @@ class CakeSchema extends CakeObject { } if (empty($options['path'])) { - $this->path = APP . 'Config' . DS . 'Schema'; + $this->path = CONFIG . 'Schema'; } $options = array_merge(get_object_vars($this), $options); diff --git a/lib/Cake/Model/ConnectionManager.php b/lib/Cake/Model/ConnectionManager.php index 926b5f22e..f35f1eb4f 100644 --- a/lib/Cake/Model/ConnectionManager.php +++ b/lib/Cake/Model/ConnectionManager.php @@ -64,7 +64,7 @@ class ConnectionManager { * @return void */ protected static function _init() { - include_once APP . 'Config' . DS . 'database.php'; + include_once CONFIG . 'database.php'; if (class_exists('DATABASE_CONFIG')) { static::$config = new DATABASE_CONFIG(); } diff --git a/lib/Cake/Network/Email/CakeEmail.php b/lib/Cake/Network/Email/CakeEmail.php index 812f85a2f..be11219cd 100644 --- a/lib/Cake/Network/Email/CakeEmail.php +++ b/lib/Cake/Network/Email/CakeEmail.php @@ -1241,7 +1241,7 @@ class CakeEmail { if (is_string($config)) { if (!$this->_configInstance) { if (!class_exists($this->_configClass) && !config('email')) { - throw new ConfigureException(__d('cake_dev', '%s not found.', APP . 'Config' . DS . 'email.php')); + throw new ConfigureException(__d('cake_dev', '%s not found.', CONFIG . 'email.php')); } $this->_configInstance = new $this->_configClass(); } diff --git a/lib/Cake/Routing/Router.php b/lib/Cake/Routing/Router.php index 3c0688240..6ae62704b 100644 --- a/lib/Cake/Routing/Router.php +++ b/lib/Cake/Routing/Router.php @@ -1281,7 +1281,7 @@ class Router { */ protected static function _loadRoutes() { static::$initialized = true; - include APP . 'Config' . DS . 'routes.php'; + include CONFIG . 'routes.php'; } } diff --git a/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php b/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php index 793d8daf8..adcd4acdd 100644 --- a/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php +++ b/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php @@ -147,7 +147,7 @@ class SchemaShellTest extends CakeTestCase { $this->assertEquals('TestSchema', $this->Shell->Schema->name); $this->assertEquals('test_schema.php', $this->Shell->Schema->file); $this->assertEquals('default', $this->Shell->Schema->connection); - $this->assertEquals(APP . 'Config' . DS . 'Schema', $this->Shell->Schema->path); + $this->assertEquals(CONFIG . 'Schema', $this->Shell->Schema->path); $this->Shell->Schema = null; $this->Shell->params = array( @@ -169,7 +169,7 @@ class SchemaShellTest extends CakeTestCase { */ public function testView() { $this->Shell->startup(); - $this->Shell->Schema->path = APP . 'Config' . DS . 'Schema'; + $this->Shell->Schema->path = CONFIG . 'Schema'; $this->Shell->params['file'] = 'i18n.php'; $this->Shell->expects($this->once())->method('_stop'); $this->Shell->expects($this->once())->method('out'); @@ -485,7 +485,7 @@ class SchemaShellTest extends CakeTestCase { $this->Shell->params = array( 'connection' => 'test', 'name' => 'I18n', - 'path' => APP . 'Config' . DS . 'Schema' + 'path' => CONFIG . 'Schema' ); $this->Shell->args = array('I18n', 'i18n'); $this->Shell->startup(); diff --git a/lib/Cake/Test/Case/Console/Command/Task/DbConfigTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/DbConfigTaskTest.php index cb4a951dc..4799ebc12 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/DbConfigTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/DbConfigTaskTest.php @@ -44,7 +44,7 @@ class DbConfigTaskTest extends CakeTestCase { array($out, $out, $in) ); - $this->Task->path = APP . 'Config' . DS; + $this->Task->path = CONFIG; } /** @@ -79,7 +79,7 @@ class DbConfigTaskTest extends CakeTestCase { public function testInitialize() { $this->Task->initialize(); $this->assertFalse(empty($this->Task->path)); - $this->assertEquals(APP . 'Config' . DS, $this->Task->path); + $this->assertEquals(CONFIG, $this->Task->path); } /** diff --git a/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php index 15ec76798..9dc28b79c 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php @@ -312,7 +312,7 @@ class ProjectTaskTest extends CakeTestCase { * @return void */ public function testCakeAdmin() { - $File = new File(APP . 'Config' . DS . 'core.php'); + $File = new File(CONFIG . 'core.php'); $contents = $File->read(); $File = new File(TMP . 'tests' . DS . 'core.php'); $File->write($contents); diff --git a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php index 33d268ebe..b48ba50df 100644 --- a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php +++ b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php @@ -153,7 +153,7 @@ class CakeEmailTest extends CakeTestCase { parent::setUp(); $this->_configFileExists = true; - $emailConfig = new File(APP . 'Config' . DS . 'email.php'); + $emailConfig = new File(CONFIG . 'email.php'); if (!$emailConfig->exists()) { $this->_configFileExists = false; $emailConfig->create(); @@ -176,7 +176,7 @@ class CakeEmailTest extends CakeTestCase { App::build(); if (!$this->_configFileExists) { - unlink(APP . 'Config' . DS . 'email.php'); + unlink(CONFIG . 'email.php'); } } diff --git a/lib/Cake/Test/test_app/View/Pages/home.ctp b/lib/Cake/Test/test_app/View/Pages/home.ctp index 06d899208..86501542e 100644 --- a/lib/Cake/Test/test_app/View/Pages/home.ctp +++ b/lib/Cake/Test/test_app/View/Pages/home.ctp @@ -16,11 +16,11 @@ $settings = Cache::settings(); if (!empty($settings)): echo ''; - echo __d('cake_dev', 'The %s is being used for caching. To change the config edit APP/config/core.php ', ''. $settings['engine'] . 'Engine'); + echo __d('cake_dev', 'The %s is being used for caching. To change the config edit %s/core.php ', ''. $settings['engine'] . 'Engine', CONFIG); echo ''; else: echo ''; - echo __d('cake_dev', 'Your cache is NOT working. Please check the settings in APP/config/core.php'); + echo __d('cake_dev', 'Your cache is NOT working. Please check the settings in %s/core.php', CONFIG); echo ''; endif; ?> @@ -28,7 +28,7 @@

'; echo __d('cake_dev', 'Your database configuration file is present.'); $filePresent = true; diff --git a/lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp b/lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp index 19a88e339..eed0537a8 100644 --- a/lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp +++ b/lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp @@ -47,7 +47,7 @@ Html->loadConfig('tags.php');` @@ -1236,7 +1236,7 @@ class HtmlHelper extends AppHelper { * `$this->Html->loadConfig(array('tags.ini', 'ini'));` * * Its expected that the `tags` index will exist from any configuration file that is read. - * You can also specify the path to read the configuration file from, if APP/Config is not + * You can also specify the path to read the configuration file from, if CONFIG is not * where the file is. * * `$this->Html->loadConfig('tags.php', APP . 'Lib' . DS);` @@ -1257,7 +1257,7 @@ class HtmlHelper extends AppHelper { */ public function loadConfig($configFile, $path = null) { if (!$path) { - $path = APP . 'Config' . DS; + $path = CONFIG; } $file = null; $reader = 'php'; diff --git a/lib/Cake/basics.php b/lib/Cake/basics.php index e1edb6ea1..1e2051487 100644 --- a/lib/Cake/basics.php +++ b/lib/Cake/basics.php @@ -46,8 +46,8 @@ if (!function_exists('config')) { $count = count($args); $included = 0; foreach ($args as $arg) { - if (file_exists(APP . 'Config' . DS . $arg . '.php')) { - include_once APP . 'Config' . DS . $arg . '.php'; + if (file_exists(CONFIG . $arg . '.php')) { + include_once CONFIG . $arg . '.php'; $included++; } } diff --git a/lib/Cake/bootstrap.php b/lib/Cake/bootstrap.php index bdd8db4b8..dfb93db73 100644 --- a/lib/Cake/bootstrap.php +++ b/lib/Cake/bootstrap.php @@ -53,6 +53,13 @@ if (!defined('APP')) { define('APP', ROOT . DS . APP_DIR . DS); } +/** + * Config Directory + */ +if (!defined('CONFIG')) { + define('CONFIG', ROOT . DS . APP_DIR . DS . 'Config' . DS); +} + /** * Path to the application's libs directory. */