зеркало из https://github.com/mozilla/gecko-dev.git
Moved memcache instantiation inside an if() that checks for cache_config and also that memcache exists using class_exists().
This should let us still do development on chameleon without requiring the memcache extension.
This commit is contained in:
Родитель
eecb0ccf93
Коммит
0fe291771c
|
@ -48,18 +48,21 @@ define('SCRIPT_NAME',substr($_SERVER['SCRIPT_NAME'], strlen(WEB_PATH.'/'), strle
|
||||||
*/
|
*/
|
||||||
$memcacheId = md5(SCRIPT_NAME.$_SERVER['QUERY_STRING']);
|
$memcacheId = md5(SCRIPT_NAME.$_SERVER['QUERY_STRING']);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the cache_config to see if the current page is supposed to be cached.
|
||||||
|
* If it is, try to connect. If connection to the cache server fails, fall back on regular runtime.
|
||||||
|
* We also are storing the status of the connection in $memcacheConnected for use in finish.php.
|
||||||
|
*/
|
||||||
|
if (!empty($cache_config[SCRIPT_NAME]) && class_exists('memcache') ) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiate our memcache object.
|
* Instantiate our memcache object.
|
||||||
*/
|
*/
|
||||||
$cache = new memcache();
|
$cache = new memcache();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check the cache_config to see if the current page is supposed to be cached.
|
* Boolean so we know whether or not we've found a valid memcached server.
|
||||||
* If it is, try to connect. If connection to the cache server fails, fall back on regular runtime.
|
|
||||||
* We also are storing the status of the connection in $memcacheConnected for use in finish.php.
|
|
||||||
*/
|
*/
|
||||||
if (!empty($cache_config[SCRIPT_NAME]) ) {
|
|
||||||
|
|
||||||
$memcacheConnected = false;
|
$memcacheConnected = false;
|
||||||
|
|
||||||
if (is_array($memcache_config)) {
|
if (is_array($memcache_config)) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче