コード例 #1
0
ファイル: statscache.class.php プロジェクト: ed-ro0t/php-mpos
     * @return data mixed Return our stored data unchanged
     **/
    public function setCache($key, $data, $expiration = NULL)
    {
        if ($this->config['memcache']['enabled']) {
            $this->set($key, $data, $expiration);
        }
        return $data;
    }
    /**
     * This method is invoked if the called method was not realised in this class
     **/
    public function __call($name, $arguments)
    {
        if (!$this->config['memcache']['enabled']) {
            return false;
        }
        //Invoke method $name of $this->cache class with array of $arguments
        return call_user_func_array(array($this->cache, $name), $arguments);
    }
}
$memcache = new StatsCache($config, $debug);
$memcache->addServer($config['memcache']['host'], $config['memcache']['port']);
// Now we can set our additional key prefix
if ($aTmpBlock = $block->getLast()) {
    $iRoundId = $aTmpBlock['id'];
} else {
    $iRoundId = 0;
}
$memcache->setRound($iRoundId);
コード例 #2
0
ファイル: statscache.class.php プロジェクト: xisi/mpos-fusion
     * This method is invoked if the called method was not realised in this class
     **/
    public function __call($name, $arguments)
    {
        if (!$this->config['memcache']['enabled']) {
            return false;
        }
        //Invoke method $name of $this->cache class with array of $arguments
        return call_user_func_array(array($this->cache, $name), $arguments);
    }
}
$memcache = new StatsCache($config, $debug);
$memcache->addServer($config['memcache']['host'], $config['memcache']['port']);
// Now we can set our additional key prefix
if ($aTmpBlock = $block->getLast()) {
    $iRoundId = $aTmpBlock['id'];
} else {
    $iRoundId = 0;
}
$memcache->setRound($iRoundId);
$memcache->flag = 0;
$memcache_mm = new StatsCache($config, $debug);
$memcache_mm->addServer($config['memcache']['host'], $config['memcache']['port']);
// Now we can set our additional key prefix
if ($aTmpBlock_mm = $block_mm->getLast()) {
    $iRoundId_mm = $aTmpBlock_mm['id'];
} else {
    $iRoundId_mm = 0;
}
$memcache_mm->setRound($iRoundId_mm);
$memcache_mm->flag = 1;