*/
const GET_VALUES_FOR_HELP = 1;
- private $mMainModule, $mModuleName, $mModulePrefix;
+ /** @var ApiMain */
+ private $mMainModule;
+ /** @var string */
+ private $mModuleName, $mModulePrefix;
private $mSlaveDB = null;
private $mParamCache = array();
/**
- * Constructor
* @param ApiMain $mainModule
* @param string $moduleName Name of this module
* @param string $modulePrefix Prefix to use for parameter names
*/
- public function __construct( $mainModule, $moduleName, $modulePrefix = '' ) {
+ public function __construct( ApiMain $mainModule, $moduleName, $modulePrefix = '' ) {
$this->mMainModule = $mainModule;
$this->mModuleName = $moduleName;
$this->mModulePrefix = $modulePrefix;
return $this->getResult()->getData();
}
- /**
- * Create a new RequestContext object to use e.g. for calls to other parts
- * the software.
- * The object will have the WebRequest and the User object set to the ones
- * used in this instance.
- *
- * @deprecated since 1.19 use getContext to get the current context
- * @return DerivativeContext
- */
- public function createContext() {
- wfDeprecated( __METHOD__, '1.19' );
-
- return new DerivativeContext( $this->getContext() );
- }
-
/**
* Set warning section for this module. Users should monitor this
* section to notice any changes in API. Multiple calls to this
* @since 1.21
*/
public function dieUsageMsgOrDebug( $error ) {
- global $wgDebugAPI;
- if ( $wgDebugAPI !== true ) {
+ if ( $this->getConfig()->get( 'DebugAPI' ) !== true ) {
$this->dieUsageMsg( $error );
}
if ( is_string( $error ) ) {
$error = array( $error );
}
-
$parsed = $this->parseMsg( $error );
$this->setWarning( '$wgDebugAPI: ' . $parsed['code'] . ' - ' . $parsed['info'] );
}