From a3447592d5b4d2c062fa141b06cb364cb6e00537 Mon Sep 17 00:00:00 2001 From: AD7six Date: Sat, 19 Mar 2011 18:23:01 +0100 Subject: [PATCH] updating langauge domains cake - end user cake_error - error messages cake_developer - not an error just for the developer --- lib/Cake/Routing/Router.php | 2 +- lib/Cake/Utility/ClassRegistry.php | 4 +-- lib/Cake/Utility/Debugger.php | 4 +-- lib/Cake/Utility/Folder.php | 38 +++++++++++++-------------- lib/Cake/Utility/ObjectCollection.php | 2 +- lib/Cake/Utility/Security.php | 2 +- lib/Cake/Utility/Validation.php | 12 ++++----- lib/Cake/Utility/Xml.php | 14 +++++----- 8 files changed, 39 insertions(+), 39 deletions(-) diff --git a/lib/Cake/Routing/Router.php b/lib/Cake/Routing/Router.php index c4d13166fce..edf56a1cb6d 100644 --- a/lib/Cake/Routing/Router.php +++ b/lib/Cake/Routing/Router.php @@ -263,7 +263,7 @@ public static function connect($route, $defaults = array(), $options = array()) if (isset($options['routeClass'])) { $routeClass = $options['routeClass']; if (!is_subclass_of($routeClass, 'CakeRoute')) { - throw new RouterException(__d('cake', 'Route classes must extend CakeRoute')); + throw new RouterException(__d('cake_error', 'Route classes must extend CakeRoute')); } unset($options['routeClass']); if ($routeClass == 'RedirectRoute' && isset($defaults['redirect'])) { diff --git a/lib/Cake/Utility/ClassRegistry.php b/lib/Cake/Utility/ClassRegistry.php index 86d9f161b6a..69675cf7a9b 100644 --- a/lib/Cake/Utility/ClassRegistry.php +++ b/lib/Cake/Utility/ClassRegistry.php @@ -149,7 +149,7 @@ public static function &init($class, $type = null) { } if (!isset(${$class})) { - trigger_error(__d('cake', '(ClassRegistry::init() could not create instance of %1$s class %2$s ', $class, $type), E_USER_WARNING); + trigger_error(__d('cake_error', '(ClassRegistry::init() could not create instance of %1$s class %2$s ', $class, $type), E_USER_WARNING); return $false; } @@ -159,7 +159,7 @@ public static function &init($class, $type = null) { $_this->map($alias, $class); } } elseif (is_numeric($settings)) { - trigger_error(__d('cake', '(ClassRegistry::init() Attempted to create instance of a class with a numeric name'), E_USER_WARNING); + trigger_error(__d('cake_error', '(ClassRegistry::init() Attempted to create instance of a class with a numeric name'), E_USER_WARNING); return $false; } } diff --git a/lib/Cake/Utility/Debugger.php b/lib/Cake/Utility/Debugger.php index 4b81b0f80ad..bb45f67a65f 100644 --- a/lib/Cake/Utility/Debugger.php +++ b/lib/Cake/Utility/Debugger.php @@ -647,11 +647,11 @@ public function outputError($data) { */ public static function checkSecurityKeys() { if (Configure::read('Security.salt') == 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi') { - trigger_error(__d('cake', 'Please change the value of \'Security.salt\' in app/config/core.php to a salt value specific to your application'), E_USER_NOTICE); + trigger_error(__d('cake_error', 'Please change the value of \'Security.salt\' in app/config/core.php to a salt value specific to your application'), E_USER_NOTICE); } if (Configure::read('Security.cipherSeed') === '76859309657453542496749683645') { - trigger_error(__d('cake', 'Please change the value of \'Security.cipherSeed\' in app/config/core.php to a numeric (digits only) seed value specific to your application'), E_USER_NOTICE); + trigger_error(__d('cake_error', 'Please change the value of \'Security.cipherSeed\' in app/config/core.php to a numeric (digits only) seed value specific to your application'), E_USER_NOTICE); } } diff --git a/lib/Cake/Utility/Folder.php b/lib/Cake/Utility/Folder.php index e38656bae84..9e9644c1842 100644 --- a/lib/Cake/Utility/Folder.php +++ b/lib/Cake/Utility/Folder.php @@ -345,11 +345,11 @@ public function chmod($path, $mode = false, $recursive = true, $exceptions = arr if ($recursive === false && is_dir($path)) { if (@chmod($path, intval($mode, 8))) { - $this->__messages[] = __d('cake', '%s changed to %s', $path, $mode); + $this->__messages[] = __d('cake_developer', '%s changed to %s', $path, $mode); return true; } - $this->__errors[] = __d('cake', '%s NOT changed to %s', $path, $mode); + $this->__errors[] = __d('cake_developer', '%s NOT changed to %s', $path, $mode); return false; } @@ -366,9 +366,9 @@ public function chmod($path, $mode = false, $recursive = true, $exceptions = arr } if (@chmod($fullpath, intval($mode, 8))) { - $this->__messages[] = __d('cake', '%s changed to %s', $fullpath, $mode); + $this->__messages[] = __d('cake_developer', '%s changed to %s', $fullpath, $mode); } else { - $this->__errors[] = __d('cake', '%s NOT changed to %s', $fullpath, $mode); + $this->__errors[] = __d('cake_deverloper', '%s NOT changed to %s', $fullpath, $mode); } } } @@ -453,7 +453,7 @@ public function create($pathname, $mode = false) { } if (is_file($pathname)) { - $this->__errors[] = __d('cake', '%s is a file', $pathname); + $this->__errors[] = __d('cake_developer', '%s is a file', $pathname); return false; } $pathname = rtrim($pathname, DS); @@ -464,11 +464,11 @@ public function create($pathname, $mode = false) { $old = umask(0); if (mkdir($pathname, $mode)) { umask($old); - $this->__messages[] = __d('cake', '%s created', $pathname); + $this->__messages[] = __d('cake_developer', '%s created', $pathname); return true; } else { umask($old); - $this->__errors[] = __d('cake', '%s NOT created', $pathname); + $this->__errors[] = __d('cake_developer', '%s NOT created', $pathname); return false; } } @@ -541,9 +541,9 @@ public function delete($path = null) { } if (is_file($file) === true) { if (@unlink($file)) { - $this->__messages[] = __d('cake', '%s removed', $file); + $this->__messages[] = __d('cake_developer', '%s removed', $file); } else { - $this->__errors[] = __d('cake', '%s NOT removed', $file); + $this->__errors[] = __d('cake_developer', '%s NOT removed', $file); } } elseif (is_dir($file) === true && $this->delete($file) === false) { return false; @@ -552,10 +552,10 @@ public function delete($path = null) { } $path = substr($path, 0, strlen($path) - 1); if (rmdir($path) === false) { - $this->__errors[] = __d('cake', '%s NOT removed', $path); + $this->__errors[] = __d('cake_developer', '%s NOT removed', $path); return false; } else { - $this->__messages[] = __d('cake', '%s removed', $path); + $this->__messages[] = __d('cake_developer', '%s removed', $path); } } return true; @@ -590,7 +590,7 @@ public function copy($options = array()) { $mode = $options['mode']; if (!$this->cd($fromDir)) { - $this->__errors[] = __d('cake', '%s not found', $fromDir); + $this->__errors[] = __d('cake_developer', '%s not found', $fromDir); return false; } @@ -599,7 +599,7 @@ public function copy($options = array()) { } if (!is_writable($toDir)) { - $this->__errors[] = __d('cake', '%s not writable', $toDir); + $this->__errors[] = __d('cake_developer', '%s not writable', $toDir); return false; } @@ -613,9 +613,9 @@ public function copy($options = array()) { if (copy($from, $to)) { chmod($to, intval($mode, 8)); touch($to, filemtime($from)); - $this->__messages[] = __d('cake', '%s copied to %s', $from, $to); + $this->__messages[] = __d('cake_developer', '%s copied to %s', $from, $to); } else { - $this->__errors[] = __d('cake', '%s NOT copied to %s', $from, $to); + $this->__errors[] = __d('cake_developer', '%s NOT copied to %s', $from, $to); } } @@ -626,11 +626,11 @@ public function copy($options = array()) { $old = umask(0); chmod($to, $mode); umask($old); - $this->__messages[] = __d('cake', '%s created', $to); + $this->__messages[] = __d('cake_developer', '%s created', $to); $options = array_merge($options, array('to'=> $to, 'from'=> $from)); $this->copy($options); } else { - $this->__errors[] = __d('cake', '%s not created', $to); + $this->__errors[] = __d('cake_developer', '%s not created', $to); } } } @@ -666,7 +666,7 @@ public function move($options) { $options = (array)$options; } $options = array_merge( - array('to' => $to, 'from' => $this->path, 'mode' => $this->mode, 'skip' => array()), + array('to' => $to, 'from' => $this->path, 'mode' => $this->mode, 'skip' => array()), $options ); @@ -746,4 +746,4 @@ public static function isSlashTerm($path) { $lastChar = $path[strlen($path) - 1]; return $lastChar === '/' || $lastChar === '\\'; } -} +} \ No newline at end of file diff --git a/lib/Cake/Utility/ObjectCollection.php b/lib/Cake/Utility/ObjectCollection.php index 4ac2a246bfc..0d98fd405d3 100644 --- a/lib/Cake/Utility/ObjectCollection.php +++ b/lib/Cake/Utility/ObjectCollection.php @@ -105,7 +105,7 @@ public function trigger($callback, $params = array(), $options = array()) { $list = array_keys($this->_loaded); } if ($options['modParams'] !== false && !isset($params[$options['modParams']])) { - throw new CakeException(__d('cake', 'Cannot use modParams with indexes that do not exist.')); + throw new CakeException(__d('cake_error', 'Cannot use modParams with indexes that do not exist.')); } foreach ($list as $name) { $result = call_user_func_array(array($this->_loaded[$name], $callback), $params); diff --git a/lib/Cake/Utility/Security.php b/lib/Cake/Utility/Security.php index fba654e10cb..77475c36d1a 100644 --- a/lib/Cake/Utility/Security.php +++ b/lib/Cake/Utility/Security.php @@ -136,7 +136,7 @@ public static function setHash($hash) { */ public static function cipher($text, $key) { if (empty($key)) { - trigger_error(__d('cake', 'You cannot use an empty key for Security::cipher()'), E_USER_WARNING); + trigger_error(__d('cake_error', 'You cannot use an empty key for Security::cipher()'), E_USER_WARNING); return ''; } diff --git a/lib/Cake/Utility/Validation.php b/lib/Cake/Utility/Validation.php index a28297ad05e..13f9f176fc7 100644 --- a/lib/Cake/Utility/Validation.php +++ b/lib/Cake/Utility/Validation.php @@ -246,7 +246,7 @@ public static function comparison($check1, $operator = null, $check2 = null) { } break; default: - self::$errors[] = __d('cake', 'You must define the $operator parameter for Validation::comparison()'); + self::$errors[] = __d('cake_developer', 'You must define the $operator parameter for Validation::comparison()'); break; } return false; @@ -265,7 +265,7 @@ public static function custom($check, $regex = null) { extract(self::_defaults($check)); } if ($regex === null) { - self::$errors[] = __d('cake', 'You must define a regular expression for Validation::custom()'); + self::$errors[] = __d('cake_developer', 'You must define a regular expression for Validation::custom()'); return false; } return self::_check($check, $regex); @@ -701,7 +701,7 @@ public static function userDefined($check, $object, $method, $args = null) { /** * Checks that a value is a valid uuid - http://tools.ietf.org/html/rfc4122 - * + * * @param string $check Value to check * @return boolean Success * @access public @@ -724,11 +724,11 @@ public static function uuid($check) { protected static function _pass($method, $check, $classPrefix) { $className = ucwords($classPrefix) . 'Validation'; if (!class_exists($className)) { - trigger_error(__d('cake', 'Could not find %s class, unable to complete validation.', $className), E_USER_WARNING); + trigger_error(__d('cake_error', 'Could not find %s class, unable to complete validation.', $className), E_USER_WARNING); return false; } if (!method_exists($className, $method)) { - trigger_error(__d('cake', 'Method %s does not exist on %s unable to complete validation.', $method, $className), E_USER_WARNING); + trigger_error(__d('cake_error', 'Method %s does not exist on %s unable to complete validation.', $method, $className), E_USER_WARNING); return false; } $check = (array)$check; @@ -844,4 +844,4 @@ private static function __populateIp() { private static function __reset() { self::$errors = array(); } -} +} \ No newline at end of file diff --git a/lib/Cake/Utility/Xml.php b/lib/Cake/Utility/Xml.php index bc9a8abbc92..707b1555619 100644 --- a/lib/Cake/Utility/Xml.php +++ b/lib/Cake/Utility/Xml.php @@ -100,9 +100,9 @@ public static function build($input, $options = array()) { $dom->load($input); return $dom; } elseif (!is_string($input)) { - throw new XmlException(__d('cake', 'Invalid input.')); + throw new XmlException(__d('cake_error', 'Invalid input.')); } - throw new XmlException(__d('cake', 'XML cannot be read.')); + throw new XmlException(__d('cake_error', 'XML cannot be read.')); } /** @@ -144,11 +144,11 @@ public static function build($input, $options = array()) { */ public static function fromArray($input, $options = array()) { if (!is_array($input) || count($input) !== 1) { - throw new XmlException(__d('cake', 'Invalid input.')); + throw new XmlException(__d('cake_error', 'Invalid input.')); } $key = key($input); if (is_integer($key)) { - throw new XmlException(__d('cake', 'The key of input must be alphanumeric')); + throw new XmlException(__d('cake_error', 'The key of input must be alphanumeric')); } if (!is_array($options)) { @@ -212,7 +212,7 @@ protected static function _fromArray(&$dom, &$node, &$data, $format) { } } else { if ($key[0] === '@') { - throw new XmlException(__d('cake', 'Invalid array')); + throw new XmlException(__d('cake_error', 'Invalid array')); } if (array_keys($value) === range(0, count($value) - 1)) { // List foreach ($value as $item) { @@ -225,7 +225,7 @@ protected static function _fromArray(&$dom, &$node, &$data, $format) { } } } else { - throw new XmlException(__d('cake', 'Invalid array')); + throw new XmlException(__d('cake_error', 'Invalid array')); } } } @@ -277,7 +277,7 @@ public static function toArray($obj) { $obj = simplexml_import_dom($obj); } if (!($obj instanceof SimpleXMLElement)) { - throw new XmlException(__d('cake', 'The input is not instance of SimpleXMLElement, DOMDocument or DOMNode.')); + throw new XmlException(__d('cake_error', 'The input is not instance of SimpleXMLElement, DOMDocument or DOMNode.')); } $result = array(); $namespaces = array_merge(array('' => ''), $obj->getNamespaces(true));