summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b769c3b)
This allows action=paraminfo to indicate when a parameter is specifying
a submodule (so clients can detect what the submodule names are). This
will also allow the future action=help HTMLization to easily auto-link
to submodule docs, and will allow ApiSandbox to handle submodules more
generically.
For BC, rather than directly specifying "type": "submodule", it lists
the names of all the submodules as the type and adds an additional
"submodules" indicator on the param info object.
Change-Id: Id31babdc81d970ac781ec11daa3cdafef18ecd5d
properly maintain. Also removed the corresponding methods from ApiBase and
the 'APIGetPossibleErrors' and 'APIGetResultProperties' hooks.
* Formats dbg, dump, txt, wddx, and yaml are now deprecated.
properly maintain. Also removed the corresponding methods from ApiBase and
the 'APIGetPossibleErrors' and 'APIGetResultProperties' hooks.
* Formats dbg, dump, txt, wddx, and yaml are now deprecated.
+* action=paraminfo now indicates when a parameter is specifying a submodule.
+ Internally, a new param type 'submodule' is available to indicate this which
+ automatically queries the list of submodule names from the ApiModuleManager.
=== Languages updated in 1.24 ===
=== Languages updated in 1.24 ===
$prompt = 'One value: ';
}
$prompt = 'One value: ';
}
+ if ( $type === 'submodule' ) {
+ $type = $this->getModuleManager()->getNames( $paramName );
+ sort( $type );
+ }
if ( is_array( $type ) ) {
$choices = array();
$nothingPrompt = '';
if ( is_array( $type ) ) {
$choices = array();
$nothingPrompt = '';
if ( isset( $value ) && $type == 'namespace' ) {
$type = MWNamespace::getValidNamespaces();
}
if ( isset( $value ) && $type == 'namespace' ) {
$type = MWNamespace::getValidNamespaces();
}
+ if ( isset( $value ) && $type == 'submodule' ) {
+ $type = $this->getModuleManager()->getNames( $paramName );
+ }
}
if ( isset( $value ) && ( $multi || is_array( $type ) ) ) {
}
if ( isset( $value ) && ( $multi || is_array( $type ) ) ) {
return array(
'format' => array(
ApiBase::PARAM_DFLT => ApiMain::API_DEFAULT_FORMAT,
return array(
'format' => array(
ApiBase::PARAM_DFLT => ApiMain::API_DEFAULT_FORMAT,
- ApiBase::PARAM_TYPE => $this->mModuleMgr->getNames( 'format' )
+ ApiBase::PARAM_TYPE => 'submodule',
),
'action' => array(
ApiBase::PARAM_DFLT => 'help',
),
'action' => array(
ApiBase::PARAM_DFLT => 'help',
- ApiBase::PARAM_TYPE => $this->mModuleMgr->getNames( 'action' )
+ ApiBase::PARAM_TYPE => 'submodule',
),
'maxlag' => array(
ApiBase::PARAM_TYPE => 'integer'
),
'maxlag' => array(
ApiBase::PARAM_TYPE => 'integer'
}
if ( isset( $p[ApiBase::PARAM_TYPE] ) ) {
}
if ( isset( $p[ApiBase::PARAM_TYPE] ) ) {
- $a['type'] = $p[ApiBase::PARAM_TYPE];
+ if ( $p[ApiBase::PARAM_TYPE] === 'submodule' ) {
+ $a['type'] = $obj->getModuleManager()->getNames( $n );
+ sort( $a['type'] );
+ $a['submodules'] = '';
+ } else {
+ $a['type'] = $p[ApiBase::PARAM_TYPE];
+ }
if ( is_array( $a['type'] ) ) {
// To prevent sparse arrays from being serialized to JSON as objects
$a['type'] = array_values( $a['type'] );
if ( is_array( $a['type'] ) ) {
// To prevent sparse arrays from being serialized to JSON as objects
$a['type'] = array_values( $a['type'] );
$result = array(
'prop' => array(
ApiBase::PARAM_ISMULTI => true,
$result = array(
'prop' => array(
ApiBase::PARAM_ISMULTI => true,
- ApiBase::PARAM_TYPE => $this->mModuleMgr->getNames( 'prop' )
+ ApiBase::PARAM_TYPE => 'submodule',
),
'list' => array(
ApiBase::PARAM_ISMULTI => true,
),
'list' => array(
ApiBase::PARAM_ISMULTI => true,
- ApiBase::PARAM_TYPE => $this->mModuleMgr->getNames( 'list' )
+ ApiBase::PARAM_TYPE => 'submodule',
),
'meta' => array(
ApiBase::PARAM_ISMULTI => true,
),
'meta' => array(
ApiBase::PARAM_ISMULTI => true,
- ApiBase::PARAM_TYPE => $this->mModuleMgr->getNames( 'meta' )
+ ApiBase::PARAM_TYPE => 'submodule',
),
'indexpageids' => false,
'export' => false,
),
'indexpageids' => false,
'export' => false,