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


PHP ResultWrapper::free方法代码示例

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


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

示例1: showList

 /**
  * Generic list of deleted pages
  *
  * @param ResultWrapper $result
  * @return bool
  */
 private function showList($result)
 {
     $out = $this->getOutput();
     if ($result->numRows() == 0) {
         $out->addWikiMsg('undelete-no-results');
         return false;
     }
     $out->addWikiMsg('undeletepagetext', $this->getLanguage()->formatNum($result->numRows()));
     $undelete = $this->getPageTitle();
     $out->addHTML("<ul>\n");
     foreach ($result as $row) {
         $title = Title::makeTitleSafe($row->ar_namespace, $row->ar_title);
         if ($title !== null) {
             $item = Linker::linkKnown($undelete, htmlspecialchars($title->getPrefixedText()), array(), array('target' => $title->getPrefixedText()));
         } else {
             // The title is no longer valid, show as text
             $item = Html::element('span', array('class' => 'mw-invalidtitle'), Linker::getInvalidTitleDescription($this->getContext(), $row->ar_namespace, $row->ar_title));
         }
         $revs = $this->msg('undeleterevisions')->numParams($row->count)->parse();
         $out->addHTML("<li>{$item} ({$revs})</li>\n");
     }
     $result->free();
     $out->addHTML("</ul>\n");
     return true;
 }
开发者ID:raymondzhangl,项目名称:mediawiki,代码行数:31,代码来源:SpecialUndelete.php

示例2: loadFromResult

 /**
  * Fill in member variables from a result wrapper
  */
 function loadFromResult(ResultWrapper $res, $killExpired = true)
 {
     $ret = false;
     if (0 != $res->numRows()) {
         # Get first block
         $row = $res->fetchObject();
         $this->initFromRow($row);
         if ($killExpired) {
             # If requested, delete expired rows
             do {
                 $killed = $this->deleteIfExpired();
                 if ($killed) {
                     $row = $res->fetchObject();
                     if ($row) {
                         $this->initFromRow($row);
                     }
                 }
             } while ($killed && $row);
             # If there were any left after the killing finished, return true
             if ($row) {
                 $ret = true;
             }
         } else {
             $ret = true;
         }
     }
     $res->free();
     return $ret;
 }
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:32,代码来源:Block.php

示例3: outputStream

 /**
  * Runs through a query result set dumping page and revision records.
  * The result set should be sorted/grouped by page to avoid duplicate
  * page records in the output.
  *
  * The result set will be freed once complete. Should be safe for
  * streaming (non-buffered) queries, as long as it was made on a
  * separate database connection not managed by LoadBalancer; some
  * blob storage types will make queries to pull source data.
  *
  * @param ResultWrapper $resultset
  * @access private
  */
 function outputStream($resultset)
 {
     $last = null;
     while ($row = $resultset->fetchObject()) {
         if (is_null($last) || $last->page_namespace != $row->page_namespace || $last->page_title != $row->page_title) {
             if (isset($last)) {
                 $this->closePage($last);
             }
             $this->openPage($row);
             $last = $row;
         }
         $this->dumpRev($row);
     }
     if (isset($last)) {
         $this->closePage($last);
     }
     $resultset->free();
 }
开发者ID:BackupTheBerlios,项目名称:openzaurus-svn,代码行数:31,代码来源:SpecialExport.php

示例4: outputStream

 /**
  * Runs through a query result set dumping page and revision records.
  * The result set should be sorted/grouped by page to avoid duplicate
  * page records in the output.
  *
  * The result set will be freed once complete. Should be safe for
  * streaming (non-buffered) queries, as long as it was made on a
  * separate database connection not managed by LoadBalancer; some
  * blob storage types will make queries to pull source data.
  *
  * @param ResultWrapper $resultset
  * @access private
  */
 function outputStream($resultset)
 {
     $last = null;
     while ($row = $resultset->fetchObject()) {
         if (is_null($last) || $last->page_namespace != $row->page_namespace || $last->page_title != $row->page_title) {
             if (isset($last)) {
                 $output = $this->writer->closePage();
                 $this->sink->writeClosePage($output);
             }
             $output = $this->writer->openPage($row);
             $this->sink->writeOpenPage($row, $output);
             $last = $row;
         }
         $output = $this->writer->writeRevision($row, $this->parse);
         $this->sink->writeRevision($row, $output);
     }
     if (isset($last)) {
         $output = $this->author_list . $this->writer->closePage();
         $this->sink->writeClosePage($output);
     }
     $resultset->free();
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:35,代码来源:Export.php


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