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

Conflicts:
	cake/libs/view/helpers/js.php
	cake/tests/lib/templates/missing_conenction.php
	cake/tests/lib/templates/missing_connection.php
	lib/Cake/Model/ConnectionManager.php
	lib/Cake/TestSuite/templates/missing_conenction.php
	lib/Cake/View/Helper/FormHelper.php
	lib/Cake/tests/Case/Core/ConfigureTest.php
This commit is contained in:
Jose Lorenzo Rodriguez 2011-04-11 22:48:08 -04:30
commit 000e05b468
40 changed files with 342 additions and 110 deletions

View file

@ -91,6 +91,21 @@ class Cache {
* Fast reads/writes, and benefits from memcache being distributed.
* - `XcacheEngine` - Uses the Xcache extension, an alternative to APC.
*
* The following keys are used in core cache engines:
*
* - `duration` Specify how long items in this cache configuration last.
* - `prefix` Prefix appended to all entries. Good for when you need to share a keyspace
* with either another cache config or annother application.
* - `probability` Probability of hitting a cache gc cleanup. Setting to 0 will disable
* cache::gc from ever being called automatically.
* - `servers' Used by memcache. Give the address of the memcached servers to use.
* - `compress` Used by memcache. Enables memcache's compressed format.
* - `serialize` Used by FileCache. Should cache objects be serialized first.
* - `path` Used by FileCache. Path to where cachefiles should be saved.
* - `lock` Used by FileCache. Should files be locked before writing to them?
* - `user` Used by Xcache. Username for XCache
* - `password` Used by Xcache. Password for XCache
*
* @see app/config/core.php for configuration settings
* @param string $name Name of the configuration
* @param array $settings Optional associative array of settings passed to the engine
@ -147,7 +162,7 @@ class Cache {
}
self::$_engines[$name] = new $cacheClass();
if (self::$_engines[$name]->init($config)) {
if (time() % self::$_engines[$name]->settings['probability'] === 0) {
if (self::$_engines[$name]->settings['probability'] && time() % self::$_engines[$name]->settings['probability'] === 0) {
self::$_engines[$name]->gc();
}
return true;
@ -579,4 +594,4 @@ abstract class CacheEngine {
$key = Inflector::underscore(str_replace(array(DS, '/', '.'), '_', strval($key)));
return $key;
}
}
}