function error( $code, $msgName /*, ... */ ) {
		$params = array_slice( func_get_args(), 1 );
		$info = self::$httpErrors[$code];
		header( "HTTP/1.1 $code $info" );
		header( 'Content-Type: text/xml' );
		$this->errors[] = wfCreateObject( 'WebStoreError', $params );
		$errors = $this->getErrorsXML();
		echo <<<EOT
<?xml version="1.0" encoding="utf-8"?>
<response>
<status>failure</status>
$errors
</response>

EOT;
	}
Example #2
0
 /**
  * Create a new object to replace this stub object.
  */
 function _newObject()
 {
     return wfCreateObject($this->mClass, $this->mParams);
 }
Example #3
0
 /**
  * Find the object with a given name and return it (or NULL)
  * @static
  * @param string $name
  */
 static function getPage($name)
 {
     if (!self::$mListInitialised) {
         self::initList();
     }
     if (array_key_exists($name, self::$mList)) {
         $rec = self::$mList[$name];
         if (is_string($rec)) {
             $className = $rec;
             self::$mList[$name] = new $className();
         } elseif (is_array($rec)) {
             $className = array_shift($rec);
             self::$mList[$name] = wfCreateObject($className, $rec);
         }
         return self::$mList[$name];
     } else {
         return NULL;
     }
 }