https://bugzilla.wikimedia.org/show_bug.cgi?id=23348

Hydra <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #7 from Hydra <[email protected]> ---
This is part of the MediaWiki multiversion system deployed on the Wikimedia
cluster. It contains a lot of useless code for third parties, but the main part
that you will need in your own wikifarm:

if ( $wgCommandLineMode ) {
    if ( isset( $argv[1] ) && $argv[1] === '--wiki' ) {
        $dbname = isset( $argv[2] ) ? $argv[2] : ''; // "script.php --wiki
dbname"
    } elseif ( isset( $argv[1] ) && substr( $argv[1], 0, 7 ) === '--wiki=' ) {
        $dbname = substr( $argv[1], 7 ); // "script.php --wiki=dbname"
    } elseif ( isset( $argv[1] ) && substr( $argv[1], 0, 2 ) !== '--' ) {
        $dbname = $argv[1]; // "script.php dbname"
    }
}
$wgDBname = $dbname; // Set it to the DB given

There is also another hack to find what domain the user is coming from, but it
is not needed here. (Note: I added the first and last line myself)

The funny thing is that all maintenance scripts makes --wiki as a possible
parameter, even though the above code might not yet have been set. That
requirement should be removed totally, but that deserves another bug to be
filed and is not part of this.

Somebody should put this on MediaWiki.org.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to