Excluded method names from several tanslation strings

Removed unnecessary sprintfs
This commit is contained in:
dmromanov 2013-08-16 13:39:38 +04:00
parent c5a306b33c
commit 56ef44f495
9 changed files with 21 additions and 21 deletions

View file

@ -165,7 +165,7 @@ class MemcacheEngine extends CacheEngine {
public function increment($key, $offset = 1) { public function increment($key, $offset = 1) {
if ($this->settings['compress']) { if ($this->settings['compress']) {
throw new CacheException( throw new CacheException(
__d('cake_dev', 'Method increment() not implemented for compressed cache in %s', __CLASS__) __d('cake_dev', 'Method %s not implemented for compressed cache in %s', 'increment()', __CLASS__)
); );
} }
return $this->_Memcache->increment($key, $offset); return $this->_Memcache->increment($key, $offset);
@ -182,7 +182,7 @@ class MemcacheEngine extends CacheEngine {
public function decrement($key, $offset = 1) { public function decrement($key, $offset = 1) {
if ($this->settings['compress']) { if ($this->settings['compress']) {
throw new CacheException( throw new CacheException(
__d('cake_dev', 'Method decrement() not implemented for compressed cache in %s', __CLASS__) __d('cake_dev', 'Method %s not implemented for compressed cache in %s', 'decrement()', __CLASS__)
); );
} }
return $this->_Memcache->decrement($key, $offset); return $this->_Memcache->decrement($key, $offset);

View file

@ -159,7 +159,7 @@ class AclComponent extends Component {
* @deprecated Will be removed in 3.0. * @deprecated Will be removed in 3.0.
*/ */
public function grant($aro, $aco, $action = "*") { public function grant($aro, $aco, $action = "*") {
trigger_error(__d('cake_dev', 'AclComponent::grant() is deprecated, use allow() instead'), E_USER_WARNING); trigger_error(__d('cake_dev', '%s is deprecated, use %s instead', 'AclComponent::grant()', 'allow()'), E_USER_WARNING);
return $this->_Instance->allow($aro, $aco, $action); return $this->_Instance->allow($aro, $aco, $action);
} }
@ -173,7 +173,7 @@ class AclComponent extends Component {
* @deprecated Will be removed in 3.0. * @deprecated Will be removed in 3.0.
*/ */
public function revoke($aro, $aco, $action = "*") { public function revoke($aro, $aco, $action = "*") {
trigger_error(__d('cake_dev', 'AclComponent::revoke() is deprecated, use deny() instead'), E_USER_WARNING); trigger_error(__d('cake_dev', '%s is deprecated, use %s instead', 'AclComponent::revoke()', 'deny()'), E_USER_WARNING);
return $this->_Instance->deny($aro, $aco, $action); return $this->_Instance->deny($aro, $aco, $action);
} }

View file

@ -495,7 +495,7 @@ class AuthComponent extends Component {
throw new CakeException(__d('cake_dev', 'Authorization adapter "%s" was not found.', $class)); throw new CakeException(__d('cake_dev', 'Authorization adapter "%s" was not found.', $class));
} }
if (!method_exists($className, 'authorize')) { if (!method_exists($className, 'authorize')) {
throw new CakeException(__d('cake_dev', 'Authorization objects must implement an authorize method.')); throw new CakeException(__d('cake_dev', 'Authorization objects must implement an %s method.', 'authorize'));
} }
$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);
@ -784,7 +784,7 @@ class AuthComponent extends Component {
throw new CakeException(__d('cake_dev', 'Authentication adapter "%s" was not found.', $class)); throw new CakeException(__d('cake_dev', 'Authentication adapter "%s" was not found.', $class));
} }
if (!method_exists($className, 'authenticate')) { if (!method_exists($className, 'authenticate')) {
throw new CakeException(__d('cake_dev', 'Authentication objects must implement an authenticate method.')); throw new CakeException(__d('cake_dev', 'Authentication objects must implement an %s method.', 'authenticate'));
} }
$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

@ -42,9 +42,9 @@ class LogEngineCollection extends ObjectCollection {
$className = $this->_getLogger($loggerName); $className = $this->_getLogger($loggerName);
$logger = new $className($options); $logger = new $className($options);
if (!$logger instanceof CakeLogInterface) { if (!$logger instanceof CakeLogInterface) {
throw new CakeLogException(sprintf( throw new CakeLogException(
__d('cake_dev', 'logger class %s does not implement a write method.'), $loggerName __d('cake_dev', 'logger class %s does not implement a %s method.', $loggerName, 'write()')
)); );
} }
$this->_loaded[$name] = $logger; $this->_loaded[$name] = $logger;
if ($enable) { if ($enable) {

View file

@ -486,10 +486,10 @@ class CakeSession {
if (!empty($sessionConfig['ini']) && is_array($sessionConfig['ini'])) { if (!empty($sessionConfig['ini']) && is_array($sessionConfig['ini'])) {
foreach ($sessionConfig['ini'] as $setting => $value) { foreach ($sessionConfig['ini'] as $setting => $value) {
if (ini_set($setting, $value) === false) { if (ini_set($setting, $value) === false) {
throw new CakeSessionException(sprintf( throw new CakeSessionException(
__d('cake_dev', 'Unable to configure the session, setting %s failed.'), __d('cake_dev', 'Unable to configure the session, setting %s failed.',
$setting $setting)
)); );
} }
} }
} }

View file

@ -906,7 +906,7 @@ class CakeEmail {
if (!class_exists($transportClassname)) { if (!class_exists($transportClassname)) {
throw new SocketException(__d('cake_dev', 'Class "%s" not found.', $transportClassname)); throw new SocketException(__d('cake_dev', 'Class "%s" not found.', $transportClassname));
} elseif (!method_exists($transportClassname, 'send')) { } elseif (!method_exists($transportClassname, 'send')) {
throw new SocketException(__d('cake_dev', 'The "%s" do not have send method.', $transportClassname)); throw new SocketException(__d('cake_dev', 'The "%s" does not have a %s method.', $transportClassname, 'send()'));
} }
return $this->_transportClass = new $transportClassname(); return $this->_transportClass = new $transportClassname();

View file

@ -604,7 +604,7 @@ class HttpSocket extends CakeSocket {
throw new SocketException(__d('cake_dev', 'Unknown authentication method.')); throw new SocketException(__d('cake_dev', 'Unknown authentication method.'));
} }
if (!method_exists($authClass, 'authentication')) { if (!method_exists($authClass, 'authentication')) {
throw new SocketException(sprintf(__d('cake_dev', 'The %s do not support authentication.'), $authClass)); throw new SocketException(__d('cake_dev', 'The %s do not support authentication.', $authClass));
} }
call_user_func_array("$authClass::authentication", array($this, &$this->_auth[$method])); call_user_func_array("$authClass::authentication", array($this, &$this->_auth[$method]));
} }
@ -633,7 +633,7 @@ class HttpSocket extends CakeSocket {
throw new SocketException(__d('cake_dev', 'Unknown authentication method for proxy.')); throw new SocketException(__d('cake_dev', 'Unknown authentication method for proxy.'));
} }
if (!method_exists($authClass, 'proxyAuthentication')) { if (!method_exists($authClass, 'proxyAuthentication')) {
throw new SocketException(sprintf(__d('cake_dev', 'The %s do not support proxy authentication.'), $authClass)); throw new SocketException(__d('cake_dev', 'The %s do not support proxy authentication.', $authClass));
} }
call_user_func_array("$authClass::proxyAuthentication", array($this, &$this->_proxy)); call_user_func_array("$authClass::proxyAuthentication", array($this, &$this->_proxy));
} }

View file

@ -184,7 +184,7 @@ class Security {
*/ */
public static function cipher($text, $key) { public static function cipher($text, $key) {
if (empty($key)) { if (empty($key)) {
trigger_error(__d('cake_dev', 'You cannot use an empty key for Security::cipher()'), E_USER_WARNING); trigger_error(__d('cake_dev', 'You cannot use an empty key for %s', 'Security::cipher()'), E_USER_WARNING);
return ''; return '';
} }
@ -217,7 +217,7 @@ class Security {
*/ */
public static function rijndael($text, $key, $operation) { public static function rijndael($text, $key, $operation) {
if (empty($key)) { if (empty($key)) {
trigger_error(__d('cake_dev', 'You cannot use an empty key for Security::rijndael()'), E_USER_WARNING); trigger_error(__d('cake_dev', 'You cannot use an empty key for %s', 'Security::rijndael()'), E_USER_WARNING);
return ''; return '';
} }
if (empty($operation) || !in_array($operation, array('encrypt', 'decrypt'))) { if (empty($operation) || !in_array($operation, array('encrypt', 'decrypt'))) {

View file

@ -95,9 +95,9 @@ class PaginatorHelper extends AppHelper {
App::uses($ajaxProvider . 'Helper', 'View/Helper'); App::uses($ajaxProvider . 'Helper', 'View/Helper');
$classname = $ajaxProvider . 'Helper'; $classname = $ajaxProvider . 'Helper';
if (!class_exists($classname) || !method_exists($classname, 'link')) { if (!class_exists($classname) || !method_exists($classname, 'link')) {
throw new CakeException(sprintf( throw new CakeException(
__d('cake_dev', '%s does not implement a link() method, it is incompatible with PaginatorHelper'), $classname __d('cake_dev', '%s does not implement a link() method, it is incompatible with PaginatorHelper', $classname)
)); );
} }
parent::__construct($View, $settings); parent::__construct($View, $settings);
} }