mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-29 05:47:17 +08:00
Merge branch 'master' into redis
* master: (131 commits) css fix. Finished model generator. more tests for FileHelper Added note about theme asset bundle to bootstrap widgets guide fixed typos in ArrayHelperBase phpdoc More tests for ArrayHelper and Inflector Fixed typo and code style Fixes #21: implemented jQueryUI Slider Fixes #790: added visible for Nav and Dropdown finished rule generation for model generator. bug fix of form generator. minor fixes of debugger. Added SafeValidator. fix dataProvider getSort() cleanup MemCache timeout API after #804 Added failureCallback, reduced timeouts to 1s Mentioning that timeoutms is available in memcache only. set default format for gridview to text Removed extra line Added timeoutms parameter in MemCache ... Conflicts: tests/unit/data/config.php
This commit is contained in:
@@ -44,7 +44,7 @@ class GroupDependency extends Dependency
|
||||
{
|
||||
$version = $cache->get(array(__CLASS__, $this->group));
|
||||
if ($version === false) {
|
||||
$version = $this->invalidate($cache, array(__CLASS__, $this->group));
|
||||
$version = $this->invalidate($cache, $this->group);
|
||||
}
|
||||
return $version;
|
||||
}
|
||||
|
||||
@@ -93,8 +93,13 @@ class MemCache extends Cache
|
||||
if ($this->useMemcached) {
|
||||
$cache->addServer($server->host, $server->port, $server->weight);
|
||||
} else {
|
||||
$cache->addServer($server->host, $server->port, $server->persistent,
|
||||
$server->weight, $server->timeout, $server->retryInterval, $server->status);
|
||||
// $timeout is used for memcache versions that do not have timeoutms parameter
|
||||
$timeout = (int) ($server->timeout / 1000) + (($server->timeout % 1000 > 0) ? 1 : 0);
|
||||
$cache->addServer(
|
||||
$server->host, $server->port, $server->persistent,
|
||||
$server->weight, $timeout, $server->retryInterval,
|
||||
$server->status, $server->failureCallback, $server->timeout
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -35,9 +35,11 @@ class MemCacheServer extends \yii\base\Object
|
||||
*/
|
||||
public $persistent = true;
|
||||
/**
|
||||
* @var integer value in seconds which will be used for connecting to the server. This is used by memcache only.
|
||||
* @var integer timeout in milliseconds which will be used for connecting to the server.
|
||||
* This is used by memcache only. For old versions of memcache that only support specifying
|
||||
* timeout in seconds this will be rounded up to full seconds.
|
||||
*/
|
||||
public $timeout = 15;
|
||||
public $timeout = 1000;
|
||||
/**
|
||||
* @var integer how often a failed server will be retried (in seconds). This is used by memcache only.
|
||||
*/
|
||||
@@ -46,4 +48,11 @@ class MemCacheServer extends \yii\base\Object
|
||||
* @var boolean if the server should be flagged as online upon a failure. This is used by memcache only.
|
||||
*/
|
||||
public $status = true;
|
||||
/**
|
||||
* @var \Closure this callback function will run upon encountering an error.
|
||||
* The callback is run before fail over is attempted. The function takes two parameters,
|
||||
* the [[host]] and the [[port]] of the failed server.
|
||||
* This is used by memcache only.
|
||||
*/
|
||||
public $failureCallback;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user