41 '_OracleDefTS' =>
'USERS',
42 '_OracleTempTS' =>
'TEMP',
43 '_InstallUser' =>
'SYSTEM',
55 return self::checkExtension(
'oci8' );
59 if ( $this->
getVar(
'wgDBserver' ) ==
'localhost' ) {
60 $this->parent->setVar(
'wgDBserver',
'' );
65 'config-db-host-oracle',
67 $this->parent->getHelpBox(
'config-db-host-oracle-help' )
71 $this->
getTextBox(
'wgDBprefix',
'config-db-prefix' ) .
72 $this->
getTextBox(
'_OracleDefTS',
'config-oracle-def-ts' ) .
75 'config-oracle-temp-ts',
77 $this->parent->getHelpBox(
'config-db-oracle-help' )
80 $this->parent->getWarningBox(
wfMessage(
'config-db-account-oracle-warn' )->
text() ) .
86 parent::submitInstallUserBox();
87 $this->parent->setVar(
'_InstallDBname', $this->
getVar(
'_InstallUser' ) );
100 $this->parent->setVar(
'wgDBname', $this->
getVar(
'wgDBuser' ) );
104 if ( !strlen( $newValues[
'wgDBserver'] ) ) {
105 $status->fatal(
'config-missing-db-server-oracle' );
106 } elseif ( !self::checkConnectStringFormat( $newValues[
'wgDBserver'] ) ) {
107 $status->fatal(
'config-invalid-db-server-oracle', $newValues[
'wgDBserver'] );
109 if ( !preg_match(
'/^[a-zA-Z0-9_]*$/', $newValues[
'wgDBprefix'] ) ) {
110 $status->fatal(
'config-invalid-schema', $newValues[
'wgDBprefix'] );
126 if ( $this->connError == 28009 ) {
137 if ( !$this->
getVar(
'_CreateDBAccount' ) ) {
138 $status->fatal(
'config-db-sys-create-oracle' );
147 if ( !$statusIS3->isOK() ) {
158 $version = $conn->getServerVersion();
159 if ( version_compare(
$version, $this->minimumVersion ) < 0 ) {
170 $this->
getVar(
'wgDBserver' ),
171 $this->
getVar(
'_InstallUser' ),
172 $this->
getVar(
'_InstallPassword' ),
173 $this->
getVar(
'_InstallDBname' ),
175 $this->
getVar(
'wgDBprefix' )
179 $this->connError = $e->db->lastErrno();
180 $status->fatal(
'config-connection-error', $e->getMessage() );
190 $this->
getVar(
'wgDBserver' ),
191 $this->
getVar(
'_InstallUser' ),
192 $this->
getVar(
'_InstallPassword' ),
193 $this->
getVar(
'_InstallDBname' ),
195 $this->
getVar(
'wgDBprefix' )
199 $this->connError = $e->db->lastErrno();
200 $status->fatal(
'config-connection-error', $e->getMessage() );
207 $tempDBname = $this->
getVar(
'wgDBname' );
208 $this->parent->setVar(
'wgDBname', $this->
getVar(
'wgDBuser' ) );
209 $retVal = parent::needsUpgrade();
210 $this->parent->setVar(
'wgDBname', $tempDBname );
216 # Add our user callback to installSteps, right before the tables are created.
219 'callback' => [ $this,
'setupUser' ]
221 $this->parent->addInstallStep( $callback,
'database' );
233 if ( !$this->
getVar(
'_CreateDBAccount' ) ) {
240 if ( $this->connError == 1031 ) {
254 if ( !$this->db->selectDB( $this->getVar(
'wgDBuser' ) ) ) {
256 $error = $this->db->sourceFile(
"$IP/maintenance/oracle/user.sql" );
257 if ( $error !==
true || !$this->db->selectDB( $this->getVar(
'wgDBuser' ) ) ) {
258 $status->fatal(
'config-install-user-failed', $this->
getVar(
'wgDBuser' ), $error );
260 } elseif ( $this->db->getFlag(
DBO_SYSDBA ) ) {
261 $status->fatal(
'config-db-sys-user-exists-oracle', $this->
getVar(
'wgDBuser' ) );
270 $this->parent->setVar(
'_InstallUser', $this->
getVar(
'wgDBuser' ) );
271 $this->parent->setVar(
'_InstallPassword', $this->
getVar(
'wgDBpassword' ) );
272 $this->parent->setVar(
'_InstallDBname', $this->
getVar(
'wgDBuser' ) );
286 $this->parent->setVar(
'wgDBname', $this->
getVar(
'wgDBuser' ) );
287 $status = parent::createTables();
290 $this->db->query(
'BEGIN fill_wiki_info; END;' );
297 # These variables are used by maintenance/oracle/user.sql
303 # These are used by tables.sql
307 foreach ( $varNames
as $name ) {
315 $prefix = $this->
getVar(
'wgDBprefix' );
317 return "# Oracle specific settings
318 \$wgDBprefix = \"{$prefix}\";
339 $isValid = preg_match(
'/^[[:alpha:]][\w\-]*(?:\.[[:alpha:]][\w\-]*){0,2}$/', $connect_string );
340 $isValid |= preg_match(
'/^(?:\/\/)?[\w\-\.]+(?::[\d]+)?(?:\/(?:[\w\-\.]+(?::(pooled|dedicated|shared))?)?(?:\/[\w\-\.]+)?)?$/', $connect_string );
342 return (
bool)$isValid;
static closeElement($element)
Returns "</$element>".
createTables()
Overload: after this action field info table has to be rebuilt.
Class for setting up the MediaWiki database using Oracle.
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException'returning false will NOT prevent logging $e
getVar($var, $default=null)
Get a variable, taking local defaults into account.
when a variable name is used in a it is silently declared as a new local masking the global
static newFatal($message)
Factory function for fatal errors.
static checkConnectStringFormat($connect_string)
Function checks the format of Oracle connect string The actual validity of the string is checked by a...
getConnection()
Connect to the database using the administrative user/password currently defined in the session...
static openElement($element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
submitWebUserBox()
Submit the form from getWebUserBox().
setupSchemaVars()
Set appropriate schema variables in the current database connection.
DatabaseBase $db
The database connection.
getWebUserBox($noCreateMsg=false)
Get a standard web-user fieldset.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned after processing after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock()-offset Set to overwrite offset parameter in $wgRequest set to ''to unsetoffset-wrap String Wrap the message in html(usually something like"<
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
setVarsFromRequest($varNames)
Convenience function to set variables based on form data.
getInstallUserBox()
Get a standard install-user fieldset.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
getTextBox($var, $label, $attribs=[], $helpData="")
Get a labelled text box to configure a local variable.
Base class for DBMS-specific installation helper classes.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set $status
static element($element, $attribs=[], $contents= '')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
static configuration should be added through ResourceLoaderGetConfigVars instead & $vars
static newGood($value=null)
Factory function for good results.
Allows to change the fields on the form that will be generated $name