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


PHP ApiFormatBase類代碼示例

本文整理匯總了PHP中ApiFormatBase的典型用法代碼示例。如果您正苦於以下問題:PHP ApiFormatBase類的具體用法?PHP ApiFormatBase怎麽用?PHP ApiFormatBase使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: getVersion

 /**
  * Returns the version information of this file, plus it includes
  * the versions for all files that are not callable proper API modules
  */
 public function getVersion()
 {
     $vers = array();
     $vers[] = 'MediaWiki: ' . SpecialVersion::getVersion() . "\n    http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/";
     $vers[] = __CLASS__ . ': $Id: ApiMain.php 70066 2010-07-28 05:52:32Z tstarling $';
     $vers[] = ApiBase::getBaseVersion();
     $vers[] = ApiFormatBase::getBaseVersion();
     $vers[] = ApiQueryBase::getBaseVersion();
     return $vers;
 }
開發者ID:rocLv,項目名稱:conference,代碼行數:14,代碼來源:ApiMain.php

示例2: getVersion

 /**
  * Returns the version information of this file, plus it includes
  * the versions for all files that are not callable proper API modules
  */
 public function getVersion()
 {
     $vers = array();
     $vers[] = 'MediaWiki: ' . SpecialVersion::getVersion() . "\n    http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/";
     $vers[] = __CLASS__ . ': $Id: ApiMain.php 69990 2010-07-27 08:44:08Z tstarling $';
     $vers[] = ApiBase::getBaseVersion();
     $vers[] = ApiFormatBase::getBaseVersion();
     $vers[] = ApiQueryBase::getBaseVersion();
     $vers[] = ApiFormatFeedWrapper::getVersion();
     // not accessible with format=xxx
     return $vers;
 }
開發者ID:ruizrube,項目名稱:spdef,代碼行數:16,代碼來源:ApiMain.php

示例3: __construct

 /**
  * Constructor
  * @param $main ApiMain object
  * @param $errorFallback ApiFormatBase object to fall back on for errors
  */
 public function __construct($main, $errorFallback)
 {
     parent::__construct($main, 'raw');
     $this->mErrorFallback = $errorFallback;
 }
開發者ID:tuxmania87,項目名稱:GalaxyAdventures,代碼行數:10,代碼來源:ApiFormatRaw.php

示例4: getDescription

 public function getDescription()
 {
     if ($this->mIsRaw) {
         return 'Output data with the debugging elements in JSON format' . parent::getDescription();
     }
     return 'Output data in JSON format' . parent::getDescription();
 }
開發者ID:crippsy14,項目名稱:orange-smorange,代碼行數:7,代碼來源:ApiFormatJson.php

示例5: __construct

	public function __construct( $main, $format ) {
		parent :: __construct( $main, $format );
		$this->dmRecords = array();
		$this->languages = array();
		$this->excluded = array();
		$this->errorMessages = array();
	}
開發者ID:realsoc,項目名稱:mediawiki-extensions,代碼行數:7,代碼來源:ApiWikiDataFormatBase.php

示例6: getDescription

 protected function getDescription()
 {
     if ($this->mIsRaw) {
         return 'Output data with the debuging elements in JSON format' . parent::getDescription();
     } else {
         return 'Output data in JSON format' . parent::getDescription();
     }
 }
開發者ID:negabaro,項目名稱:alfresco,代碼行數:8,代碼來源:ApiFormatJson.php

示例7: closePrinter

 public function closePrinter()
 {
     $data = $this->getResult()->getResultData();
     if (isset($data['error'])) {
         $this->errorFallback->closePrinter();
     } else {
         parent::closePrinter();
     }
 }
開發者ID:claudinec,項目名稱:galan-wiki,代碼行數:9,代碼來源:ApiFormatRaw.php

示例8: closePrinter

 public function closePrinter()
 {
     if ($this->isDisabled()) {
         return;
     }
     if ($this->file) {
         ob_clean();
         readfile($this->file);
     } else {
         return parent::closePrinter();
     }
 }
