using the domain cake_error for error messages.

These are error message for developers
This commit is contained in:
AD7six 2011-03-19 17:58:47 +01:00
parent b90939f659
commit 2fc8d88916
3 changed files with 25 additions and 25 deletions

View file

@ -143,7 +143,7 @@ class Cache {
} }
$cacheClass = $class . 'Engine'; $cacheClass = $class . 'Engine';
if (!is_subclass_of($cacheClass, 'CacheEngine')) { if (!is_subclass_of($cacheClass, 'CacheEngine')) {
throw new CacheException(__d('cake', 'Cache engines must use CacheEngine as a base class.')); throw new CacheException(__d('cake_error', 'Cache engines must use CacheEngine as a base class.'));
} }
self::$_engines[$name] = new $cacheClass(); self::$_engines[$name] = new $cacheClass();
if (self::$_engines[$name]->init($config)) { if (self::$_engines[$name]->init($config)) {
@ -283,7 +283,7 @@ class Cache {
self::set(null, $config); self::set(null, $config);
if ($success === false && $value !== '') { if ($success === false && $value !== '') {
trigger_error( trigger_error(
__d('cake', "%s cache was unable to write '%s' to cache", $config, $key), __d('cake_error', "%s cache was unable to write '%s' to cache", $config, $key),
E_USER_WARNING E_USER_WARNING
); );
} }

View file

@ -251,7 +251,7 @@ class FileEngine extends CacheEngine {
* @throws CacheException * @throws CacheException
*/ */
public function decrement($key, $offset = 1) { public function decrement($key, $offset = 1) {
throw new CacheException(__d('cake', 'Files cannot be atomically decremented.')); throw new CacheException(__d('cake_error', 'Files cannot be atomically decremented.'));
} }
/** /**
@ -261,7 +261,7 @@ class FileEngine extends CacheEngine {
* @throws CacheException * @throws CacheException
*/ */
public function increment($key, $offset = 1) { public function increment($key, $offset = 1) {
throw new CacheException(__d('cake', 'Files cannot be atomically incremented.')); throw new CacheException(__d('cake_error', 'Files cannot be atomically incremented.'));
} }
/** /**
@ -297,7 +297,7 @@ class FileEngine extends CacheEngine {
$dir = new SplFileInfo($this->settings['path']); $dir = new SplFileInfo($this->settings['path']);
if ($this->_init && !($dir->isDir() && $dir->isWritable())) { if ($this->_init && !($dir->isDir() && $dir->isWritable())) {
$this->_init = false; $this->_init = false;
trigger_error(__d('cake', '%s is not writable', $this->settings['path']), E_USER_WARNING); trigger_error(__d('cake_error', '%s is not writable', $this->settings['path']), E_USER_WARNING);
return false; return false;
} }
return true; return true;

View file

@ -153,7 +153,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', 'Method increment() not implemented for compressed cache in %s', __CLASS__) __d('cake_error', 'Method increment() not implemented for compressed cache in %s', __CLASS__)
); );
} }
return $this->_Memcache->increment($key, $offset); return $this->_Memcache->increment($key, $offset);
@ -171,7 +171,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', 'Method decrement() not implemented for compressed cache in %s', __CLASS__) __d('cake_error', 'Method decrement() not implemented for compressed cache in %s', __CLASS__)
); );
} }
return $this->_Memcache->decrement($key, $offset); return $this->_Memcache->decrement($key, $offset);