当前位置: 首页>>代码示例>>PHP>>正文


PHP apcu_clear_cache函数代码示例

本文整理汇总了PHP中apcu_clear_cache函数的典型用法代码示例。如果您正苦于以下问题:PHP apcu_clear_cache函数的具体用法?PHP apcu_clear_cache怎么用?PHP apcu_clear_cache使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了apcu_clear_cache函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: clear

 /**
  * Deletes all items in the pool.
  *
  * @return boolean
  *   True if the pool was successfully cleared. False if there was an error.
  */
 public function clear()
 {
     if (function_exists('apcu_clear_cache')) {
         return apcu_clear_cache();
     }
     return apc_clear_cache("user");
 }
开发者ID:packaged,项目名称:dal,代码行数:13,代码来源:ApcConnection.php

示例2: clear

 public function clear()
 {
     if ($this->apcu) {
         return apcu_clear_cache();
     }
     return apc_clear_cache();
 }
开发者ID:maslosoft,项目名称:cache,代码行数:7,代码来源:Apc.php

示例3: clearApc

 public static function clearApc()
 {
     if (function_exists('apcu_clear_cache')) {
         apcu_clear_cache();
     }
     return true;
 }
开发者ID:Athorcis,项目名称:athorrent-frontend,代码行数:7,代码来源:CacheUtils.php

示例4: reset

 public function reset()
 {
     try {
         apcu_clear_cache();
     } catch (\Exception $e) {
         \Dsc\System::addMessage($e->getMessage(), 'error');
     }
     $this->app->reroute('/admin/cache/apcu');
 }
开发者ID:WLR86,项目名称:f3-admin,代码行数:9,代码来源:Apcu.php

示例5: setUp

 /**
  * @requires extension apcu
  */
 protected function setUp()
 {
     if (!extension_loaded('apcu')) {
         $this->markTestSkipped('apcu extension not installed');
     }
     if ((bool) ini_get('apc.enable_cli') === false) {
         $this->markTestSkipped('apcu extension not enabled for CLI');
     }
     apcu_clear_cache();
     parent::setUp();
 }
开发者ID:treehouselabs,项目名称:cache,代码行数:14,代码来源:ApcuDriverTest.php

示例6: clear

 public function clear($id = null)
 {
     if ($id === null) {
         if (apcu_clear_cache()) {
             return true;
         }
     } else {
         if (apcu_delete($id)) {
             return true;
         }
     }
     return false;
 }
开发者ID:cangit,项目名称:beatrix,代码行数:13,代码来源:APCu.php

示例7: doFlush

 /**
  * {@inheritdoc}
  */
 protected function doFlush()
 {
     return apcu_clear_cache() && apcu_clear_cache('user');
 }
开发者ID:Briareos,项目名称:Undine,代码行数:7,代码来源:ApcuCache.php

示例8: clear

 /**
  * {@inheritdoc}
  */
 public function clear()
 {
     return apcu_clear_cache();
 }
开发者ID:muhammetardayildiz,项目名称:framework,代码行数:7,代码来源:APCU.php

示例9: createEntityManager

 /**
  * Factory method for Doctrine EntityManager
  *
  * @todo add other caching drivers (memcache, xcache)
  * @todo put into static class? singleton? function or state class?
  */
 public static function createEntityManager($admin = FALSE)
 {
     $config = new ORM\Configuration();
     if (Util\Configuration::read('devmode') == FALSE) {
         $cache = null;
         if (extension_loaded('apcu')) {
             $cache = new Cache\ApcuCache();
         }
         if ($cache) {
             $config->setMetadataCacheImpl($cache);
             $config->setQueryCacheImpl($cache);
         }
     } else {
         if (extension_loaded('apcu')) {
             // clear cache
             apcu_clear_cache('user');
         }
     }
     $driverImpl = $config->newDefaultAnnotationDriver(VZ_DIR . '/lib/Model');
     $config->setMetadataDriverImpl($driverImpl);
     $config->setProxyDir(VZ_DIR . '/lib/Model/Proxy');
     $config->setProxyNamespace('Volkszaehler\\Model\\Proxy');
     $config->setAutoGenerateProxyClasses(Util\Configuration::read('devmode'));
     $dbConfig = Util\Configuration::read('db');
     if ($admin && isset($dbConfig['admin'])) {
         $dbConfig = array_merge($dbConfig, $dbConfig['admin']);
     }
     return ORM\EntityManager::create($dbConfig, $config);
 }
