Difference between revisions of "Template:DBwarning"
Jump to navigation
Jump to search
Joelmartin (talk | contribs) m (1 revision imported) |
Joelmartin (talk | contribs) m (Text replacement - "<languages/>" to "") |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
− | + | ||
− | </noinclude>{{#switch: | + | </noinclude>{{#switch: |
| = | | = | ||
{{Caution|1=<nowiki/> | {{Caution|1=<nowiki/> | ||
− | * | + | * Do not change <code>$wgDBmwschema</code> after {{ll|Manual:Setup.php|Setup.php}} has been included. ''' Note:''' {{ll|Manual:Setup.php|Setup.php}} initializes various paths, includes some common files, starts sessions, and performs various other setup tasks for a request. It is not related to the installation or setup of MediaWiki. |
− | * | + | * Only files in '''<code>{{git file|file=includes/db/}}</code>''' should use <code>$wgDBmwschema</code>, while everything else should use the <tvar|3>{{Class doclink|Wikimedia\Rdbms\IDatabase|type=interface|anchor= aebbee8083d4650a61479f3adbf37759e|dbSchema()}}</code> method provided by the <tvar|4><code>{{Class doclink|Wikimedia\Rdbms\IDatabase|type=interface}}</code> interface or extract it from the <tvar|5><code>getDomainId()</code> method in either the <tvar|6><code>{{Class doclink|Wikimedia\Rdbms\ILoadBalancer|type=interface}}</code> or the <tvar|7><code>{{Class doclink|Wikimedia\Rdbms\ILBFactory|type=interface}}</code> interface. The <code>DatabaseDomain</code> class can extract such components from a database domain ID. |
− | * | + | * If you configure <code>$wgDBservers</code> or <code>$wgLBFactoryConf</code>, you still need to define <tvar|3><code>$wgDBname</code>, <tvar|4><code>$wgDBmwschema</code> (if applicable for the DB type), and <tvar|5><code>$wgDBprefix</code> (if applicable for the DB type). The combination of <code>$wgDBname</code>, <code>$wgDBmwschema</code>, and <tvar|3><code>$wgDBprefix</code> define the current wiki's ''database domain''. This is also called the ''local database domain''. The 'dbname' and 'tablePrefix' settings in <tvar|3><code>$wgDBservers</code> and <tvar|4><code>$wgLBFactoryConf</code> only define the default DB/prefix when a connection is requested with <tvar|5><code>DatabaseDomain::newUnspecified()->getId()</code> (the empty string) as the database domain, e.g. <tvar|6><code>wfGetDB( DB_REPLICA, [], <nowiki>''</nowiki> )</code>. Note that functions calls like <code>wfGetDB( DB_REPLICA )</code>, which simply omit the database domain, are assumed to refer to the local database domain. |
}} | }} | ||
| #default= | | #default= |
Latest revision as of 20:39, 21 December 2019
![]() | 3>dbSchema() method provided by the <tvar |