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


PHP object::close方法代码示例

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


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

示例1: close

 /**
  * {@inheritdoc}
  */
 public function close()
 {
     if ($this->dbHandle) {
         $this->dbHandle->close();
         $this->dbHandle = null;
     }
 }
开发者ID:sugiphp,项目名称:database,代码行数:10,代码来源:SQLiteDriver.php

示例2: __destruct

 /**
  * 析构函数
  */
 public function __destruct()
 {
     if ($this->isConnected) {
         $this->mem->close();
     }
     $this->mem = NULL;
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:10,代码来源:mem.php

示例3: clear

 /**
  * Delete all values from the cache
  *
  * @param boolean $check Optional - only delete expired cache items
  * @return boolean True if the cache was succesfully cleared, false otherwise
  * @access public
  */
 function clear($check)
 {
     if (!$this->__init) {
         return false;
     }
     $dir = dir($this->settings['path']);
     if ($check) {
         $now = time();
         $threshold = $now - $this->settings['duration'];
     }
     while (($entry = $dir->read()) !== false) {
         if ($this->__setKey($entry) === false) {
             continue;
         }
         if ($check) {
             $mtime = $this->__File->lastChange();
             if ($mtime === false || $mtime > $threshold) {
                 continue;
             }
             $expires = $this->__File->read(11);
             $this->__File->close();
             if ($expires > $now) {
                 continue;
             }
         }
         $this->__File->delete();
     }
     $dir->close();
     return true;
 }
开发者ID:javierm,项目名称:wildflower,代码行数:37,代码来源:file.php

示例4: close

 /**
  * Close the zip archive
  *
  * @return  bool
  * @throws  \Comodojo\Exception\ZipException
  */
 public function close()
 {
     if ($this->zip_archive->close() === false) {
         throw new ZipException(self::getStatus($this->zip_archive->status));
     }
     return true;
 }
开发者ID:falconchen,项目名称:JianshuDaily,代码行数:13,代码来源:Zip.php

示例5: closeMysql

 /**
  * Close connection if it exists
  *
  * @author KnowledgeTree Team
  * @access private
  * @params mysql connection object $con
  * @return void
  */
 private function closeMysql($con)
 {
     try {
         $this->_dbhandler->close();
     } catch (Exeption $e) {
         $this->error['con'] = "Could not close: " . $e;
     }
 }
开发者ID:jpbauer,项目名称:knowledgetree,代码行数:16,代码来源:database.php

示例6: __destruct

 /**
  * Class destructor
  *
  * Closes the connection to Memcache(d) if present.
  *
  * @return	void
  */
 public function __destruct()
 {
     if ($this->_memcached instanceof Memcache) {
         $this->_memcached->close();
     } elseif ($this->_memcached instanceof Memcached && method_exists($this->_memcached, 'quit')) {
         $this->_memcached->quit();
     }
 }
开发者ID:mnapier,项目名称:opensourcepos,代码行数:15,代码来源:Cache_memcached.php

示例7: __destruct

 /**
  * Class destructor
  *
  * Closes the connection to Memcache(d) if present.
  *
  * @return    void
  */
 public function __destruct()
 {
     if ($this->_memcached instanceof Memcache) {
         $this->_memcached->close();
     } elseif ($this->_memcached instanceof Memcached) {
         $this->_memcached->quit();
     }
 }
开发者ID:tastyigniter,项目名称:tastyigniter,代码行数:15,代码来源:Cache_memcached.php

示例8: closeConnection

 /**
  * Closes a previously opened database connection
  */
 public function closeConnection()
 {
     if ($this->debug) {
         $this->debug->log(__METHOD__);
     }
     $this->isConnected() && $this->DB->close();
     $this->DB = null;
 }
开发者ID:nbari,项目名称:DALMP,代码行数:11,代码来源:Database.php

示例9: close

 /**
  * 关闭数据库连接
  *
  * @return void
  */
 public function close()
 {
     $this->_driver->close($this->_writeConnection);
     $this->_writeConnection = null;
     if (!empty($this->_readConnection)) {
         $this->_driver->close($this->_readConnection);
         $this->_readConnection = null;
     }
 }
开发者ID:xiaoyueer98,项目名称:store.heimi.com,代码行数:14,代码来源:Db.php

示例10: disconnect

	/**
	 * Disconnect from the Mongo server.
	 *
	 * @return boolean True on successful disconnect, false otherwise.
	 */
	public function disconnect() {
		if ($this->server && $this->server->connected) {
			try {
				$this->_isConnected = !$this->server->close();
			} catch (Exception $e) {}
			unset($this->connection, $this->server);
			return !$this->_isConnected;
		}
		return true;
	}
开发者ID:niel,项目名称:lithium,代码行数:15,代码来源:MongoDb.php

示例11: __deconstruct

 /**
  * Deconstructor
  *
  * Close connections to the database
  * @since Version 3.7
  */
 protected function __deconstruct()
 {
     if ($this->destroy) {
         if ($this->db instanceof \sql_db) {
             $this->db->close();
         } else {
             #$this->closeConnection();
         }
     }
 }
开发者ID:railpage,项目名称:railpagecore,代码行数:16,代码来源:AppCore.php

示例12: __destruct

 /**
  * 析构函数
  *
  * 程序执行完毕,打扫战场
  *
  * @access public
  *
  * @return void
  */
 public function __destruct()
 {
     if ($this->_dbLink) {
         $this->_dbLink = null;
     }
     if ($this->_mongo) {
         $this->_mongo->close();
     }
     return true;
 }
开发者ID:a53abc,项目名称:doitphp,代码行数:19,代码来源:DbMongo.class.php

示例13: serialize

 /**
  * 析构函数
  * 执行session存储器实例,将模拟的session内容写入保存
  */
 function __destruct()
 {
     if (!is_object($this->_storageHandler)) {
         return '';
     }
     if (!empty($this->_sess_data) && !empty($this->_session_id)) {
         $sess_data = serialize($this->_sess_data);
         $this->_storageHandler->write($this->_session_id, $sess_data);
     }
     $this->_storageHandler->close();
 }
开发者ID:chibimiku,项目名称:xweibo_for_discuz_x2_php7,代码行数:15,代码来源:session_operator_simulator.class.php

示例14: compress

 /**
  * Compress data into the archive
  *
  * @param string $sFile Name of the ZIP file
  * @param string $sFolder Name of the folder we are going to compress. Must be located within the "file/cache/" folder.
  * @return mixed Returns the full path to the newly created ZIP file.
  */
 public function compress($sFile, $sFolder)
 {
     // Create random ZIP
     $sArchive = PHPFOX_DIR_CACHE . md5((is_array($sFile) ? serialize($sFile) : $sFile) . Phpfox::getParam('core.salt') . PHPFOX_TIME) . '.zip';
     chdir(PHPFOX_DIR_CACHE . $sFolder . PHPFOX_DS);
     if (is_object($this->_oZip)) {
         if ($this->_oZip->open($sArchive, ZipArchive::CREATE)) {
             $aFiles = Phpfox::getLib('file')->getAllFiles(PHPFOX_DIR_CACHE . $sFolder . PHPFOX_DS);
             foreach ($aFiles as $sNewFile) {
                 $sNewFile = str_replace(PHPFOX_DIR_CACHE . $sFolder . PHPFOX_DS, '', $sNewFile);
                 $this->_oZip->addFile($sNewFile);
             }
             $this->_oZip->close();
         }
     } else {
         shell_exec(Phpfox::getParam('core.zip_path') . ' -r ' . escapeshellarg($sArchive) . ' ./');
     }
     chdir(PHPFOX_DIR);
     return $sArchive;
 }
开发者ID:Lovinity,项目名称:EQM,代码行数:27,代码来源:zip.class.php

示例15: onMessage

 /**
  * onMessage($clientId, $message) get messages from server (request / response)
  * @param int $clientId connect identifier
  * @param varchar $message costom message throught socket
  * @access public
  */
 public function onMessage($clientId, $message)
 {
     // get client ip
     $ip = long2ip($this->_server->clients[$clientId][6]);
     // check if message length is 0
     if (strlen($message) == 0) {
         // send nothing
         $this->_server->close($clientId);
         return;
     }
     // the speaker is the only person in the room. Don't let them feel lonely.
     if (sizeof($this->_server->clients) == 1) {
         $this->_server->send($clientId, "There isn't anyone else in the room, but I'll still listen to you. Some one in the dark :))");
     } else {
         // send the message to everyone but the person who said it
         foreach ($this->_server->clients as $id => $client) {
             if ($id != $clientId) {
                 $this->_server->send($id, "User {$clientId} ({$ip}) said \"{$message}\"");
             }
         }
     }
 }
开发者ID:stanislav-web,项目名称:zf2-websocket-server-factory,代码行数:28,代码来源:Chat.php


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