开发者ID:schnello,项目名称:volkszaehler.org,代码行数:35,代码来源:Router.php

示例10: clear_cache

/**
 * Clears all cached data.
 *
 * @return bool
 */
function clear_cache()
{
    \clearstatcache();
    if (\extension_loaded('apcu')) {
        \apcu_clear_cache();
    }
    $dirs = ['comments', 'csp_hash', 'csp_static', 'html_purifier', 'markdown', 'static'];
    foreach ($dirs as $dir) {
        if (!\is_dir($dir)) {
            \mkdir($dir, 0775, true);
            continue;
        }
        foreach (\Airship\list_all_files(ROOT . '/tmp/cache/' . $dir) as $f) {
            if (\is_dir($f)) {
                continue;
            }
            if (\preg_match('#/([0-9a-z]+)$#', $f)) {
                \unlink($f);
            }
        }
    }
    // Nuke the Twig cache separately:
    foreach (\Airship\list_all_files(ROOT . '/tmp/cache/twig') as $f) {
        if (\is_dir($f)) {
            continue;
        }
        if (\preg_match('#/([0-9a-z]+).php$#', $f)) {
            \unlink($f);
        }
    }
    foreach (\glob(ROOT . '/tmp/cache/*.json') as $file) {
        \unlink($file);
    }
    \clearstatcache();
    return true;
}
开发者ID:paragonie,项目名称:airship,代码行数:41,代码来源:Airship.php

示例11: tearDown

 protected function tearDown()
 {
     if (ini_get('apc.enabled') && ini_get('apc.enable_cli')) {
         apcu_clear_cache();
     }
 }
开发者ID:Ener-Getick,项目名称:symfony,代码行数:6,代码来源:ApcClassLoaderTest.php

示例12: flush

 public function flush()
 {
     return $this->apcu ? apcu_clear_cache() : apc_clear_cache('user');
 }
开发者ID:saoyor,项目名称:php-framework,代码行数:4,代码来源:Apc.php

示例13: apcu_clear_cache

            echo <<<EOB
\t\t\t\t<html><body>
\t\t\t\t<h1>Rejected!</h1>
\t\t\t\t<big>Wrong Username or Password!</big><br/>&nbsp;<br/>&nbsp;
\t\t\t\t<big><a href='{$PHP_SELF}?OB={$MYREQUEST['OB']}'>Continue...</a></big>
\t\t\t\t</body></html>
EOB;
            exit;
        } else {
            $AUTHENTICATED = 1;
        }
    }
}
// clear cache
if ($AUTHENTICATED && isset($MYREQUEST['CC']) && $MYREQUEST['CC']) {
    apcu_clear_cache();
}
if ($AUTHENTICATED && !empty($MYREQUEST['DU'])) {
    apcu_delete($MYREQUEST['DU']);
}
if (!function_exists('apcu_cache_info')) {
    echo "No cache info available.  APC does not appear to be running.";
    exit;
}
$cache = apcu_cache_info();
$mem = apcu_sma_info();
// don't cache this page
//
header("Cache-Control: no-store, no-cache, must-revalidate");
// HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
开发者ID:bitweaver,项目名称:kernel,代码行数:31,代码来源:apc.php

示例14: doClear

 /**
  * {@inheritdoc}
  */
 protected function doClear()
 {
     return apcu_clear_cache();
 }
开发者ID:Elsensee,项目名称:symfony,代码行数:7,代码来源:ApcuAdapter.php

示例15: flush

 /**
  * Remove all items from the cache.
  *
  * @return void
  */
 public function flush()
 {
     $this->isApcUEnabled ? apcu_clear_cache() : apc_clear_cache('user');
 }
开发者ID:jhonbendar,项目名称:framework,代码行数:9,代码来源:Apc.php


注:本文中的apcu_clear_cache函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。