開發者ID:saper,項目名稱:organic-extensions,代碼行數:12,代碼來源:ApiFormatFile.php

示例9: __construct

 public function __construct(ApiMain $main, $format)
 {
     parent::__construct($main, $format);
     $this->isRaw = $format === 'rawfm';
     if ($this->getMain()->getCheck('callback')) {
         # T94015: jQuery appends a useless '_' parameter in jsonp mode.
         # Mark the parameter as used in that case to avoid a warning that's
         # outside the control of the end user.
         # (and do it here because ApiMain::reportUnusedParams() gets called
         # before our ::execute())
         $this->getMain()->getCheck('_');
     }
 }
開發者ID:ucfengzhun,項目名稱:mediawiki,代碼行數:13,代碼來源:ApiFormatJson.php

示例10: initPrinter

 /**
  * This class expects the result data to be in a custom format set by self::setResult()
  * $result['_feed'] - an instance of one of the $wgFeedClasses classes
  * $result['_feeditems'] - an array of FeedItem instances
  */
 public function initPrinter($unused = false)
 {
     parent::initPrinter($unused);
     if ($this->isDisabled()) {
         return;
     }
     $data = $this->getResult()->getResultData();
     if (isset($data['_feed']) && isset($data['_feeditems'])) {
         $data['_feed']->httpHeaders();
     } else {
         // Error has occurred, print something useful
         ApiBase::dieDebug(__METHOD__, 'Invalid feed class/item');
     }
 }
開發者ID:jpena88,項目名稱:mediawiki-dokku-deploy,代碼行數:19,代碼來源:ApiFormatFeedWrapper.php

示例11: reportUnusedParams

 /**
  * Report unused parameters, so the client gets a hint in case it gave us parameters we don't know,
  * for example in case of spelling mistakes or a missing 'g' prefix for generators.
  */
 protected function reportUnusedParams()
 {
     $paramsUsed = $this->getParamsUsed();
     $allParams = $this->getRequest()->getValueNames();
     if (!$this->mInternalMode) {
         // Printer has not yet executed; don't warn that its parameters are unused
         $printerParams = array_map([$this->mPrinter, 'encodeParamName'], array_keys($this->mPrinter->getFinalParams() ?: []));
         $unusedParams = array_diff($allParams, $paramsUsed, $printerParams);
     } else {
         $unusedParams = array_diff($allParams, $paramsUsed);
     }
     if (count($unusedParams)) {
         $s = count($unusedParams) > 1 ? 's' : '';
         $this->setWarning("Unrecognized parameter{$s}: '" . implode($unusedParams, "', '") . "'");
     }
 }
開發者ID:paladox,項目名稱:mediawiki,代碼行數:20,代碼來源:ApiMain.php

示例12: getDescription

 public function getDescription()
 {
     return 'Output data in serialized PHP format' . parent::getDescription();
 }
開發者ID:BackupTheBerlios,項目名稱:shoutwiki-svn,代碼行數:4,代碼來源:ApiFormatPhp.php

示例13: __construct

 public function __construct($main)
 {
     parent::__construct($main, 'feed');
 }
開發者ID:biribogos,項目名稱:wikihow-src,代碼行數:4,代碼來源:ApiFormatBase.php

示例14: __construct

 public function __construct(ApiMain $main, $format)
 {
     parent::__construct($main, $format);
     $this->isRaw = $format === 'rawfm';
 }
開發者ID:eliagbayani,項目名稱:LiteratureEditor,代碼行數:5,代碼來源:ApiFormatJson.php

示例15: setHelp

 /**
  * Sets whether the pretty-printer should format *bold* and $italics$
  *
  * @deprecated since 1.25
  * @param bool $help
  */
 public function setHelp($help = true)
 {
     wfDeprecated(__METHOD__, '1.25');
     $this->mPrinter->setHelp($help);
 }
開發者ID:soumyag213,項目名稱:mediawiki,代碼行數:11,代碼來源:ApiMain.php


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