prosper202 v1.2.0 with xcache

alter if() to if() and elseif() in 202-config/connect.php
if( @xcache_set( 'test', 'test' ) ) {
if( include_once($_SERVER['DOCUMENT_ROOT'] . '/202-config/class-xcache.php') ) {
$memcache = new XCache;
$memcacheWorking = true;
}
}
elseif ( ini_get('memcache.default_port') ) {
$memcacheInstalled = true;
$memcache = new Memcache;
if ( @$memcache->connect($mchost, 11211) ) {
$memcacheWorking = true;
}
else {
$memcacheWorking = false;
}
}

create 202-config/class-xcache.php
class XCache {
function set( $key, $value, $ttl = 0 ) {
if( xcache_set( $key, $value, $ttl ) ) {
return true;
}
return false;
}
function get( $key ) {
if( $value = xcache_get( $key ) ) {
return $value;
}
return false;
}
function delete( $key ) {
if( xcache_unset( $key ) ) {
return true;
}
return false;
}
}
?>

code not tested - i dont have time to get more detailed into it - you should get it by yourself. oh and the code formatting is baked because of wordpress. like i said, i have no time. make the best out of it.

Activity

No comments, leave your comment or trackback.

Leave a Reply


Search

The archives run deep. Feel free to search older content using topic keywords.