Merge pull request #999 from headzoo/memcache_fix

Windows Memcache Compatibility
This commit is contained in:
Sebastian Grewe 2013-12-17 00:35:23 -08:00
commit 9d9401d673
2 changed files with 18 additions and 0 deletions

View 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);
}
}

View File

@ -18,6 +18,9 @@ class StatsCache {
if (! $config['memcache']['enabled'] ) {
$this->debug->append("Not storing any values in memcache");
} else {
if (PHP_OS == 'WINNT') {
require_once(CLASS_DIR . '/memcached.class.php');
}
$this->cache = new Memcached();
}
}