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


PHP apcu_fetch函数代码示例

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


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

示例1: getLastWriteTime

 /**
  * {@inheritdoc}
  */
 public function getLastWriteTime()
 {
     if (!$this->exists()) {
         return time();
     }
     return apcu_fetch($this->storeId . '.lastmod');
 }
开发者ID:lucidphp,项目名称:mux-cache,代码行数:10,代码来源:Apcu.php

示例2: fetch

 public function fetch($key, $default = '')
 {
     if (!apcu_exists($this->hash($key))) {
         return $default;
     }
     return apcu_fetch($this->hash($key));
 }
开发者ID:ArtifexTech,项目名称:life-jacket,代码行数:7,代码来源:Apcu.php

示例3: get

 /**
  * {@inheritdoc}
  *
  * @return void
  */
 public function get($key)
 {
     if ($this->apcu) {
         return apcu_fetch($key);
     }
     return apc_fetch($key);
 }
开发者ID:orno,项目名称:cache,代码行数:12,代码来源:ApcAdapter.php

示例4: shortcode_ldjam

function shortcode_ldjam($atts)
{
    ld_get_vars();
    // Populate the $ldvar global //
    global $ldvar;
    // Verify URL //
    if (isset($_GET['u'])) {
        $url = to_slug($_GET['u']);
        if ($url !== $_GET['u']) {
            $_GET['u'] = $url;
            $link = "//{$_SERVER['HTTP_HOST']}{$_SERVER['REDIRECT_URL']}";
            $link = htmlspecialchars($link, ENT_QUOTES, 'UTF-8');
            $link .= "?" . http_build_query($_GET);
            $link = str_replace('%2F', '/', $link);
            // Replace % code for / with an actual slash //
            ld_redirect($link);
        }
    }
    $id = null;
    // Verify ID //
    if (isset($_GET['i'])) {
        $id = base_decode(base_fix($_GET['i']));
    }
    //	ld_redirect
    //	print_r($_GET);
    //	echo( to_slug($_GET['u']) );
    $shimmy = apcu_fetch('shimmy');
    echo $_GET['u'];
    echo " | " . $id;
    echo " | " . base_encode($id);
    //print_r($_SERVER);
    return "<br />I am very important";
}
开发者ID:philhassey,项目名称:ludumdare,代码行数:33,代码来源:ldjam.php

示例5: test_purge

 /**
  * Test purging the apcu cache store.
  */
 public function test_purge()
 {
     if (!cachestore_apcu::are_requirements_met()) {
         $this->markTestSkipped('Could not test cachestore_apcu. Requirements are not met.');
     }
     $definition = cache_definition::load_adhoc(cache_store::MODE_APPLICATION, 'cachestore_apcu', 'phpunit_test');
     $instance = cachestore_apcu::initialise_unit_test_instance($definition);
     // Test a simple purge return.
     $this->assertTrue($instance->purge());
     // Test purge works.
     $this->assertTrue($instance->set('test', 'monster'));
     $this->assertSame('monster', $instance->get('test'));
     $this->assertTrue($instance->purge());
     $this->assertFalse($instance->get('test'));
     // Test purge with custom data.
     $this->assertTrue($instance->set('test', 'monster'));
     $this->assertSame('monster', $instance->get('test'));
     $this->assertTrue(apcu_store('test', 'pirate', 180));
     $this->assertSame('monster', $instance->get('test'));
     $this->assertTrue(apcu_exists('test'));
     $this->assertSame('pirate', apcu_fetch('test'));
     // Purge and check that our data is gone but the the custom data is still there.
     $this->assertTrue($instance->purge());
     $this->assertFalse($instance->get('test'));
     $this->assertTrue(apcu_exists('test'));
     $this->assertSame('pirate', apcu_fetch('test'));
 }
开发者ID:linnaea,项目名称:moodle-cachestore_apcu,代码行数:30,代码来源:apcu_test.php

示例6: read

 public function read()
 {
     if (!apcu_exists($this->key)) {
         return array('_global' => array());
     }
     return apcu_fetch($this->key);
 }
开发者ID:ArtifexTech,项目名称:life-jacket,代码行数:7,代码来源:Apcu.php

示例7: get

 /**
  * {@inheritdoc}
  */
 public function get($name)
 {
     if ($this->driver == self::APCU_DRIVER) {
         return apcu_fetch($this->prefix . $name);
     }
     return apc_fetch($this->prefix . $name);
 }
开发者ID:tuneyourserver,项目名称:components,代码行数:10,代码来源:APCStore.php

示例8: fetch

 public function fetch($key)
 {
     if (apcu_exists($key)) {
         return apcu_fetch($key);
     }
     return false;
 }
开发者ID:Athorcis,项目名称:athorrent-frontend,代码行数:7,代码来源:ApcCache.php

示例9: testConstructor

 public function testConstructor()
 {
     $loader = new ClassLoader();
     $loader->addPrefix('Apc\\Namespaced', __DIR__ . DIRECTORY_SEPARATOR . 'Fixtures');
     $loader = new ApcClassLoader('test.prefix.', $loader);
     $this->assertEquals($loader->findFile('\\Apc\\Namespaced\\FooBar'), apcu_fetch('test.prefix.\\Apc\\Namespaced\\FooBar'), '__construct() takes a prefix as its first argument');
 }
开发者ID:Ener-Getick,项目名称:symfony,代码行数:7,代码来源:ApcClassLoaderTest.php

示例10: getArrayDataFromStorage

 /**
  * {@inheritdoc}
  */
 protected function getArrayDataFromStorage(array $keys)
 {
     $result = apcu_fetch($keys);
     if ($result === false) {
         return [];
     }
     return $result;
 }
开发者ID:tlumx,项目名称:framework,代码行数:11,代码来源:ApcuCachePool.php

示例11: get

 public function get($name)
 {
     if ($this->hasAPCu) {
         return apcu_fetch($name);
     } else {
         return $_SESSION[$name];
     }
 }
开发者ID:xuedi,项目名称:pedetes,代码行数:8,代码来源:cache.php

示例12: getBlacklist

 public static function getBlacklist()
 {
     $blacklist = apcu_fetch(self::$prefix . self::BLACKLIST_KEY);
     if (empty($blacklist)) {
         return [];
     }
     return $blacklist;
 }
开发者ID:ariarijp,项目名称:cassowary,代码行数:8,代码来源:ApcuAdapter.php

示例13: get

 /**
  * Get.
  * @param  string $key
  * @param  any    $valueDefault
  * @return any
  */
 public final function get(string $key, $valueDefault = null)
 {
     $value = apcu_fetch($key, $ok);
     if (!$ok) {
         $value = $valueDefault;
     }
     return $value;
 }
开发者ID:froq,项目名称:froq-cache,代码行数:14,代码来源:Apcu.php

示例14: get

 public function get($key)
 {
     $result = apcu_fetch($this->getPrefix() . $key, $success);
     if (!$success) {
         return null;
     }
     return $result;
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:8,代码来源:APCu.php

示例15: get

 /**
  * Returns the value of a cache entry from its key
  *
  * @api
  *
  * @param  string    $key the key of the cache entry
  * @return mixed the value of the entry, as it was passed to CacheInterface::set, null if not present in cache
  */
 public function get($key)
 {
     $value = \apcu_fetch($key, $success);
     if (!$success) {
         return null;
     }
     return $value;
 }
开发者ID:webguyblake,项目名称:php-kit,代码行数:16,代码来源:ApcCache.php


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