當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Pool::release方法代碼示例

本文整理匯總了PHP中Pool::release方法的典型用法代碼示例。如果您正苦於以下問題:PHP Pool::release方法的具體用法?PHP Pool::release怎麽用?PHP Pool::release使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Pool的用法示例。


在下文中一共展示了Pool::release方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: resolveAttributes

 /**
  * Resolve a files extended attributes
  *
  * @access public
  *
  * @param $retval file extended attributes
  */
 public static function resolveAttributes(&$retval)
 {
     Log::in("query - resolveAtributes");
     /* For printing via modxfs-getfattr for instance we need to
      * resolve things like user number to a name, template id to
      * a name, dates into strings etc.
      * We are only using select statements here, if a query fails
      * just leave the attribute alone and move on.
      */
     $dbConn = Pool::get();
     $prefix = Pool::getTableprefix();
     foreach ($retval as $key => &$value) {
         switch ($key) {
             case 'editedon':
             case 'createdon':
             case 'pub_date':
             case 'unpub_date':
             case 'deletedon':
             case 'publishedon':
                 $value = strftime("%G-%m-%j %H:%M:%S", $value);
                 break;
             case 'parent':
                 $sql = "SELECT pagetitle";
                 $sql .= " FROM `{$prefix}" . "site_content`";
                 $sql .= " WHERE id = {$value}";
                 $result = mysql_query($sql, $dbConn);
                 if ($result !== false) {
                     $row = mysql_fetch_assoc($result);
                     if ($row['pagetitle'] != "") {
                         $value = $row['pagetitle'];
                     }
                 }
                 break;
             case 'template':
                 $sql = "SELECT templatename";
                 $sql .= " FROM `{$prefix}" . "site_templates`";
                 $sql .= " WHERE id = {$value}";
                 $result = mysql_query($sql, $dbConn);
                 if ($result !== false) {
                     $row = mysql_fetch_assoc($result);
                     if ($row['templatename'] != "") {
                         $value = $row['templatename'];
                     }
                 }
                 break;
             case 'editedby':
             case 'deletedby':
             case 'publishedby':
             case 'createdby':
                 /* Only manager users here */
                 $sql = "SELECT username";
                 $sql .= " FROM `{$prefix}" . "manager_users`";
                 $sql .= " WHERE id = {$value}";
                 $result = mysql_query($sql, $dbConn);
                 if ($result !== false) {
                     $row = mysql_fetch_assoc($result);
                     if ($row['username'] != "") {
                         $value = $row['username'];
                     }
                 }
                 break;
             default:
                 break;
         }
     }
     Pool::release($dbConn);
     Log::out("query - resolveAtributes");
 }
開發者ID:shamblett,項目名稱:modxfs-php,代碼行數:75,代碼來源:query.class.php

示例2: release

 public static function release($client)
 {
     \Pool::release(static::TASK_QUEUE, $client);
     \Coroutine::next(static::TASK_QUEUE);
 }
開發者ID:jmuyuyang,項目名稱:co-psf,代碼行數:5,代碼來源:Base.php


注:本文中的Pool::release方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。