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


PHP resource::free方法代码示例

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


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

示例1: log

 /**
  * Inserts $message to the currently open database.  Calls open(),
  * if necessary.  Also passes the message along to any Log_observer
  * instances that are observing this Log.
  *
  * @param mixed  $message  String or object containing the message to log.
  * @param string $priority The priority of the message.  Valid
  *                  values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
  *                  PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
  *                  PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
  * @return boolean  True on success or false on failure.
  * @access public
  */
 function log($message, $priority = null)
 {
     /* If a priority hasn't been specified, use the default value. */
     if ($priority === null) {
         $priority = $this->_priority;
     }
     /* Abort early if the priority is above the maximum logging level. */
     if (!$this->_isMasked($priority)) {
         return false;
     }
     /* If the connection isn't open and can't be opened, return failure. */
     if (!$this->_opened && !$this->open()) {
         return false;
     }
     /* If we don't already have a statement object, create one. */
     if (!is_object($this->_statement) && !$this->_prepareStatement()) {
         return false;
     }
     /* Extract the string representation of the message. */
     $message = $this->_extractMessage($message);
     /* Build our set of values for this log entry. */
     $values = array('id' => $this->_db->nextId($this->_sequence), 'logtime' => MDB2_Date::mdbNow(), 'ident' => $this->_ident, 'priority' => $priority, 'message' => $message);
     /* Execute the SQL query for this log entry insertion. */
     $this->_db->expectError(MDB2_ERROR_NOSUCHTABLE);
     $result =& $this->_statement->execute($values);
     $this->_db->popExpect();
     /* Attempt to handle any errors. */
     if (PEAR::isError($result)) {
         /* We can only handle MDB2_ERROR_NOSUCHTABLE errors. */
         if ($result->getCode() != MDB2_ERROR_NOSUCHTABLE) {
             return false;
         }
         /* Attempt to create the target table. */
         if (!$this->_createTable()) {
             return false;
         }
         /* Recreate our prepared statement resource. */
         $this->_statement->free();
         if (!$this->_prepareStatement()) {
             return false;
         }
         /* Attempt to re-execute the insertion query. */
         $result = $this->_statement->execute($values);
         if (PEAR::isError($result)) {
             return false;
         }
     }
     $this->_announce(array('priority' => $priority, 'message' => $message));
     return true;
 }
开发者ID:sergiobelli,项目名称:jecon,代码行数:63,代码来源:mdb2.php

示例2: free

 /**
  * Free the memory used by the result resource
  *
  * @return void
  */
 public function free()
 {
     switch ($this->mode) {
         case "mysql":
             $this->result->free();
             break;
         case "postgres":
         case "redshift":
             pg_free_result($this->result);
             break;
         case "odbc":
             odbc_free_result($this->result);
             break;
         case "sqlite":
             $this->result->finalize();
             break;
         case "mssql":
             mssql_free_result($this->result);
             break;
     }
 }
开发者ID:ian-Tr,项目名称:le-huard,代码行数:26,代码来源:Result.php

示例3: free

 /**
  * Limpiamos la consulta
  * @author Ignacio Daniel Rostagno <ignaciorostagno@vijona.com.ar>
  * @return boolean
  */
 private function free()
 {
     return is_resource($this->data) ? $this->data->free() : true;
 }
开发者ID:areslepra,项目名称:Framework,代码行数:9,代码来源:class.littledb.php

示例4: __destruct

 public function __destruct()
 {
     if (is_object($this->handle)) {
         $this->handle->free();
     }
 }
开发者ID:normann,项目名称:sapphire,代码行数:6,代码来源:MySQLDatabase.php

示例5: free

 /**
  * 释放结果集所占资源
  * @return void 
  */
 protected function free()
 {
     @$this->rs->free();
 }
开发者ID:stonepeng,项目名称:b2c,代码行数:8,代码来源:class.db.php


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