コード例 #1
0
ファイル: ApiMain.php プロジェクト: soumyag213/mediawiki
 /**
  * Set up for the execution.
  * @return array
  */
 protected function setupExecuteAction()
 {
     // First add the id to the top element
     $result = $this->getResult();
     $requestid = $this->getParameter('requestid');
     if (!is_null($requestid)) {
         $result->addValue(null, 'requestid', $requestid);
     }
     if ($this->getConfig()->get('ShowHostnames')) {
         $servedby = $this->getParameter('servedby');
         if ($servedby) {
             $result->addValue(null, 'servedby', wfHostName());
         }
     }
     if ($this->getParameter('curtimestamp')) {
         $result->addValue(null, 'curtimestamp', wfTimestamp(TS_ISO_8601, time()), ApiResult::NO_SIZE_CHECK);
     }
     $params = $this->extractRequestParams();
     $this->mAction = $params['action'];
     if (!is_string($this->mAction)) {
         $this->dieUsage('The API requires a valid action parameter', 'unknown_action');
     }
     return $params;
 }
コード例 #2
0
ファイル: ApiMain.php プロジェクト: eFFemeer/seizamcore
 /**
  * Set up for the execution.
  * @return array
  */
 protected function setupExecuteAction()
 {
     // First add the id to the top element
     $result = $this->getResult();
     $requestid = $this->getParameter('requestid');
     if (!is_null($requestid)) {
         $result->addValue(null, 'requestid', $requestid);
     }
     $servedby = $this->getParameter('servedby');
     if ($servedby) {
         $result->addValue(null, 'servedby', wfHostName());
     }
     $params = $this->extractRequestParams();
     $this->mShowVersions = $params['version'];
     $this->mAction = $params['action'];
     if (!is_string($this->mAction)) {
         $this->dieUsage('The API requires a valid action parameter', 'unknown_action');
     }
     return $params;
 }