Merge pull request #999 from headzoo/memcache_fix
Windows Memcache Compatibility
This commit is contained in:
commit
9d9401d673
15
public/include/classes/memcached.class.php
Normal file
15
public/include/classes/memcached.class.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A wrapper class which provides compatibility between Memcached and Memcache
|
||||||
|
* PHP uses the Memcached class on *nix environments, and the Memcache class
|
||||||
|
* on Windows. This class provides compatibility between the two.
|
||||||
|
**/
|
||||||
|
class Memcached
|
||||||
|
extends Memcache
|
||||||
|
{
|
||||||
|
public function set($key, $value, $expiration = 0)
|
||||||
|
{
|
||||||
|
return parent::set($key, $value, 0, $expiration);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -18,6 +18,9 @@ class StatsCache {
|
|||||||
if (! $config['memcache']['enabled'] ) {
|
if (! $config['memcache']['enabled'] ) {
|
||||||
$this->debug->append("Not storing any values in memcache");
|
$this->debug->append("Not storing any values in memcache");
|
||||||
} else {
|
} else {
|
||||||
|
if (PHP_OS == 'WINNT') {
|
||||||
|
require_once(CLASS_DIR . '/memcached.class.php');
|
||||||
|
}
|
||||||
$this->cache = new Memcached();
|
$this->cache = new Memcached();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user