コード例 #1
0
 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();
 }
コード例 #2
0
	public function __construct( $main, $format ) {
		parent :: __construct( $main, $format );
		$this->dmRecords = array();
		$this->languages = array();
		$this->excluded = array();
		$this->errorMessages = array();
	}
コード例 #3
0
ファイル: ApiFormatJson.php プロジェクト: negabaro/alfresco
 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();
     }
 }
コード例 #4
0
ファイル: ApiFormatRaw.php プロジェクト: claudinec/galan-wiki
 public function closePrinter()
 {
     $data = $this->getResult()->getResultData();
     if (isset($data['error'])) {
         $this->errorFallback->closePrinter();
     } else {
         parent::closePrinter();
     }
 }
コード例 #5
0
 public function closePrinter()
 {
     if ($this->isDisabled()) {
         return;
     }
     if ($this->file) {
         ob_clean();
         readfile($this->file);
     } else {
         return parent::closePrinter();
     }
 }
コード例 #6
0
 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('_');
     }
 }
コード例 #7
0
 /**
  * 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');
     }
 }
コード例 #8
0
ファイル: ApiMain.php プロジェクト: paladox/mediawiki
 /**
  * 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, "', '") . "'");
     }
 }
コード例 #9
0
 public function getDescription()
 {
     return 'Output data in serialized PHP format' . parent::getDescription();
 }
コード例 #10
0
ファイル: ApiMain.php プロジェクト: rocLv/conference
 /**
  * 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;
 }
コード例 #11
0
 public function __construct($main)
 {
     parent::__construct($main, 'feed');
 }
コード例 #12
0
ファイル: ApiMain.php プロジェクト: ruizrube/spdef
 /**
  * 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;
 }
コード例 #13
0
 public function __construct(ApiMain $main, $format)
 {
     parent::__construct($main, $format);
     $this->isRaw = $format === 'rawfm';
 }
コード例 #14
0
ファイル: ApiMain.php プロジェクト: soumyag213/mediawiki
 /**
  * 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);
 }
コード例 #15
0
ファイル: ApiFormatWddx.php プロジェクト: Tjorriemorrie/app
 public function getDescription()
 {
     return 'Output data in WDDX format' . parent::getDescription();
 }
コード例 #16
0
ファイル: ApiFormatJson.php プロジェクト: OrBin/mediawiki
 public function getAllowedParams()
 {
     if ($this->isRaw) {
         return parent::getAllowedParams();
     }
     $ret = parent::getAllowedParams() + array('callback' => array(ApiBase::PARAM_HELP_MSG => 'apihelp-json-param-callback'), 'utf8' => array(ApiBase::PARAM_DFLT => false, ApiBase::PARAM_HELP_MSG => 'apihelp-json-param-utf8'), 'ascii' => array(ApiBase::PARAM_DFLT => false, ApiBase::PARAM_HELP_MSG => 'apihelp-json-param-ascii'), 'formatversion' => array(ApiBase::PARAM_TYPE => array(1, 2, 'latest'), ApiBase::PARAM_DFLT => 1, ApiBase::PARAM_HELP_MSG => 'apihelp-json-param-formatversion'));
     return $ret;
 }
コード例 #17
0
ファイル: ApiMain.php プロジェクト: ui-libraries/TIRW
 /**
  * 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 50834 2009-05-20 20:10:47Z catrope $';
     $vers[] = ApiBase::getBaseVersion();
     $vers[] = ApiFormatBase::getBaseVersion();
     $vers[] = ApiQueryBase::getBaseVersion();
     $vers[] = ApiFormatFeedWrapper::getVersion();
     // not accessible with format=xxx
     return $vers;
 }
コード例 #18
0
 protected function getDescription()
 {
     return 'Output data in XML format' . parent::getDescription();
 }
コード例 #19
0
 /**
  * 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;
 }
コード例 #20
0
ファイル: ApiFormatPhp.php プロジェクト: OrBin/mediawiki
 public function getAllowedParams()
 {
     $ret = parent::getAllowedParams() + array('formatversion' => array(ApiBase::PARAM_TYPE => array(1, 2, 'latest'), ApiBase::PARAM_DFLT => 1, ApiBase::PARAM_HELP_MSG => 'apihelp-php-param-formatversion'));
     return $ret;
 }
コード例 #21
0
ファイル: ApiFormatXml.php プロジェクト: claudinec/galan-wiki
 public function getAllowedParams()
 {
     return parent::getAllowedParams() + ['xslt' => [ApiBase::PARAM_HELP_MSG => 'apihelp-xml-param-xslt'], 'includexmlnamespace' => [ApiBase::PARAM_DFLT => false, ApiBase::PARAM_HELP_MSG => 'apihelp-xml-param-includexmlnamespace']];
 }
コード例 #22
0
 public function getDescription()
 {
     return 'Output nothing' . parent::getDescription();
 }
コード例 #23
0
 public function getDescription()
 {
     return 'Output data in PHP\'s var_export() format' . parent::getDescription();
 }
コード例 #24
0
ファイル: ApiFormatYaml.php プロジェクト: puring0815/OpenKore
 public function __construct($main, $format)
 {
     parent::__construct($main, $format);
 }
コード例 #25
0
ファイル: ApiMain.php プロジェクト: eFFemeer/seizamcore
 /**
  * Returns the version information of this file, plus it includes
  * the versions for all files that are not callable proper API modules
  *
  * @return array
  */
 public function getVersion()
 {
     $vers = array();
     $vers[] = 'MediaWiki: ' . SpecialVersion::getVersion() . "\n    https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/";
     $vers[] = __CLASS__ . ': $Id$';
     $vers[] = ApiBase::getBaseVersion();
     $vers[] = ApiFormatBase::getBaseVersion();
     $vers[] = ApiQueryBase::getBaseVersion();
     return $vers;
 }
コード例 #26
0
ファイル: ApiFormatDump.php プロジェクト: whysasse/kmwiki
 public function getDescription()
 {
     return 'DEPRECATED! Output data in PHP\'s var_dump() format' . parent::getDescription();
 }
コード例 #27
0
ファイル: ApiFormatTxt.php プロジェクト: ErdemA/wikihow
 public function getDescription()
 {
     return 'Output data in PHP\'s print_r() format' . parent::getDescription();
 }
コード例 #28
0
ファイル: ApiMain.php プロジェクト: mangowi/mediawiki
 /**
  * Sets whether the pretty-printer should format *bold* and $italics$
  *
  * @param $help bool
  */
 public function setHelp($help = true)
 {
     $this->mPrinter->setHelp($help);
 }
コード例 #29
0
 /**
  * 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();
     $vers[] = __CLASS__ . ': $Id: ApiMain.php 24494 2007-07-31 17:53:37Z yurik $';
     $vers[] = ApiBase::getBaseVersion();
     $vers[] = ApiFormatBase::getBaseVersion();
     $vers[] = ApiQueryBase::getBaseVersion();
     $vers[] = ApiFormatFeedWrapper::getVersion();
     // not accessible with format=xxx
     return $vers;
 }
コード例 #30
0
ファイル: ApiFormatYaml.php プロジェクト: whysasse/kmwiki
 public function getDescription()
 {
     return 'DEPRECATED! Output data in YAML format' . ApiFormatBase::getDescription();
 }