Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 4b72160

Browse files
author
Jamie Snape
committed
Tweak memcache initialization
1 parent 342a576 commit 4b72160

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

core/GlobalController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function preDispatch()
117117
if(!$this->isDebug())
118118
{
119119
$frontendOptions = array('automatic_serialization' => true, 'lifetime' => 86400);
120-
if(extension_loaded('memcache'))
120+
if(extension_loaded('memcache') || session_save_path() === 'Memcache')
121121
{
122122
$cache = Zend_Cache::factory('Core', 'Memcached', $frontendOptions, array());
123123
}
@@ -128,7 +128,7 @@ public function preDispatch()
128128
else
129129
{
130130
$cacheDir = UtilityComponent::getCacheDirectory() . '/db';
131-
if(is_writable($cacheDir))
131+
if(is_dir($cacheDir) && is_writable($cacheDir))
132132
{
133133
$backendOptions = array('cache_dir' => $cacheDir);
134134
$cache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);

library/Zend/Cache/Backend/Libmemcached.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class Zend_Cache_Backend_Libmemcached extends Zend_Cache_Backend implements Zend
9696
*/
9797
public function __construct(array $options = array())
9898
{
99-
if (!extension_loaded('memcached')) {
99+
if (!extension_loaded('memcached') || session_save_path() !== 'Memcache') {
100100
Zend_Cache::throwException('The memcached extension must be loaded for using this backend !');
101101
}
102102

library/Zend/Cache/Backend/Memcached.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class Zend_Cache_Backend_Memcached extends Zend_Cache_Backend implements Zend_Ca
119119
*/
120120
public function __construct(array $options = array())
121121
{
122-
if (!extension_loaded('memcache')) {
122+
if (!extension_loaded('memcache') || session_save_path() !== 'Memcache') {
123123
Zend_Cache::throwException('The memcache extension must be loaded for using this backend !');
124124
}
125125
parent::__construct($options);

0 commit comments

Comments
 (0)