Difference between revisions of "Template:DBwarning"

From RobotX
Jump to navigation Jump to search
m (Text replacement - "</translate>" to "")
m (Text replacement - "<languages/>" to "")
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
<languages/>
+
 
 
</noinclude>{{#switch:
 
</noinclude>{{#switch:
 
| =
 
| =
 
{{Caution|1=<nowiki/>
 
{{Caution|1=<nowiki/>
* <!--T:1--> Do not change <tvar|1><code>$wgDBmwschema</code></> after <tvar|2>{{ll|Manual:Setup.php|Setup.php}}</> has been included. '''<!--T:2--> Note:''' <!--T:3--> <tvar|1>{{ll|Manual:Setup.php|Setup.php}}</> initializes various paths, includes some common files, starts sessions, and performs various other setup tasks for a request. <!--T:4--> It is not related to the installation or setup of MediaWiki.
+
* 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.
* <!--T:5--> Only files in <tvar|1>'''<code>{{git file|file=includes/db/}}</code>'''</> should use <tvar|2><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. <!--T:6--> The <tvar|1><code>DatabaseDomain</code></> class can extract such components from a database domain ID.
+
* 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.
* <!--T:7--> If you configure <tvar|1><code>$wgDBservers</code></> or <tvar|2><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). <!--T:8--> The combination of <tvar|1><code>$wgDBname</code></>, <tvar|2><code>$wgDBmwschema</code></>, and <tvar|3><code>$wgDBprefix</code></> define the current wiki's ''database domain''. <!--T:9--> This is also called the ''local database domain''. <!--T:10--> The '<tvar|1>dbname</>' and '<tvar|2>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></>. <!--T:11--> Note that functions calls like <tvar|1><code>wfGetDB( DB_REPLICA )</code></>, which simply omit the database domain, are assumed to refer to the local database domain.
+
* 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


Caution! Caution: 3>dbSchema() method provided by the <tvar