remove CONFIGS constant

This commit is contained in:
AD7six 2011-04-17 13:13:02 +02:00
parent 9e0e19c5ac
commit 0cb70ae3bb
21 changed files with 61 additions and 65 deletions

View file

@ -34,9 +34,12 @@ class PhpReader implements ConfigReaderInterface {
/**
* Constructor for PHP Config file reading.
*
* @param string $path The path to read config files from. Defaults to CONFIGS
* @param string $path The path to read config files from. Defaults to APP . 'Config' . DS
*/
public function __construct($path = CONFIGS) {
public function __construct($path = null) {
if (!$path) {
$path = APP . 'Config' . DS;
}
$this->_path = $path;
}

View file

@ -86,7 +86,7 @@ class AclShell extends Shell {
$this->args = null;
return $this->DbConfig->execute();
}
require_once (CONFIGS.'database.php');
require_once (APP . 'Config' . DS . 'database.php');
if (!in_array($this->command, array('initdb'))) {
$collection = new ComponentCollection();

View file

@ -339,7 +339,7 @@ class ConsoleShell extends Shell {
Router::reload();
extract(Router::getNamedExpressions());
if (!@include(CONFIGS . 'routes.php')) {
if (!@include(APP . 'Config' . DS . 'routes.php')) {
return false;
}
Router::parse('/');

View file

@ -440,7 +440,7 @@ class SchemaShell extends Shell {
);
$path = array(
'help' => __d('cake_console', 'Path to read and write schema.php'),
'default' => CONFIGS . 'Schema'
'default' => APP . 'Config' . 'Schema'
);
$file = array(
'help' => __d('cake_console', 'File name to read and write.'),

View file

@ -82,14 +82,14 @@ class ProjectTask extends Shell {
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', CONFIGS . 'core.php'));
$this->err(__d('cake_console', 'Unable to generate random hash for \'Security.salt\', you should change it in %s', APP . 'Config' . DS . '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', CONFIGS . 'core.php'));
$this->err(__d('cake_console', 'Unable to generate random seed for \'Security.cipherSeed\', you should change it in %s', APP . 'Config' . DS . 'core.php'));
$success = false;
}
@ -313,7 +313,7 @@ class ProjectTask extends Shell {
* @return boolean Success
*/
public function cakeAdmin($name) {
$path = (empty($this->configPath)) ? CONFIGS : $this->configPath;
$path = (empty($this->configPath)) ? APP . 'Config' . DS : $this->configPath;
$File = new File($path . 'core.php');
$contents = $File->read();
if (preg_match('%(\s*[/]*Configure::write\(\'Routing.prefixes\',[\s\'a-z,\)\(]*\);)%', $contents, $match)) {

View file

@ -37,7 +37,7 @@ endif;
<p>
<?php
\$filePresent = null;
if (file_exists(CONFIGS . 'database.php')):
if (file_exists(APP . 'Config' . DS . 'database.php')):
echo '<span class=\"notice success\">';
echo __('Your database configuration file is present.');
\$filePresent = true;

View file

@ -597,7 +597,7 @@ class IniAcl extends Object implements AclInterface {
*/
public function check($aro, $aco, $aco_action = null) {
if ($this->config == null) {
$this->config = $this->readConfigFile(CONFIGS . 'acl.ini.php');
$this->config = $this->readConfigFile(APP . 'Config' . DS . 'acl.ini.php');
}
$aclConfig = $this->config;

View file

@ -69,14 +69,14 @@ class Configure {
'www_root' => WWW_ROOT
));
if (!include(CONFIGS . 'core.php')) {
trigger_error(__d('cake_dev', "Can't find application core file. Please create %score.php, and make sure it is readable by PHP.", CONFIGS), E_USER_ERROR);
if (!include(APP . 'Config' . DS . 'core.php')) {
trigger_error(__d('cake_dev', "Can't find application core file. Please create %score.php, and make sure it is readable by PHP.", APP . 'Config' . DS), E_USER_ERROR);
}
App::init();
App::build();
if (!include(CONFIGS . 'bootstrap.php')) {
trigger_error(__d('cake_dev', "Can't find application bootstrap file. Please create %sbootstrap.php, and make sure it is readable by PHP.", CONFIGS), E_USER_ERROR);
if (!include(APP . 'Config' . DS . 'bootstrap.php')) {
trigger_error(__d('cake_dev', "Can't find application bootstrap file. Please create %sbootstrap.php, and make sure it is readable by PHP.", APP . 'Config' . DS), E_USER_ERROR);
}
$level = -1;
if (isset(self::$_values['Error']['level'])) {

View file

@ -94,7 +94,7 @@ class CakeSchema extends Object {
}
if (empty($options['path'])) {
$this->path = CONFIGS . 'Schema';
$this->path = APP . 'Config' . 'Schema';
}
$options = array_merge(get_object_vars($this), $options);

View file

@ -65,7 +65,7 @@ class ConnectionManager {
*
*/
private static function init() {
include_once CONFIGS . 'database.php';
include_once APP . 'Config' . DS . 'database.php';
if (class_exists('DATABASE_CONFIG')) {
self::$config = new DATABASE_CONFIG();
}

View file

@ -890,7 +890,7 @@ class CakeEmail {
public function send($content = null) {
if (is_string($this->_config)) {
if (!config('email')) {
throw new SocketException(__d('cake', '%s not found.', CONFIGS . 'email.php'));
throw new SocketException(__d('cake', '%s not found.', APP . 'Config' . 'email.php'));
}
$configs = new EmailConfig();
if (!isset($configs->{$this->_config})) {
@ -971,7 +971,7 @@ class CakeEmail {
if (is_string($transportConfig)) {
if (!config('email')) {
throw new SocketException(__d('cake', '%s not found.', CONFIGS . 'email.php'));
throw new SocketException(__d('cake', '%s not found.', APP . 'Config' . 'email.php'));
}
$configs = new EmailConfig();
if (!isset($configs->{$transportConfig})) {

View file

@ -236,7 +236,7 @@ class Dispatcher {
* @return void
*/
protected function _loadRoutes() {
include CONFIGS . 'routes.php';
include APP . 'Config' . DS . 'routes.php';
}
/**

View file

@ -400,7 +400,7 @@ class SchemaShellTest extends CakeTestCase {
$this->Shell->params = array(
'connection' => 'test',
'name' => 'DbAcl',
'path' => CONFIGS . 'schema'
'path' => APP . 'Config' . DS . 'schema'
);
$this->Shell->args = array('DbAcl', 'acos');
$this->Shell->startup();

View file

@ -220,7 +220,7 @@ class ProjectTaskTest extends CakeTestCase {
* @return void
*/
public function testCakeAdmin() {
$file = new File(CONFIGS . 'core.php');
$file = new File(APP . 'Config' . DS . 'core.php');
$contents = $file->read();;
$file = new File(TMP . 'tests' . DS . 'core.php');
$file->write($contents);

View file

@ -49,7 +49,7 @@ App::uses('Debugger', 'Utility');
<p>
<?php
$filePresent = null;
if (file_exists(CONFIGS.'database.php')):
if (file_exists(APP . 'Config' . DS.'database.php')):
echo '<span class="notice success">';
echo __d('cake_dev', 'Your database configuration file is present.');
$filePresent = true;

View file

@ -62,7 +62,7 @@
<?php
echo __d('cake', 'Your database configuration file is ');
$filePresent = null;
if (file_exists(CONFIGS.'database.php')):
if (file_exists(APP . 'Config'.'database.php')):
echo __d('cake', 'present.');
$filePresent = true;
else:

View file

@ -928,7 +928,7 @@ class HtmlHelper extends AppHelper {
* @param string $path Path with config file
* @return mixed False to error or loaded configs
*/
public function loadConfig($configFile, $path = CONFIGS) {
public function loadConfig($configFile, $path = APP . 'Config' . DS) {
$file = null;
$reader = 'php';

View file

@ -57,7 +57,7 @@ endif;
<p>
<?php
$filePresent = null;
if (file_exists(CONFIGS.'database.php')):
if (file_exists(APP . 'Config' . DS 'database.php')):
echo '<span class="notice success">';
echo __d('cake_dev', 'Your database configuration file is present.');
$filePresent = true;

View file

@ -44,10 +44,10 @@
function config() {
$args = func_get_args();
foreach ($args as $arg) {
if ($arg === 'database' && file_exists(CONFIGS . 'database.php')) {
include_once(CONFIGS . $arg . '.php');
} elseif (file_exists(CONFIGS . $arg . '.php')) {
include_once(CONFIGS . $arg . '.php');
if ($arg === 'database' && file_exists(APP . 'Config' . 'database.php')) {
include_once(APP . 'Config' . $arg . '.php');
} elseif (file_exists(APP . 'Config' . $arg . '.php')) {
include_once(APP . 'Config' . $arg . '.php');
if (count($args) == 1) {
return true;

View file

@ -53,13 +53,6 @@ if (!defined('APP')) {
*/
define('APPLIBS', APP.'Lib'.DS);
/**
* Path to the configuration files directory.
*/
if (!defined('CONFIGS')) {
define('CONFIGS', APP.'Config'.DS);
}
/**
* Path to the public CSS directory.
*/

View file

@ -62,7 +62,7 @@
<?php
echo __d('cake', 'Your database configuration file is ');
$filePresent = null;
if (file_exists(CONFIGS.'database.php')):
if (file_exists(APP . 'Config' . DS.'database.php')):
echo __d('cake', 'present.');
$filePresent = true;
else: