Skip to content

Commit

Permalink
remove CONFIGS constant
Browse files Browse the repository at this point in the history
  • Loading branch information
AD7six committed May 15, 2011
1 parent 9e0e19c commit 0cb70ae
Show file tree
Hide file tree
Showing 21 changed files with 61 additions and 65 deletions.
9 changes: 6 additions & 3 deletions lib/Cake/Configure/PhpReader.php
Expand Up @@ -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;
}

Expand Down Expand Up @@ -81,4 +84,4 @@ public function read($key) {
}
return $config;
}
}
}
10 changes: 5 additions & 5 deletions lib/Cake/Console/Command/AclShell.php
Expand Up @@ -20,7 +20,7 @@
App::uses('DbAcl', 'Model');

/**
* Shell for ACL management. This console is known to have issues with zend.ze1_compatibility_mode
* Shell for ACL management. This console is known to have issues with zend.ze1_compatibility_mode
* being enabled. Be sure to turn it off when using this shell.
*
* @package cake.console.libs
Expand Down Expand Up @@ -86,7 +86,7 @@ public function startup() {
$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();
Expand Down Expand Up @@ -348,13 +348,13 @@ public function initdb() {
*/
public function getOptionParser() {
$parser = parent::getOptionParser();

$type = array(
'choices' => array('aro', 'aco'),
'choices' => array('aro', 'aco'),
'required' => true,
'help' => __d('cake_console', 'Type of node to create.')
);

$parser->description(__d('cake_console', 'A console tool for managing the DbAcl'))
->addSubcommand('create', array(
'help' => __d('cake_console', 'Create a new ACL node'),
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Console/Command/ConsoleShell.php
Expand Up @@ -339,7 +339,7 @@ protected function _loadRoutes() {
Router::reload();
extract(Router::getNamedExpressions());

if (!@include(CONFIGS . 'routes.php')) {
if (!@include(APP . 'Config' . DS . 'routes.php')) {
return false;
}
Router::parse('/');
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Console/Command/SchemaShell.php
Expand Up @@ -440,7 +440,7 @@ public function getOptionParser() {
);
$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.'),
Expand Down
6 changes: 3 additions & 3 deletions lib/Cake/Console/Command/Task/ProjectTask.php
Expand Up @@ -82,14 +82,14 @@ public function execute() {
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;
}

Expand Down Expand Up @@ -313,7 +313,7 @@ public function corePath($path) {
* @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)) {
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Console/templates/default/views/home.ctp
Expand Up @@ -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;
Expand Down Expand Up @@ -93,4 +93,4 @@ $output .= "\t\tYou can also add some CSS styles for your pages at: %s',\n";
$output .= "\t\tAPP . 'View' . DS . 'Pages' . DS . 'home.ctp.<br />', APP . 'View' . DS . 'Layouts' . DS . 'default.ctp.<br />', APP . 'webroot' . DS . 'css');\n";
$output .= "?>\n";
$output .= "</p>\n";
?>
?>
24 changes: 12 additions & 12 deletions lib/Cake/Controller/Component/AclComponent.php
Expand Up @@ -238,8 +238,8 @@ public function initialize($component);
}

/**
* DbAcl implements an ACL control system in the database. ARO's and ACO's are
* structured into trees and a linking table is used to define permissions. You
* DbAcl implements an ACL control system in the database. ARO's and ACO's are
* structured into trees and a linking table is used to define permissions. You
* can install the schema for DbAcl with the Schema Shell.
*
* `$aco` and `$aro` parameters can be slash delimited paths to tree nodes.
Expand Down Expand Up @@ -515,7 +515,7 @@ protected function _getAcoKeys($keys) {
}

/**
* IniAcl implements an access control system using an INI file. An example
* IniAcl implements an access control system using an INI file. An example
* of the ini file used can be found in /config/acl.ini.php.
*
* @package cake.libs.model.iniacl
Expand All @@ -542,11 +542,11 @@ class IniAcl extends Object implements AclInterface {
/**
* Initialize method
*
* @param AclBase $component
* @param AclBase $component
* @return void
*/
public function initialize($component) {

}

/**
Expand All @@ -558,7 +558,7 @@ public function initialize($component) {
* @return boolean Success
*/
public function allow($aro, $aco, $action = "*") {

}

/**
Expand All @@ -570,7 +570,7 @@ public function allow($aro, $aco, $action = "*") {
* @return boolean Success
*/
public function deny($aro, $aco, $action = "*") {

}

/**
Expand All @@ -582,12 +582,12 @@ public function deny($aro, $aco, $action = "*") {
* @return boolean Success
*/
public function inherit($aro, $aco, $action = "*") {

}

/**
* Main ACL check function. Checks to see if the ARO (access request object) has access to the
* ACO (access control object).Looks at the acl.ini.php file for permissions
* Main ACL check function. Checks to see if the ARO (access request object) has access to the
* ACO (access control object).Looks at the acl.ini.php file for permissions
* (see instructions in /config/acl.ini.php).
*
* @param string $aro ARO
Expand All @@ -597,10 +597,10 @@ public function inherit($aro, $aco, $action = "*") {
*/
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;

if (is_array($aro)) {
$aro = Set::classicExtract($aro, $this->userPath);
}
Expand Down
8 changes: 4 additions & 4 deletions lib/Cake/Core/Configure.php
Expand Up @@ -69,14 +69,14 @@ public static function bootstrap($boot = true) {
'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'])) {
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Model/CakeSchema.php
Expand Up @@ -94,7 +94,7 @@ function __construct($options = array()) {
}

if (empty($options['path'])) {
$this->path = CONFIGS . 'Schema';
$this->path = APP . 'Config' . 'Schema';
}

$options = array_merge(get_object_vars($this), $options);
Expand Down Expand Up @@ -277,7 +277,7 @@ public function read($options = array()) {
if (in_array($withTable, $currentTables)) {
$key = array_search($withTable, $currentTables);
$noPrefixWith = str_replace($prefix, '', $withTable);

$tables[$noPrefixWith] = $this->__columns($Object->$class);
$tables[$noPrefixWith]['indexes'] = $db->index($Object->$class);
$tables[$noPrefixWith]['tableParameters'] = $db->readTableParameters($withTable);
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Model/ConnectionManager.php
Expand Up @@ -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();
}
Expand Down Expand Up @@ -265,4 +265,4 @@ public static function shutdown() {
session_write_close();
}
}
}
}
6 changes: 3 additions & 3 deletions lib/Cake/Network/Email/CakeEmail.php
Expand Up @@ -46,7 +46,7 @@ class CakeEmail {
const LINE_LENGTH_SHOULD = 78;

/**
* Line length - no must more - RFC 2822 - 2.1.1
* Line length - no must more - RFC 2822 - 2.1.1
*
* @constant LINE_LENGTH_MUST
*/
Expand Down Expand Up @@ -890,7 +890,7 @@ public function config($config = null) {
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})) {
Expand Down Expand Up @@ -971,7 +971,7 @@ public static function deliver($to = null, $subject = null, $message = null, $tr

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})) {
Expand Down
10 changes: 5 additions & 5 deletions lib/Cake/Routing/Dispatcher.php
Expand Up @@ -33,7 +33,7 @@

/**
* Dispatcher converts Requests into controller actions. It uses the dispatched Request
* to locate and load the correct controller. If found, the requested action is called on
* to locate and load the correct controller. If found, the requested action is called on
* the controller.
*
* @package cake
Expand Down Expand Up @@ -64,7 +64,7 @@ public function __construct($url = null, $base = false) {
* to autoRender, via Controller::$autoRender, then Dispatcher will render the view.
*
* Actions in CakePHP can be any public method on a controller, that is not declared in Controller. If you
* want controller methods to be public and in-accesible by URL, then prefix them with a `_`.
* want controller methods to be public and in-accesible by URL, then prefix them with a `_`.
* For example `public function _loadPosts() { }` would not be accessible via URL. Private and protected methods
* are also not accessible via URL.
*
Expand Down Expand Up @@ -103,7 +103,7 @@ public function dispatch(CakeRequest $request, $additionalParams = array()) {
}

/**
* Check if the request's action is marked as private, with an underscore, of if the request is attempting to
* Check if the request's action is marked as private, with an underscore, of if the request is attempting to
* directly accessing a prefixed action.
*
* @param CakeRequest $request The request to check
Expand Down Expand Up @@ -236,7 +236,7 @@ protected function _loadController($request) {
* @return void
*/
protected function _loadRoutes() {
include CONFIGS . 'routes.php';
include APP . 'Config' . DS . 'routes.php';
}

/**
Expand Down Expand Up @@ -278,7 +278,7 @@ public function asset($url) {
}
$filters = Configure::read('Asset.filter');
$isCss = (
strpos($url, 'ccss/') === 0 ||
strpos($url, 'ccss/') === 0 ||
preg_match('#^(theme/([^/]+)/ccss/)|(([^/]+)(?<!css)/ccss)/#i', $url)
);
$isJs = (
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Console/Command/SchemaShellTest.php
Expand Up @@ -400,7 +400,7 @@ public function testCreateWithTableArgs() {
$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();
Expand Down
Expand Up @@ -220,7 +220,7 @@ public function testGetPrefix() {
* @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);
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/test_app/View/Pages/home.ctp
Expand Up @@ -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;
Expand Down Expand Up @@ -160,4 +160,4 @@ You can also add some CSS styles for your pages at: APP/webroot/css.');
<ul><li><?php echo __d('cake_dev', 'Recommended Software Books'); ?></li></ul></li>
<li><a href="http://www.cafepress.com/cakefoundation"><?php echo __d('cake_dev', 'CakePHP gear'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'Get your own CakePHP gear - Doughnate to Cake'); ?></li></ul></li>
</ul>
</ul>
2 changes: 1 addition & 1 deletion lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/View/Helper/HtmlHelper.php
Expand Up @@ -648,7 +648,7 @@ function getCrumbList($options = array()) {
return null;
}
}

/**
* Creates a formatted IMG element. If `$options['url']` is provided, an image link will be
* generated with the link pointed at `$options['url']`. This method will set an empty
Expand Down Expand Up @@ -928,7 +928,7 @@ function __nestedListItem($items, $options, $itemOptions, $tag) {
* @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';

Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/View/Pages/home.ctp
Expand Up @@ -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;
Expand Down Expand Up @@ -168,4 +168,4 @@ You can also add some CSS styles for your pages at: APP/webroot/css.');
<ul><li><?php echo __d('cake_dev', 'Recommended Software Books'); ?></li></ul></li>
<li><a href="http://www.cafepress.com/cakefoundation"><?php echo __d('cake_dev', 'CakePHP gear'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'Get your own CakePHP gear - Doughnate to Cake'); ?></li></ul></li>
</ul>
</ul>

0 comments on commit 0cb70ae

Please sign in to comment.