Go to the documentation of this file.
29 if ( isset( $params[
'options'] ) ) {
31 if ( !is_object( $options ) ) {
32 $this->
dieWithError(
'apierror-categorytree-invalidjson',
'invalidjson' );
34 $options = get_object_vars( $options );
42 $depth = isset( $options[
'depth'] ) ? (int)$options[
'depth'] : 1;
46 $ctConfig = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig(
'categorytree' );
49 $this->
getMain()->setCacheMode(
'public' );
60 if ( $condition ===
'last-modified' ) {
66 'page_title' =>
$title->getDBkey(),
90 MediaWikiServices::getInstance()->getContentLanguage()->getExtraHashOptions(),
91 $ctConfig->
get(
'RenderHashAppend' )
96 $mcvalue =
$wgMemc->get( $mckey );
97 if ( $mcvalue && $touched <= $mcvalue[
'timestamp'] ) {
98 $html = $mcvalue[
'value'];
102 if ( !isset( $html ) ) {
114 return trim( $html );
static getLocalClusterInstance()
Get the main cluster-local cache object.
const PARAM_REQUIRED
(boolean) Is the parameter required?
static capDepth( $mode, $depth)
Internal function to cap depth PhanPluginDuplicateConditionalNullCoalescing until PHP7 is required.
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
getResult()
Get the result object.
Core functions for the CategoryTree extension, an AJAX based gadget to display the category structure...
This abstract class implements many basic API functions, and is the base of all API classes.
Interface for configuration instances.
get( $name)
Get a configuration variable such as "Sitename" or "UploadMaintenance.".
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
isInternal()
Indicates whether this module is "internal" Internal API modules are not (yet) intended for 3rd party...
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
execute()
Evaluates the parameters, performs the requested query, and sets up the result.Concrete implementatio...
renderChildren(Title $title, $depth=1)
Returns a string with an HTML representation of the children of the given category.
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Ge...
Represents a title within MediaWiki.
getOptionsAsCacheKey( $depth=null)
getModuleName()
Get the name of the module being executed by this instance.
static makeTitle( $title)
Creates a Title object from a user provided (and thus unsafe) string.
getMain()
Get the main module.
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
getHTML(CategoryTree $ct, Title $title, $depth, Config $ctConfig)
Get category tree HTML for the given tree, title, depth and config.
getConditionalRequestData( $condition)