### Variable: installerStarted Source: https://doc.wikimedia.org/mediawiki-core/master/php/NoLocalSettings_8php Indicates if the installer has started, determined by success status and session data. ```php $installerStarted = ( $success && isset( $_SESSION['installData'] ) ) ``` -------------------------------- ### Get Usage Examples Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Api_1_1ApiParamInfo Returns usage examples for the current API module. This is useful for generating help text and demonstrating functionality. ```php getExamplesMessages() ``` -------------------------------- ### Conditional Variable 'if' and Session Handling Source: https://doc.wikimedia.org/mediawiki-core/master/php/WebStart_8php This snippet shows a conditional block that checks if MW_SETUP_CALLBACK is defined. If not, it proceeds with session handler installation and initializes the global $wgUser variable. It's part of the core MediaWiki setup process. ```PHP /** * @var bool */ if ( !defined( 'MW_SETUP_CALLBACK' ) ) { if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) { MediaWiki\Session\PHPSessionHandler::install( MediaWiki\Session\SessionManager::singleton() ); } } global $wgUser; $wgUser ``` -------------------------------- ### getSystemInfo Method Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Installer_1_1Pingback Collects basic data about the MediaWiki installation and returns it as an associative array conforming to the MediaWikiPingback event schema. This method is intended for internal use by the Installer. ```APIDOC getSystemInfo(Config $config): array - Collect basic data about this MediaWiki installation. - Returns data conforming to the MediaWikiPingback event schema. - Developers should document new data fields at MediaWiki.org. - Access: internal (for Installer use only). - Parameters: - Config $config: The MediaWiki configuration object, with `DBtype` set. - Returns: An associative array of system information. - Definition: line 244 of Pingback.php ``` -------------------------------- ### MediaWiki Installer DatabaseCreator API Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Installer_1_1DatabaseCreator Provides methods for interacting with database creation and checking mechanisms within the MediaWiki installer. This includes abstract methods for creating databases locally and checking their existence in local or networked contexts. ```APIDOC MediaWiki\Installer\DatabaseCreator abstract createLocally(string $database) - Creates a database in the local cluster or install context. - Parameters: - string $database: The name of the database to create. - Returns: Status - Reimplemented in MediaWiki\Installer\NetworkedDatabaseCreator and MediaWiki\Installer\SqliteDatabaseCreator. abstract existsInLoadBalancer(ILoadBalancer $loadBalancer, string $database) - Checks if a database exists in the specified LoadBalancer, which may be for an external cluster. - Parameters: - ILoadBalancer $loadBalancer: The load balancer instance to check against. - string $database: The name of the database to check. - Returns: bool - Reimplemented in MediaWiki\Installer\NetworkedDatabaseCreator and MediaWiki\Installer\SqliteDatabaseCreator. abstract existsLocally(string $database) - Checks if a database exists on the local cluster or context. - Parameters: - string $database: The name of the database to check. - Returns: bool - Reimplemented in MediaWiki\Installer\NetworkedDatabaseCreator and MediaWiki\Installer\SqliteDatabaseCreator. protected $context - The task context, providing access to necessary services and configuration. - Type: ITaskContext MediaWiki\Installer\Task\ITaskContext - Definition: Defined in DatabaseCreator.php at line 17. - Referenced by: MediaWiki\Installer\SqliteDatabaseCreator::__construct() and MediaWiki\Installer\DatabaseCreator::createInstance(). ``` -------------------------------- ### MediaWiki Installer Pingback Constants Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Installer_1_1Pingback Details the protected constants of the MediaWiki Installer Pingback class, including their values and definitions. ```APIDOC class MediaWiki\Installer\Pingback { // Constants /** * @var string * private const * Initial value: * 'https://intake-analytics.wikimedia.org/v1/events?hasty=true' */ private const EVENT_PLATFORM_EVENT_INTAKE_SERVICE_URI = 'https://intake-analytics.wikimedia.org/v1/events?hasty=true'; // Definition at line 79 of file Pingback.php. } ``` -------------------------------- ### MediaWiki Installer: SqliteConnectForm::getHtml() Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Installer_1_1SqliteConnectForm Generates the HTML for a web form used to configure the SQLite database connection. This form collects the minimum necessary information to connect and determine if an installation or upgrade is required. The method assumes the parent context is a WebInstaller. ```APIDOC MediaWiki\Installer\SqliteConnectForm::getHtml() Signature: getHtml() : string Description: Get HTML for a web form that configures this database. Configuration at this time should be the minimum needed to connect and test whether install or upgrade is required. If this is called, $this->parent can be assumed to be a WebInstaller. Inheritance: Reimplemented from MediaWiki\Installer\DatabaseConnectForm::getHtml() References: MediaWiki\Installer\DatabaseForm\getTextBox() Access: public ``` -------------------------------- ### MediaWiki Installer Pingback Properties Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Installer_1_1Pingback Details the protected properties of the MediaWiki Installer Pingback class, including their types and definitions. ```APIDOC class MediaWiki\Installer\Pingback { // Properties /** * @var IConnectionProvider MediaWiki\Rdbms\IConnectionProvider * protected */ protected $dbProvider; // Definition at line 83 of file Pingback.php. // Referenced by MediaWiki\Installer\Pingback::__construct(). /** * @var string * protected */ protected $eventIntakeUri; // Definition at line 91 of file Pingback.php. /** * @var HttpRequestFactory MediaWiki\Http\HttpRequestFactory * protected */ protected $http; // Definition at line 87 of file Pingback.php. // Referenced by MediaWiki\Installer\Pingback::__construct(). /** * @var string * protected * updatelog key (also used as cache/db lock key) */ protected $key; // Definition at line 89 of file Pingback.php. /** * @var LoggerInterface * protected */ protected $logger; // Definition at line 79 of file Pingback.php. // Referenced by MediaWiki\Installer\Pingback::__construct(). } ``` -------------------------------- ### MediaWiki\Installer\PostgresConnectForm API Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Installer_1_1PostgresConnectForm API documentation for the PostgresConnectForm class, including its own methods and inherited methods relevant to form generation and data handling in the MediaWiki installer. ```APIDOC MediaWiki\Installer\PostgresConnectForm: Inherits: MediaWiki\Installer\DatabaseConnectForm Public Member Functions: getHtml(): - Returns HTML for a web form that configures this database. - Parameters: None - Returns: string HTML submit(): - Sets variables based on the request array, assuming it was submitted via the form returned by getConnectForm(). - Parameters: None - Returns: void Inherited Public Member Functions from MediaWiki\Installer\DatabaseForm: __construct(WebInstaller $webInstaller, DatabaseInstaller $dbInstaller): - Constructor for the DatabaseForm class. - Parameters: - webInstaller: An instance of WebInstaller. - dbInstaller: An instance of DatabaseInstaller. - Returns: void getCheckBox(string $var, string $label, array $attribs = [], string $helpData = ""): - Gets a labelled checkbox to configure a local boolean variable. - Parameters: - var: The name of the variable. - label: The label for the checkbox. - attribs: Optional attributes for the checkbox. - helpData: Optional help text data. - Returns: string HTML getName(): - Returns the internal name of the form. - Parameters: None - Returns: string getPasswordBox(string $var, string $label, array $attribs = [], string $helpData = ""): - Gets a labelled password box to configure a local variable. - Parameters: - var: The name of the variable. - label: The label for the password box. - attribs: Optional attributes for the password box. - helpData: Optional help text data. - Returns: string HTML getRadioSet(array $params): - Gets a set of labelled radio buttons. - Parameters: - params: An array of parameters for the radio set. - Returns: string HTML getTextBox(string $var, string $label, array $attribs = [], string $helpData = ""): - Gets a labelled text box to configure a local variable. - Parameters: - var: The name of the variable. - label: The label for the text box. - attribs: Optional attributes for the text box. - helpData: Optional help text data. - Returns: string HTML getVar(string $var, $default = null): - Gets a variable, taking local defaults into account. - Parameters: - var: The name of the variable to retrieve. - default: The default value if the variable is not found. - Returns: mixed setVar(string $name, $value): - Sets a variable. - Parameters: - name: The name of the variable. - value: The value to set. - Returns: void setVarsFromRequest(array $varNames): - Convenience function to set variables based on form data. - Parameters: - varNames: An array of variable names to set from the request. - Returns: void Inherited Protected Member Functions from MediaWiki\Installer\DatabaseConnectForm: getInstallUserBox(): - Gets a standard install-user fieldset. - Parameters: None - Returns: string HTML submitInstallUserBox(): - Submits a standard install user fieldset. - Parameters: None - Returns: void Inherited Protected Attributes from MediaWiki\Installer\DatabaseForm: $dbInstaller: MediaWiki\Installer\DatabaseInstaller $webInstaller: MediaWiki\Installer\WebInstaller ``` -------------------------------- ### PostgresConnectForm::getHtml() Method Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Installer_1_1PostgresConnectForm Generates the HTML for a web form used to configure the PostgreSQL database connection. This method requires minimal configuration for connecting and testing installation or upgrade status. It assumes that $this->parent is an instance of WebInstaller when called. ```APIDOC MediaWiki\Installer\PostgresConnectForm::getHtml() Get HTML for a web form that configures this database. Configuration at this time should be the minimum needed to connect and test whether install or upgrade is required. If this is called, $this->parent can be assumed to be a WebInstaller. Reimplemented from MediaWiki\Installer\DatabaseConnectForm. Definition at line 13 of file PostgresConnectForm.php. ``` -------------------------------- ### MediaWiki\Installer\DatabaseCreator Constructor Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Installer_1_1DatabaseCreator Constructs the DatabaseCreator instance, initializing it with a task context required for database operations. ```APIDOC __construct(ITaskContext $context) Protected constructor for DatabaseCreator. Reimplemented in MediaWiki\Installer\SqliteDatabaseCreator. Definition at line 40 of file DatabaseCreator.php. ``` -------------------------------- ### MediaWiki\Installer\WebInstallerUpgrade::showDoneMessage Method Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Installer_1_1WebInstallerUpgrade Displays a completion message for the web installer upgrade process. This method references several other methods from the WebInstallerPage class and is referenced by the execute method. ```APIDOC MediaWiki\Installer\WebInstallerUpgrade::showDoneMessage() Definition: line 81 of file WebInstallerUpgrade.php References: MediaWiki\Installer\WebInstallerPage\endForm(), MediaWiki\Installer\WebInstallerPage\getVar(), MediaWiki\Installer\WebInstallerPage\startForm() Referenced by: MediaWiki\Installer\WebInstallerUpgrade\execute() ``` -------------------------------- ### MediaWiki\Installer\DatabaseCreator Static Member Functions Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Installer_1_1DatabaseCreator Provides static methods for creating instances of the DatabaseCreator class. ```APIDOC createInstance(ITaskContext $context) Static method to create an instance of DatabaseCreator. Access: internal use Task::getDatabaseCreator() Parameters: ITaskContext $context: The task context to use for creating the instance. Returns: DatabaseCreator References MediaWiki\Installer\DatabaseCreator::$context. Definition at line 25 of file DatabaseCreator.php. ``` -------------------------------- ### Variable: success Source: https://doc.wikimedia.org/mediawiki-core/master/php/NoLocalSettings_8php Starts a session, returning true on success and false on failure. ```php $success = session_start() ``` -------------------------------- ### PHP: MediaWikiEntryPoint::setup() Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1MediaWikiEntryPoint Performs any necessary setup before the execute() method is called. This is a final wrapper function called by doRun(). It takes no parameters. ```PHP MediaWiki\MediaWikiEntryPoint::setup() ``` -------------------------------- ### MediaWiki doSetup Method Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1MediaWikiEntryPoint Performs any necessary setup operations before the main execution phase begins. This method is called by doRun() and can be reimplemented by subclasses to customize initialization logic. ```APIDOC MediaWiki\MediaWikiEntryPoint::doSetup ( ) protected Description: Perform any setup needed before execute() is called. Called by doRun() via doSetup(). Reimplemented in: - [MediaWiki\Rest\EntryPoint](classMediaWiki_1_1Rest_1_1EntryPoint.html#a0b7607c306967a0b597c3f258caca180) Definition: File: MediaWikiEntryPoint.php, Line: 145 ``` -------------------------------- ### MediaWiki doSetup Method Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki Performs necessary setup operations before the main execution logic is called. This method is crucial for initializing the MediaWiki environment. ```APIDOC doSetup() - Perform any setup needed before execute() is called. ``` -------------------------------- ### MediaWiki ApiQueryAllRevisions Module Source: https://doc.wikimedia.org/mediawiki-core/master/php/ApiQueryAllRevisions_8php_source API module for enumerating all revisions of pages. It includes methods for running queries, getting examples, help URLs, and managing parameters. ```APIDOC ApiQueryAllRevisions Query module to enumerate all revisions. Definition: ApiQueryAllRevisions.php:49 run( ?ApiPageSet $resultPageSet=null ) Executes the revision query. Definition: ApiQueryAllRevisions.php:96 getExamplesMessages() Returns usage examples for this module. Definition: ApiQueryAllRevisions.php:332 getHelpUrls() Return links to more detailed help pages about the module. Definition: ApiQueryAllRevisions.php:341 __construct( ApiQuery $query, string $moduleName, RevisionStore $revisionStore, IContentHandlerFactory $contentHandlerFactory, ParserFactory $parserFactory, SlotRoleRegistry $slotRoleRegistry, ActorMigration $actorMigration, NamespaceInfo $namespaceInfo, ChangeTagsStore $changeTagsStore, ContentRenderer $contentRenderer, ContentTransformer $contentTransformer, CommentFormatter $commentFormatter, TempUserCreator $tempUserCreator, UserFactory $userFactory ) Constructor for ApiQueryAllRevisions. Definition: ApiQueryAllRevisions.php:56 getAllowedParams() Retrieves the allowed parameters for this module. Definition: ApiQueryAllRevisions.php:280 ``` -------------------------------- ### Pingback Constructor Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Installer_1_1Pingback Initializes the Pingback class with configuration, database provider, cache, HTTP client, logger, and event intake URL. It sets up the necessary dependencies for pingback operations. ```APIDOC __construct(Config $config, IConnectionProvider $dbProvider, BagOStuff $cache, HttpRequestFactory $http, LoggerInterface $logger, string $eventIntakeUrl = self::EVENT_PLATFORM_EVENT_INTAKE_SERVICE_URI) - Initializes the MediaWiki Installer Pingback class. - Parameters: - Config $config: The MediaWiki configuration object. - IConnectionProvider $dbProvider: The database connection provider. - BagOStuff $cache: The cache object. - HttpRequestFactory $http: The HTTP request factory. - LoggerInterface $logger: The logger instance. - string $eventIntakeUrl: The URL for event intake (defaults to a platform service URI). - Definition: line 100 of Pingback.php ``` -------------------------------- ### MediaWiki\Installer\Pingback API Documentation Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Installer_1_1Pingback Documentation for the MediaWiki\Installer\Pingback class, detailing its constructor, methods, and attributes for sending pingback data. ```APIDOC MediaWiki\Installer\Pingback Class Send information about this MediaWiki instance to mediawiki.org. This service uses two kinds of rows in the `update_log` database table: * ul_key `PingBack`, this holds a random identifier for this wiki, created only once, when the first ping after wiki creation is sent. * ul_key `Pingback-`, this holds a timestamp and is created once after each MediaWiki upgrade, and then updated up to once a month. Access: internal For use by Setup.php only Since: 1.28 Definition at line 47 of file Pingback.php. --- Public Member Functions --- __construct(Config $config, IConnectionProvider $dbProvider, BagOStuff $cache, HttpRequestFactory $http, LoggerInterface $logger, string $eventIntakeUrl = self::EVENT_PLATFORM_EVENT_INTAKE_SERVICE_URI) - Constructor for the Pingback class. - Parameters: - Config $config: The MediaWiki configuration object. - IConnectionProvider $dbProvider: The database connection provider. - BagOStuff $cache: The cache object. - HttpRequestFactory $http: The HTTP request factory. - LoggerInterface $logger: The logger interface instance. - string $eventIntakeUrl: The URL for event intake (defaults to EVENT_PLATFORM_EVENT_INTAKE_SERVICE_URI). run() - Maybe send a ping. - Triggers the ping sending mechanism based on internal logic and configuration. --- Static Public Member Functions --- getSystemInfo(Config $config) - Collect basic data about this MediaWiki installation and return it as an associative array conforming to the MediaWikiPingback event schema. - Parameters: - Config $config: The MediaWiki configuration object. - Returns: An associative array representing system information for the pingback. - Schema: https://gerrit.wikimedia.org/r/plugins/gitiles/schemas/event/secondary/+/refs/heads/master/jsonschema/analytics/legacy/mediawikipingback/ --- Protected Member Functions --- getData() - Get the event to be sent to the server. - Returns: The data payload for the pingback event. --- Protected Attributes --- $cache: BagOStuff $config: Config $dbProvider: IConnectionProvider $eventIntakeUri: string $http: HttpRequestFactory $key: string (updatelog key, also used as cache/db lock key) $logger: LoggerInterface ``` -------------------------------- ### MediaWiki Installer Helper Functions Source: https://doc.wikimedia.org/mediawiki-core/master/php/DatabaseConnectForm_8php_source This section documents helper functions and classes used within the MediaWiki installer, such as message retrieval and HTML element generation. ```APIDOC wfMessage( $key, ... $params ) Description: This is the function for getting translated interface messages. File: GlobalFunctions.php:859 MediaWiki\Html\Html Description: This class is a collection of static functions that serve two purposes. File: Html.php:57 MediaWiki\Installer\DatabaseForm Description: Base class for database forms. File: DatabaseForm.php:8 MediaWiki\Installer\DatabaseForm::getPasswordBox( $var, $label, $attribs=[], $helpData="") Description: Get a labelled password box to configure a local variable. Parameters: - $var: The variable name. - $label: The label for the input field. - $attribs: Optional attributes for the input element. - $helpData: Optional help text data. File: DatabaseForm.php:82 MediaWiki\Installer\DatabaseForm::setVarsFromRequest( $varNames) Description: Set variables from the request array. Parameters: - $varNames: An array of variable names to retrieve from the request. MediaWiki\Installer\DatabaseConnectForm::getHtml() Description: Get HTML for a web form that configures this database. File: DatabaseConnectForm.php:20 MediaWiki\Installer\DatabaseConnectForm::submit() Description: Set variables based on the request array, assuming it was submitted via the form returned by getConnect... File: DatabaseConnectForm.php:31 MediaWiki\Installer\DatabaseConnectForm::getInstallUserBox() Description: Get a standard install-user fieldset. File: DatabaseConnectForm.php:38 MediaWiki\Installer\DatabaseConnectForm::submitInstallUserBox() Description: Submit a standard install user fieldset. File: DatabaseConnectForm.php:65 ``` -------------------------------- ### Profiler Initialization and Singleton Instance Source: https://doc.wikimedia.org/mediawiki-core/master/php/Profiler_8php_source Provides static methods for initializing the Profiler with configuration and retrieving the singleton instance. The `init` method sets up the profiler based on provided configuration, including sampling rates and CLI enablement, falling back to a stub if conditions aren't met. The `instance` method ensures a single profiler object is available application-wide. ```PHP final public static function init( array $profilerConf ): void { $params = $profilerConf + [ 'class' => ProfilerStub::class, 'sampling' => 1, 'threshold' => 0.0, 'output' => [], 'cliEnable' => false, ]; // Avoid global func wfIsCLI() during setup $isCLI = ( PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' ); $inSample = $params['sampling'] === 1 || mt_rand( 1, $params['sampling'] ) === 1; if ( !$inSample || // On CLI, profiling is disabled by default, and can be explicitly enabled // via the `--profiler` option, which MediaWiki\Maintenance\MaintenanceRunner::setup // translates into 'cliEnable'. // See also $wgProfiler docs. // // For this to work, Setup.php must call Profiler::init() after handling of // MW_FINAL_SETUP_CALLBACK, which is what doMaintenance.php uses to call // MaintenanceRunner::setup. ( $isCLI && !$params['cliEnable'] ) ) { $params['class'] = ProfilerStub::class; } if ( !is_array( $params['output'] ) ) { $params['output'] = [ $params['output'] ]; } self::$instance = new $params['class']( $params ); } final public static function instance() { if ( !self::$instance ) { trigger_error( 'Called Profiler::instance before settings are loaded', E_USER_WARNING ); self::init( [] ); } return self::$instance; } ``` -------------------------------- ### wfWebStartSetup Function Source: https://doc.wikimedia.org/mediawiki-core/master/php/WebStart_8php Sets up MediaWiki web requests, including loading site configuration. This function is conditional on MW_CONFIG_CALLBACK not being defined and accepts a SettingsBuilder object. ```PHP /** * @param SettingsBuilder $settings * @return void */ if ( !defined( 'MW_CONFIG_CALLBACK' ) ) { wfWebStartSetup( new SettingsBuilder() ); } ``` -------------------------------- ### MediaWiki API Query AllDeletedRevisions Examples Source: https://doc.wikimedia.org/mediawiki-core/master/php/ApiQueryAllDeletedRevisions_8php_source Provides example API query strings for the 'alldeletedrevisions' list module, demonstrating usage with user, namespace, and limit parameters. These examples are used for documentation and testing. ```apidoc action=query&list=alldeletedrevisions&adruser=Example&adrlimit=50 => 'apihelp-query+alldeletedrevisions-example-user' action=query&list=alldeletedrevisions&adrdir=newer&adrnamespace=0&adrlimit=50 => 'apihelp-query+alldeletedrevisions-example-ns-main' ``` -------------------------------- ### MediaWiki doPrepareForOutput Method Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1MediaWikiEntryPoint Prepares the MediaWiki environment for sending the output to the client. It should be invoked by entry points before the response is sent and is automatically called by the run() method. Subclasses can override this but should not call it directly. ```APIDOC MediaWiki\MediaWikiEntryPoint::doPrepareForOutput ( ) protected Description: Prepare for sending the output. Should be called by entry points before sending the response. Will be called automatically by run() via prepareForOutput(). Subclasses may override this method, but should not call it directly. Note: arc-lamp profiling relies on the name of this method, it's hard coded in the arclamp-generate-svgs script! Reimplemented in: - [MediaWiki\Actions\ActionEntryPoint](classMediaWiki_1_1Actions_1_1ActionEntryPoint.html#ad1d2a2c720772a87a1f952a0bc8d525e) - [MediaWiki\FileRepo\ThumbnailEntryPoint](classMediaWiki_1_1FileRepo_1_1ThumbnailEntryPoint.html#a9d564c0cfa540a0ec21973fec8fba061) - [MediaWiki\ResourceLoader\ResourceLoaderEntryPoint](classMediaWiki_1_1ResourceLoader_1_1ResourceLoaderEntryPoint.html#a16aef93637787d67cb7b542f8bc7c3aa) Definition: File: MediaWikiEntryPoint.php, Line: 182 ``` -------------------------------- ### MediaWiki\Installer\WebInstallerUpgrade::execute() Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Installer_1_1WebInstallerUpgrade Executes the upgrade process for the MediaWiki installer. This method is part of the web-based installer interface and handles the core logic for performing an upgrade. It reimplements the execute method from the parent WebInstallerPage class. ```APIDOC MediaWiki\Installer\WebInstallerUpgrade::execute() Signature: execute(): string|null Description: Executes the upgrade process. Reimplemented from: MediaWiki\Installer\WebInstallerPage::execute() Definition: Line 36 of WebInstallerUpgrade.php References: MediaWiki\Installer\WebInstallerPage\addHTML() MediaWiki\Installer\WebInstallerPage\endForm() MediaWiki\Installer\WebInstallerPage\endLiveBox() MediaWiki\Installer\WebInstallerPage\getVar() MW_VERSION MediaWiki\Installer\WebInstallerUpgrade\showDoneMessage() MediaWiki\Installer\WebInstallerPage\startForm() MediaWiki\Installer\WebInstallerPage\startLiveBox() wfMessage() ``` -------------------------------- ### MediaWiki ApiQueryFileRepoInfo getExamplesMessages() Method Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Api_1_1ApiQueryFileRepoInfo Returns usage examples for this module. The return value maps query strings to message keys or Message objects. Do not call the base class implementation when overriding. ```APIDOC MediaWiki\Api\ApiQueryFileRepoInfo::getExamplesMessages() Returns usage examples for this module. Return value has query strings as keys, with values being either strings (message key), arrays (message key + parameter), or Message objects. Do not call this base class implementation when overriding this method. Since: 1.25 Stability: stable Returns: array Reimplemented from MediaWiki\Api\ApiBase. Definition at line 114 of file ApiQueryFileRepoInfo.php. ``` -------------------------------- ### MediaWiki Installer InstallException Class Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Installer_1_1InstallException Represents an exception specific to the MediaWiki installation process. It extends MWException and provides methods to manage installation-related errors, including retrieving the status of the operation that caused the exception. ```APIDOC MediaWiki\Installer\InstallException Exception thrown if an error occurs during installation. Inherits MediaWiki\Exception\MWException. Public Member Functions: __construct( Status $status, string $message = '', int $code = 0, ?Throwable $previous = null ) - Initializes a new instance of the InstallException class. - Parameters: - Status $status: The state when an exception occurs. - string $message: The Exception message to throw. - int $code: The Exception code. - ?Throwable $previous: The previous throwable used for the exception chaining. - Definition at line 43 of InstallException.php. getStatus( ) - Retrieves the Status object associated with this installation exception. - Returns: The Status object. - Definition at line 49 of InstallException.php. Inherited Public Member Functions from MediaWiki\Exception\MWException: hasOverriddenHandler( ) - Checks if this exception has an overridden handler. isLoggable( ) - Determines whether to log this exception in the exception debug log. msg( string $key, string $fallback, ...$params ) - Gets a message from i18n using a key and optional parameters. report( ) - Outputs a report about the exception, handling formatting. useMessageCache( ) - Checks if the extension can use the Message class or wfMessage for i18n-ed messages. Inherited Static Public Member Functions from MediaWiki\Exception\MWException: isCommandLine( ) - Checks if the current environment is command line mode for appropriate exception reporting. ``` -------------------------------- ### run Method Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Installer_1_1Pingback Executes the pingback process, potentially sending a ping to the server. This method handles the logic for deciding whether and how to send the pingback. ```APIDOC run(): void - Maybe send a ping. - Exceptions: - DBError: If identifier insert fails. - DBError: If timestamp upsert fails. - Definition: line 123 of Pingback.php ``` -------------------------------- ### PHP: MediaWiki Installer DatabaseForm getTextBox Source: https://doc.wikimedia.org/mediawiki-core/master/php/DatabaseConnectForm_8php_source Provides a method to generate a labelled text box for configuring a local variable within the MediaWiki installer. It takes variable name, label, optional attributes, and help data as input. ```APIDOC MediaWiki\Installer\DatabaseForm::getTextBox Get a labelled text box to configure a local variable. Signature: getTextBox( $var, $label, $attribs = [], $helpData = "" ) Parameters: $var: The name of the variable to configure. $label: The label for the text box. $attribs: An array of HTML attributes for the text box (optional). $helpData: Additional help data for the text box (optional). Definition: DatabaseForm.php:54 ``` -------------------------------- ### MediaWiki API: Random Module Examples Source: https://doc.wikimedia.org/mediawiki-core/master/php/ApiQueryRandom_8php_source Provides example API query strings for the random module, demonstrating simple usage, generator integration, and filtering by minimum size. These examples are intended for API documentation and user guidance. ```APIDOC action=query&list=random&rnnamespace=0&rnlimit=2 => apihelp-query+random-example-simple action=query&generator=random&grnnamespace=0&grnlimit=2&prop=info => apihelp-query+random-example-generator action=query&list=random&rnnamespace=0&rnlimit=1&minsize=500 => apihelp-query+random-example-minsize ``` -------------------------------- ### MediaWiki API Imagerotate Usage Examples Source: https://doc.wikimedia.org/mediawiki-core/master/php/ApiImageRotate_8php_source Provides example API requests for rotating images, demonstrating simple rotation and rotation with a generator. ```APIDOC MediaWiki\Api\ApiImageRotate::getExamplesMessages Examples: - Simple Rotation: action=imagerotate&titles=File:Example.jpg&rotation=90&token=123ABC (Rotates File:Example.jpg by 90 degrees) - Rotation with Generator: action=imagerotate&generator=categorymembers&gcmtitle=Category:Flip&gcmtype=file&rotation=180&token=123ABC (Rotates all files in Category:Flip by 180 degrees) ``` -------------------------------- ### Process Initial Template Source: https://doc.wikimedia.org/mediawiki-core/master/php/NoLocalSettings_8php Calls the processTemplate method of the $templateParser object with initial settings for MediaWiki. It includes version, path, and installer status. ```PHP echo [$templateParser](#a667f321c4fd9ea98f2f1ea44bb8e2f54)->processTemplate( 'NoLocalSettings', [ 'version' => ( defined( 'MW_VERSION' ) ? [MW_VERSION](Defines_8php.html#a57301a184f40ca6bb0566f1cdb5ae809) : 'VERSION' ), 'path' => [$path](#a0a4baf0b22973c07685c3981f0d17fc4), 'localSettingsExists' => file_exists( MW_CONFIG_FILE ), 'installerStarted' => [$installerStarted](#a7e7fef0d6d2853e6c4479b0740e8f1c0) ] ) ``` -------------------------------- ### ThumbnailEntryPoint::doPrepareForOutput (APIDOC) Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1FileRepo_1_1ThumbnailEntryPoint Prepares the entry point for sending output. This method should be called before sending the response and is automatically invoked by run() via prepareForOutput(). Subclasses can override it but should not call it directly. It is noted that arc-lamp profiling relies on its name. ```APIDOC MediaWiki\FileRepo\ThumbnailEntryPoint::doPrepareForOutput ( ) protected Prepare for sending the output. Should be called by entry points before sending the response. Will be called automatically by run() via prepareForOutput(). Subclasses may override this method, but should not call it directly. Note : arc-lamp profiling relies on the name of this method, it's hard coded in the arclamp-generate-svgs script! Reimplemented from [MediaWiki\MediaWikiEntryPoint](classMediaWiki_1_1MediaWikiEntryPoint.html#a1966f1b427278256cdba35aee7fbb0d3). Definition at line [79](ThumbnailEntryPoint_8php_source.html#l00079) of file [ThumbnailEntryPoint.php](ThumbnailEntryPoint_8php_source.html). ``` -------------------------------- ### MediaWiki Installer Environment Check Source: https://doc.wikimedia.org/mediawiki-core/master/php/NoLocalSettings_8php A function used during the MediaWiki installation process to check the environment, specifically verifying the existence and accessibility of required paths. ```php MediaWiki\Installer\WebInstaller\envCheckPath() ``` -------------------------------- ### MediaWiki API QueryAllRevisions Examples and Help URLs Source: https://doc.wikimedia.org/mediawiki-core/master/php/ApiQueryAllRevisions_8php_source Provides example API query strings for the AllRevisions module and the primary help URL for this module. ```php protected function getExamplesMessages() { return [ 'action=query&list=allrevisions&arvuser=Example&arvlimit=50' => 'apihelp-query+allrevisions-example-user', 'action=query&list=allrevisions&arvdir=newer&arvlimit=50' => 'apihelp-query+allrevisions-example-ns-any', ]; } public function getHelpUrls() { return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Allrevisions'; } ``` -------------------------------- ### ApiEditPage Methods and Examples Source: https://doc.wikimedia.org/mediawiki-core/master/php/ApiEditPage_8php_source Details methods for the ApiEditPage class, including token requirements, help URL retrieval, and example API usage strings. ```APIDOC ApiEditPage Methods: needsToken(): Returns: 'csrf' getHelpUrls(): Returns: 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Edit' getExamplesMessages(): Returns: Map of API action strings to help message keys. Examples: 'action=edit&title=Test&summary=test%20summary&text=article%20content&baserevid=1234567&token=123ABC' => 'apihelp-edit-example-edit' 'action=edit&title=Test&summary=NOTOC&minor=&prependtext=%5C%5C_NOTOC%5C%5C%0A&basetimestamp=2007-08-24T12:34:54Z&token=123ABC' => 'apihelp-edit-example-prepend' 'action=edit&title=Test&undo=13585&undoafter=13579&basetimestamp=2007-08-24T12:34:54Z&token=123ABC' => 'apihelp-edit-example-undo' ``` -------------------------------- ### MediaWiki\Installer\WebInstallerUpgrade::isSlow Method Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Installer_1_1WebInstallerUpgrade Checks if the web installer upgrade process is slow. This method is reimplemented from the base WebInstallerPage class and always returns true. ```APIDOC MediaWiki\Installer\WebInstallerUpgrade::isSlow() Returns: bool Always true. Definition: line 29 of file WebInstallerUpgrade.php ``` -------------------------------- ### MediaWiki\Installer\DatabaseCreator Member Functions Source: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Installer_1_1DatabaseCreator Provides methods for interacting with databases, including creation and existence checks, both locally and within a load balancer context. ```APIDOC createInLoadBalancer(ILoadBalancer $loadBalancer, $database) Create a database in the specified LoadBalancer which may be for an external cluster. Parameters: ILoadBalancer $loadBalancer: The ILoadBalancer instance. string $database: The name of the database to create. Returns: Status Abstract method, reimplemented in MediaWiki\Installer\NetworkedDatabaseCreator and MediaWiki\Installer\SqliteDatabaseCreator. Definition at line 57 of file DatabaseCreator.php. ``` ```APIDOC createLocally($database) Create a database in the local cluster or install context. Parameters: string $database: The name of the database to create. Definition at line 69 of file DatabaseCreator.php. ``` ```APIDOC existsInLoadBalancer(ILoadBalancer $loadBalancer, $database) Check if a database exists in the specified LoadBalancer which may be for an external cluster. Parameters: ILoadBalancer $loadBalancer: The ILoadBalancer instance. string $database: The name of the database to check. Definition at line 81 of file DatabaseCreator.php. ``` ```APIDOC existsLocally($database) Check if a database exists on the local cluster or context. Parameters: string $database: The name of the database to check. Definition at line 93 of file DatabaseCreator.php. ``` -------------------------------- ### PHP Hook Handler Example Source: https://doc.wikimedia.org/mediawiki-core/master/php/interfaceMediaWiki_1_1Hook_1_1ShortPagesQueryHook Example of how to implement the ShortPagesQueryHook interface in PHP to modify the Special:ShortPages query. This snippet shows the basic structure for a hook handler class. ```php protocols = array_map( 'strtolower', $externalStores ); $this->writeBaseUrls = $defaultStores; $this->localDomainId = $localDomainId; $this->logger = $logger ?: new NullLogger(); } ``` -------------------------------- ### ApiQueryImageInfo: Get Image Information and Upload History Source: https://doc.wikimedia.org/mediawiki-core/master/php/namespaceMediaWiki_1_1Api A query action to get image information and upload history. It provides details about image files, including their versions and metadata. ```APIDOC ApiQueryImageInfo: Description: Gets image information and upload history. Parameters: - (Required) iiprop: Properties to retrieve (e.g., 'url', 'size', 'timestamp'). - (Required) titles: The titles of the images. Returns: - Detailed information and upload history for the specified images. ```