/**
  * @override
  */
 function WdfRenderAsRoot()
 {
     if (!hook_already_fired(HOOK_PRE_RENDER)) {
         execute_hooks(HOOK_PRE_RENDER, array($this));
     }
     return $this->WdfRender();
 }
Beispiel #2
0
/**
 * Gets a list of all keys in the cache.
 * 
 * @return array list of all keys
 */
function globalcache_list_keys()
{
    if (!hook_already_fired(HOOK_POST_INIT)) {
        return array();
    }
    global $CONFIG;
    switch ($CONFIG['globalcache']['CACHE']) {
        case globalcache_CACHE_DB:
            $ds = model_datasource($CONFIG['globalcache']['datasource']);
            try {
                $rs = $ds->ExecuteSql("SELECT full_key FROM wdf_cache WHERE (valid_until IS NULL OR valid_until>=" . $ds->Driver->Now() . ")");
                return $rs->Enumerate('full_key');
            } catch (Exception $ex) {
            }
            return array();
        case globalcache_CACHE_APC:
            $ret = array();
            $cacheinfo = apc_cache_info('user');
            $keyprefixlen = strlen($GLOBALS["globalcache_key_prefix"]);
            foreach ($cacheinfo['cache_list'] as $cacheentry) {
                $ret[] = substr($cacheentry['info'], $keyprefixlen);
            }
            return $ret;
            break;
        default:
            WdfException::Log("globalcache_list_keys not implemented for handler {$CONFIG['globalcache']['CACHE']}");
            break;
    }
    return array();
}