use the domain cake_error for error message intended for the developer

This commit is contained in:
AD7six 2011-03-19 18:07:05 +01:00
parent 9b092f4bf2
commit f95340b361
6 changed files with 22 additions and 22 deletions

View file

@ -68,7 +68,7 @@ class AclComponent extends Component {
list($plugin, $name) = pluginSplit($name); list($plugin, $name) = pluginSplit($name);
$name .= 'Component'; $name .= 'Component';
} else { } else {
throw new CakeException(__d('cake', 'Could not find %s.', $name)); throw new CakeException(__d('cake_error', 'Could not find %s.', $name));
} }
} }
$this->adapter($name); $this->adapter($name);
@ -92,7 +92,7 @@ class AclComponent extends Component {
$adapter = new $adapter(); $adapter = new $adapter();
} }
if (!$adapter instanceof AclInterface) { if (!$adapter instanceof AclInterface) {
throw new CakeException(__d('cake', 'AclComponent adapters must implement AclInterface')); throw new CakeException(__d('cake_error', 'AclComponent adapters must implement AclInterface'));
} }
$this->_Instance = $adapter; $this->_Instance = $adapter;
$this->_Instance->initialize($this); $this->_Instance->initialize($this);
@ -163,7 +163,7 @@ class AclComponent extends Component {
* @deprecated * @deprecated
*/ */
public function grant($aro, $aco, $action = "*") { public function grant($aro, $aco, $action = "*") {
trigger_error(__d('cake', 'AclComponent::grant() is deprecated, use allow() instead'), E_USER_WARNING); trigger_error(__d('cake_error', 'AclComponent::grant() is deprecated, use allow() instead'), E_USER_WARNING);
return $this->_Instance->allow($aro, $aco, $action); return $this->_Instance->allow($aro, $aco, $action);
} }
@ -177,7 +177,7 @@ class AclComponent extends Component {
* @deprecated * @deprecated
*/ */
public function revoke($aro, $aco, $action = "*") { public function revoke($aro, $aco, $action = "*") {
trigger_error(__d('cake', 'AclComponent::revoke() is deprecated, use deny() instead'), E_USER_WARNING); trigger_error(__d('cake_error', 'AclComponent::revoke() is deprecated, use deny() instead'), E_USER_WARNING);
return $this->_Instance->deny($aro, $aco, $action); return $this->_Instance->deny($aro, $aco, $action);
} }
} }
@ -299,12 +299,12 @@ class DbAcl extends Object implements AclInterface {
$acoPath = $this->Aco->node($aco); $acoPath = $this->Aco->node($aco);
if (empty($aroPath) || empty($acoPath)) { if (empty($aroPath) || empty($acoPath)) {
trigger_error(__d('cake', "DbAcl::check() - Failed ARO/ACO node lookup in permissions check. Node references:\nAro: ") . print_r($aro, true) . "\nAco: " . print_r($aco, true), E_USER_WARNING); trigger_error(__d('cake_error', "DbAcl::check() - Failed ARO/ACO node lookup in permissions check. Node references:\nAro: ") . print_r($aro, true) . "\nAco: " . print_r($aco, true), E_USER_WARNING);
return false; return false;
} }
if ($acoPath == null || $acoPath == array()) { if ($acoPath == null || $acoPath == array()) {
trigger_error(__d('cake', "DbAcl::check() - Failed ACO node lookup in permissions check. Node references:\nAro: ") . print_r($aro, true) . "\nAco: " . print_r($aco, true), E_USER_WARNING); trigger_error(__d('cake_error', "DbAcl::check() - Failed ACO node lookup in permissions check. Node references:\nAro: ") . print_r($aro, true) . "\nAco: " . print_r($aco, true), E_USER_WARNING);
return false; return false;
} }
@ -312,7 +312,7 @@ class DbAcl extends Object implements AclInterface {
$acoNode = $acoPath[0]; $acoNode = $acoPath[0];
if ($action != '*' && !in_array('_' . $action, $permKeys)) { if ($action != '*' && !in_array('_' . $action, $permKeys)) {
trigger_error(__d('cake', "ACO permissions key %s does not exist in DbAcl::check()", $action), E_USER_NOTICE); trigger_error(__d('cake_error', "ACO permissions key %s does not exist in DbAcl::check()", $action), E_USER_NOTICE);
return false; return false;
} }
@ -386,7 +386,7 @@ class DbAcl extends Object implements AclInterface {
$save = array(); $save = array();
if ($perms == false) { if ($perms == false) {
trigger_error(__d('cake', 'DbAcl::allow() - Invalid node'), E_USER_WARNING); trigger_error(__d('cake_error', 'DbAcl::allow() - Invalid node'), E_USER_WARNING);
return false; return false;
} }
if (isset($perms[0])) { if (isset($perms[0])) {

View file

@ -87,7 +87,7 @@ abstract class BaseAuthorize {
public function controller($controller = null) { public function controller($controller = null) {
if ($controller) { if ($controller) {
if (!$controller instanceof Controller) { if (!$controller instanceof Controller) {
throw new CakeException(__d('cake', '$controller needs to be an instance of Controller')); throw new CakeException(__d('cake_error', '$controller needs to be an instance of Controller'));
} }
$this->_Controller = $controller; $this->_Controller = $controller;
return true; return true;

View file

@ -46,7 +46,7 @@ class ControllerAuthorize extends BaseAuthorize {
public function controller($controller = null) { public function controller($controller = null) {
if ($controller) { if ($controller) {
if (!method_exists($controller, 'isAuthorized')) { if (!method_exists($controller, 'isAuthorized')) {
throw new CakeException(__d('cake', '$controller does not implement an isAuthorized() method.')); throw new CakeException(__d('cake_error', '$controller does not implement an isAuthorized() method.'));
} }
} }
return parent::controller($controller); return parent::controller($controller);

View file

@ -81,7 +81,7 @@ class CrudAuthorize extends BaseAuthorize {
*/ */
public function authorize($user, CakeRequest $request) { public function authorize($user, CakeRequest $request) {
if (!isset($this->settings['actionMap'][$request->params['action']])) { if (!isset($this->settings['actionMap'][$request->params['action']])) {
trigger_error(__d('cake', trigger_error(__d('cake_error',
'CrudAuthorize::authorize() - Attempted access of un-mapped action "%1$s" in controller "%2$s"', 'CrudAuthorize::authorize() - Attempted access of un-mapped action "%1$s" in controller "%2$s"',
$request->action, $request->action,
$request->controller $request->controller

View file

@ -411,10 +411,10 @@ class AuthComponent extends Component {
$className = $class . 'Authorize'; $className = $class . 'Authorize';
App::uses($className, $plugin . 'Controller/Component/Auth'); App::uses($className, $plugin . 'Controller/Component/Auth');
if (!class_exists($className)) { if (!class_exists($className)) {
throw new CakeException(__d('cake', 'Authorization adapter "%s" was not found.', $class)); throw new CakeException(__d('cake_error', 'Authorization adapter "%s" was not found.', $class));
} }
if (!method_exists($className, 'authorize')) { if (!method_exists($className, 'authorize')) {
throw new CakeException(__d('cake', 'Authorization objects must implement an authorize method.')); throw new CakeException(__d('cake_error', 'Authorization objects must implement an authorize method.'));
} }
$settings = array_merge($global, (array)$settings); $settings = array_merge($global, (array)$settings);
$this->_authorizeObjects[] = new $className($this->_Collection, $settings); $this->_authorizeObjects[] = new $className($this->_Collection, $settings);
@ -651,10 +651,10 @@ class AuthComponent extends Component {
$className = $class . 'Authenticate'; $className = $class . 'Authenticate';
App::uses($className, $plugin . 'Controller/Component/Auth'); App::uses($className, $plugin . 'Controller/Component/Auth');
if (!class_exists($className)) { if (!class_exists($className)) {
throw new CakeException(__d('cake', 'Authentication adapter "%s" was not found.', $class)); throw new CakeException(__d('cake_error', 'Authentication adapter "%s" was not found.', $class));
} }
if (!method_exists($className, 'authenticate')) { if (!method_exists($className, 'authenticate')) {
throw new CakeException(__d('cake', 'Authentication objects must implement an authenticate method.')); throw new CakeException(__d('cake_error', 'Authentication objects must implement an authenticate method.'));
} }
$settings = array_merge($global, (array)$settings); $settings = array_merge($global, (array)$settings);
$this->_authenticateObjects[] = new $className($this->_Collection, $settings); $this->_authenticateObjects[] = new $className($this->_Collection, $settings);

View file

@ -725,7 +725,7 @@ class EmailComponent extends Component {
$formatted = array(); $formatted = array();
if ($this->_lineLength !== null) { if ($this->_lineLength !== null) {
trigger_error(__d('cake', '_lineLength cannot be accessed please use lineLength'), E_USER_WARNING); trigger_error(__d('cake_error', '_lineLength cannot be accessed please use lineLength'), E_USER_WARNING);
$this->lineLength = $this->_lineLength; $this->lineLength = $this->_lineLength;
} }