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


PHP Memcache::close方法代码示例

本文整理汇总了PHP中Memcache::close方法的典型用法代码示例。如果您正苦于以下问题:PHP Memcache::close方法的具体用法?PHP Memcache::close怎么用?PHP Memcache::close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Memcache的用法示例。


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

示例1: csvDataToMemcache

function csvDataToMemcache($csvList, $csvDir, $memIP, $memPort)
{
    $memcached = new Memcache();
    $memcached->connect($memIP, $memPort);
    foreach ($csvList as $key => $value) {
        $csvObj = new parseCSV();
        $csvObj->auto($csvDir . '/' . $value);
        list($fileName, $fileType) = explode('.', $value);
        $memcached->set($fileName, $csvObj->data, MEMCACHE_COMPRESSED, 0);
        //debug info
        //echo "<br/>--------------------------------------------$fileName.csv to memcache-------------------------------------------<br/>";
        print_r($memcached->get($fileName));
    }
    $memcached->close();
    echo "success";
}
开发者ID:YYLP,项目名称:y_game,代码行数:16,代码来源:load_csv_to_memcache.php

示例2: close

 /**
  * Close the backend
  *
  * @return boolean
  */
 public function close()
 {
     if (is_object($this->_backend)) {
         return $this->_backend->close();
     }
     return false;
 }
开发者ID:rosstuck,项目名称:SessionHandler,代码行数:12,代码来源:Memcache.php

示例3: __destruct

 public function __destruct()
 {
     if ($this->instance) {
         $this->instance->close();
         unset($this->instance);
     }
 }
开发者ID:ovr,项目名称:cacher,代码行数:7,代码来源:Memcache.php

示例4: close

 public function close()
 {
     $this->gc(ini_get('session.gc_maxlifetime'));
     $this->handle->close();
     $this->handle = null;
     return true;
 }
开发者ID:dongnan,项目名称:LinkTool,代码行数:7,代码来源:Memcache.class.php

示例5: finish

 /**
  * {@inheritDoc}
  * @see \Mcustiel\SimpleCache\Interfaces\CacheInterface::finish()
  */
 public function finish()
 {
     if ($this->connection !== null) {
         $this->connection->close();
         $this->connection = null;
     }
 }
开发者ID:mcustiel,项目名称:php-simple-cache,代码行数:11,代码来源:Cache.php

示例6: disconnect

 function disconnect()
 {
     if ($this->connected) {
         $this->connected = false;
         return $this->cache->close();
     }
     return true;
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:8,代码来源:Cache_memcached.php

示例7: disconnect

 /**
  * Disconnect the open connection
  *
  * @return static
  *
  * @throws ConnectionException
  */
 public function disconnect()
 {
     if ($this->_connection !== null) {
         $this->_connection->close();
     }
     $this->_connection = null;
     return $this;
 }
开发者ID:packaged,项目名称:dal,代码行数:15,代码来源:MemcacheConnection.php

示例8: __destruct

 public function __destruct()
 {
     if (isset($this->memcache)) {
         $this->memcache->close();
         $this->memcache = NULL;
     }
     parent::__destruct();
 }
开发者ID:ecs-hk,项目名称:Checkbook,代码行数:8,代码来源:MemcacheHandler.php

示例9: __destruct

 public function __destruct()
 {
     if ($this->alive) {
         try {
             $this->instance->close();
         } catch (BaseException $e) {
             // shhhh.
         }
     }
 }
开发者ID:justthefish,项目名称:hesper,代码行数:10,代码来源:PeclMemcache.php

示例10: __destruct

 /**
  * Destructor
  *
  * @return void
  */
 public function __destruct()
 {
     if ($this->_cache instanceof \Memcache) {
         $this->_cache->close();
     }
     if (is_resource($this->_socket)) {
         $cmd = 'quit' . self::EOL;
         fwrite($this->_socket, $cmd);
         fclose($this->_socket);
     }
 }
开发者ID:yakamoz-fang,项目名称:concrete,代码行数:16,代码来源:Memcacheq.php

示例11: _after

 public function _after(TestCase $test)
 {
     $this->memcache->flush();
     switch (get_class($this->memcache)) {
         case 'Memcache':
             $this->memcache->close();
             break;
         case 'Memcached':
             $this->memcache->quit();
             break;
     }
 }
开发者ID:Marfuz,项目名称:c4t_test,代码行数:12,代码来源:Memcache.php

示例12: close

 public static function close()
 {
     //already Closed Resource
     if (!self::$_Connection instanceof Memcache) {
         return;
     }
     self::$_Connection->close();
     foreach (self::$_MemCachePool as $key => $_host) {
         unset(self::$_MemCachePool[$key]);
     }
     self::$_Connection = null;
     self::$_INSTANCE = null;
 }
开发者ID:indynagpal,项目名称:MateCat,代码行数:13,代码来源:MemcacheHandler.php

示例13: _before

 public function _before(\Codeception\TestCase $test)
 {
     if (class_exists('\\Memcache')) {
         $this->memcache = new \Memcache();
         $this->memcache->close();
         $this->memcache->connect($this->config['host'], $this->config['port']);
     } elseif (class_exists('\\Memcached')) {
         $this->memcache = new \Memcached();
         $this->memcache->addServer($this->config['host'], $this->config['port']);
     } else {
         throw new \Codeception\Exception\ModuleConfig(__CLASS__, 'Memcache classes not loaded');
     }
 }
开发者ID:kansey,项目名称:yii2albom,代码行数:13,代码来源:Memcache.php

示例14: close

 /**
  * Close connection to memcache server
  *
  * @return bool
  */
 protected function close()
 {
     if (!$this->is_connected) {
         return false;
     }
     return $this->memcache->close();
 }
开发者ID:ecssjapan,项目名称:guiding-you-afteropen,代码行数:12,代码来源:CacheMemcache.php

示例15: getStatsFromCache

function getStatsFromCache($type = 'sizes', $slabib = null, $limit = 100)
{
    $ini = parse_ini_file('scielo.def', true);
    $memcache = new Memcache();
    $memcache->connect($ini['CACHE']['SERVER_CACHE'], $ini['CACHE']['SERVER_PORT_CACHE']);
    if ($slabib != null) {
        $arr = $memcache->getExtendedStats($type, $slabid, $limit);
    } else {
        $arr = $memcache->getExtendedStats($type);
    }
    $saida = '';
    $arr = array_pop($arr);
    $saida .= '<table border="1">';
    foreach ($arr as $key => $value) {
        $saida .= '<tr>';
        $saida .= '<td>' . $key . '</td>';
        if (is_array($value)) {
            $saida .= '<td><table border="1">';
            foreach ($value as $k => $v) {
                $saida .= '<tr>';
                $saida .= '<td>' . $k . '</td>';
                $saida .= '<td>' . $v . '</td>';
                $saida .= '</tr>';
            }
            $saida .= '</table></td>';
        } else {
            $saida .= '<td>' . $value . '</td>';
        }
        $saida .= '</tr>';
    }
    $saida .= '</table>';
    $memcache->close();
    return $saida;
}
开发者ID:robertatakenaka,项目名称:Proceedings,代码行数:34,代码来源:cache.php


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