Merge remote branch 'origin/2.0' into 2.0-class-loading

Conflicts:
	cake/libs/view/scaffolds/edit.ctp
	cake/libs/view/scaffolds/form.ctp
	cake/tests/test_app/plugins/test_plugin/views/tests/scaffold.edit.ctp
	cake/tests/test_app/plugins/test_plugin/views/tests/scaffold.form.ctp
	cake/tests/test_app/views/posts/scaffold.edit.ctp
	cake/tests/test_app/views/posts/scaffold.form.ctp
	lib/Cake/Error/ErrorHandler.php
	lib/Cake/Model/Behavior/TranslateBehavior.php
	lib/Cake/Model/Datasource/CakeSession.php
	lib/Cake/Routing/Router.php
	lib/Cake/TestSuite/TestManager.php
	lib/Cake/View/scaffolds/edit.ctp
	lib/Cake/tests/cases/console/shells/bake.test.php
	lib/Cake/tests/cases/libs/cake_log.test.php
	lib/Cake/tests/cases/libs/cake_request.test.php
	lib/Cake/tests/cases/libs/view/helpers/number.test.php
	lib/Cake/tests/test_app/plugins/test_plugin/views/tests/scaffold.edit.ctp
	lib/Cake/tests/test_app/views/posts/scaffold.edit.ctp
This commit is contained in:
José Lorenzo Rodríguez 2010-12-15 01:13:05 -04:30
commit 07e43bb0f8
122 changed files with 4822 additions and 2612 deletions

View file

@ -69,7 +69,7 @@ class Cache {
* @param string $name Name of the configuration
* @param array $settings Optional associative array of settings passed to the engine
* @return array(engine, settings) on success, false on failure
* @throws Exception
* @throws CacheException
*/
public static function config($name = null, $settings = array()) {
if (is_array($name)) {
@ -116,10 +116,10 @@ class Cache {
return false;
}
$cacheClass = $class . 'Engine';
self::$_engines[$name] = new $cacheClass();
if (!self::$_engines[$name] instanceof CacheEngine) {
throw new Exception(__('Cache engines must use CacheEngine as a base class.'));
if (!is_subclass_of($cacheClass, 'CacheEngine')) {
throw new CacheException(__('Cache engines must use CacheEngine as a base class.'));
}
self::$_engines[$name] = new $cacheClass();
if (self::$_engines[$name]->init($config)) {
if (time() % self::$_engines[$name]->settings['probability'] === 0) {
self::$_engines[$name]->gc();

View file

@ -249,20 +249,20 @@ class FileEngine extends CacheEngine {
* Not implemented
*
* @return void
* @throws BadMethodCallException
* @throws CacheException
*/
public function decrement($key, $offset = 1) {
throw new BadMethodCallException(__('Files cannot be atomically decremented.'));
throw new CacheException(__('Files cannot be atomically decremented.'));
}
/**
* Not implemented
*
* @return void
* @throws BadMethodCallException
* @throws CacheException
*/
public function increment($key, $offset = 1) {
throw new BadMethodCallException(__('Files cannot be atomically incremented.'));
throw new CacheException(__('Files cannot be atomically incremented.'));
}
/**

View file

@ -148,11 +148,11 @@ class MemcacheEngine extends CacheEngine {
* @param integer $offset How much to increment
* @param integer $duration How long to cache the data, in seconds
* @return New incremented value, false otherwise
* @throws RuntimeException when you try to increment with compress = true
* @throws CacheException when you try to increment with compress = true
*/
public function increment($key, $offset = 1) {
if ($this->settings['compress']) {
throw new RuntimeException(
throw new CacheException(
__('Method increment() not implemented for compressed cache in %s', __CLASS__)
);
}
@ -166,11 +166,11 @@ class MemcacheEngine extends CacheEngine {
* @param integer $offset How much to substract
* @param integer $duration How long to cache the data, in seconds
* @return New decremented value, false otherwise
* @throws RuntimeException when you try to decrement with compress = true
* @throws CacheException when you try to decrement with compress = true
*/
public function decrement($key, $offset = 1) {
if ($this->settings['compress']) {
throw new RuntimeException(
throw new CacheException(
__('Method decrement() not implemented for compressed cache in %s', __CLASS__)
);
}