Skip to content

Commit

Permalink
using the domain cake_error for messages not intended for end users
Browse files Browse the repository at this point in the history
  • Loading branch information
AD7six committed Mar 19, 2011
1 parent 2fc8d88 commit 9b092f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Configure/IniReader.php
Expand Up @@ -27,7 +27,7 @@
* you to create nested arrays structures in an ini config file. For example:
*
* `db.password = secret` would turn into `array('db' => array('password' => 'secret'))`
*
*
* You can nest properties as deeply as needed using .'s. IniReader also manipulates
* how the special ini values of 'yes', 'no', 'on', 'off', 'null' are handled.
* These values will be converted to their boolean equivalents.
Expand Down Expand Up @@ -74,7 +74,7 @@ public function read($file) {
if (!file_exists($filename)) {
$filename .= '.ini';
if (!file_exists($filename)) {
throw new ConfigureException(__d('cake', 'Could not load configuration files: %s or %s', substr($filename, 0, -4), $filename));
throw new ConfigureException(__d('cake_error', 'Could not load configuration files: %s or %s', substr($filename, 0, -4), $filename));
}
}
$contents = parse_ini_file($filename, true);
Expand Down
10 changes: 5 additions & 5 deletions lib/Cake/Configure/PhpReader.php
Expand Up @@ -18,7 +18,7 @@
*/

/**
* PHP Reader allows Configure to load configuration values from
* PHP Reader allows Configure to load configuration values from
* files containing simple PHP arrays.
*
* @package cake.libs.config
Expand Down Expand Up @@ -55,13 +55,13 @@ public function __construct($path = CONFIGS) {
*/
public function read($key) {
if (strpos($key, '..') !== false) {
throw new ConfigureException(__d('cake', 'Cannot load configuration files with ../ in them.'));
throw new ConfigureException(__d('cake_error', 'Cannot load configuration files with ../ in them.'));
}
if (substr($key, -4) === '.php') {
$key = substr($key, 0, -4);
}
list($plugin, $key) = pluginSplit($key);

if ($plugin) {
$file = App::pluginPath($plugin) . 'config' . DS . $key;
} else {
Expand All @@ -70,13 +70,13 @@ public function read($key) {
if (!file_exists($file)) {
$file .= '.php';
if (!file_exists($file)) {
throw new ConfigureException(__d('cake', 'Could not load configuration files: %s or %s', substr($file, 0, -4), $file));
throw new ConfigureException(__d('cake_error', 'Could not load configuration files: %s or %s', substr($file, 0, -4), $file));
}
}
include $file;
if (!isset($config)) {
throw new ConfigureException(
sprintf(__d('cake', 'No variable $config found in %s.php'), $file)
sprintf(__d('cake_error', 'No variable $config found in %s.php'), $file)
);
}
return $config;
Expand Down

0 comments on commit 9b092f4

Please sign in to comment.