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


PHP Archive::getEntry方法代碼示例

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


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

示例1: assertEntries

 /**
  * Asserts on entries in an archive
  *
  * @param   lang.archive.Archive a
  * @param   array<string, string> entries
  * @throws  unittest.AssertionFailedError
  */
 protected function assertEntries(Archive $a, array $entries)
 {
     $a->open(ARCHIVE_READ);
     $actual = array();
     while ($key = $a->getEntry()) {
         $actual[$key] = $a->extract($key);
     }
     $this->assertEquals($entries, $actual);
     $a->close();
 }
開發者ID:Gamepay,項目名稱:xp-framework,代碼行數:17,代碼來源:ArchiveTest.class.php

示例2: getPlan

 /**
  * Return the text of this user's plan.
  * @param ts Timestamp of the requested plan
  * @public
  * @returns Plan
  */
 function getPlan(&$user, $ts = null)
 {
     if (!isset($ts)) {
         if ($user->getUserID() != $this->userID) {
             $this->addView();
             Archive::addView($this->userID, $this->lastUpdate);
             /* check for mutual snitch registration */
             if ($user->getSnitch() && $this->snitch) {
                 $this->addSnitchView($user);
             }
         }
         if (!isset($this->plan)) {
             $query = "SELECT content FROM plans WHERE uid=" . $this->userID;
             /* execute the query */
             $result = $this->dbh->query($query);
             if (isset($result) && !DB::isError($result)) {
                 $row = $result->fetchRow();
                 $this->plan = $row['content'];
             } else {
                 return PLANWORLD_ERROR;
             }
         }
         return $this->plan;
     } else {
         /* fetch it from the archives */
         if (Archive::isPublic($this->userID, $ts) || $user->getUserID() == $this->userID) {
             if ($user->getUserID() != $this->userID) {
                 Archive::addView($this->userID, $ts);
             }
             return Archive::getEntry($this->userID, $ts);
         } else {
             return "<strong>Error:</strong> You are not authorized to view this entry.";
         }
     }
 }
開發者ID:jlodom,項目名稱:planworld,代碼行數:41,代碼來源:User.php

示例3: getPlan

 /**
  * Fetches this user's plan.
  * @public
  * @param user Requesting user (object)
  * @param date Date (for archived entries)
  * @returns string
  */
 function getPlan(&$user, $ts = null)
 {
     if (!isset($ts)) {
         if ($this->nodeinfo['Version'] < 2) {
             $val = $this->_call('plan.getText', array($this->localname, $user->getUsername() . '@' . PW_NAME, $user->getSnitch()));
         } else {
             $val = $this->_call('planworld.user.getPlan', array($this->localname, $user->getUsername() . '@' . PW_NAME, $user->getSnitch()));
         }
         return $val->scalar;
     } else {
         return Archive::getEntry($this->userID, $ts);
     }
     /*
     if (!is_array($val)) {
       print_r($val);
       return $val;
     } else {
       // some sort of error
     }
     */
 }
開發者ID:jlodom,項目名稱:planworld,代碼行數:28,代碼來源:RemoteUser.php


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