blob: 67d09d19c275cf4b06dcdb338c989f518c1077c2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
<?php
# This is a drop-in replacement for commandLine.inc, for use only on
# the Wikimedia wikis.
# Call your command-line script with the language name and site name,
# e.g. php convertLinks.php aa wikipedia
if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {
print "This script must be run from the command line\n";
exit();
}
$wgCommandLineMode = true;
$self = array_shift( $argv );
# Turn off output buffering if it's on
@ob_end_flush();
if ( isset( $argv[0] ) ) {
$lang = array_shift( $argv );
} else {
$lang = "aa";
}
if ( isset( $argv[0] ) ) {
$site = array_shift( $argv );
} else {
$site = "wikipedia";
}
# This is for the IRC scripts, which now run as the apache user
if ( $_ENV['USER'] != "apache" ) {
$wgDBadminuser = "wikiadmin";
$wgDBadminpassword = trim(`wikiadmin_pass`);
}
$sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":";
putenv( "wikilang=$lang");
$newpath = "/home/wikipedia/common/php-new$sep";
$DP = "../includes";
#ini_set( "include_path", "$newpath$sep$include_path" );
ini_set( "include_path", "/home/wikipedia/common/php-new:/home/wikipedia/common/php-new/includes" );
require_once( "/home/wikipedia/common/php-new/CommonSettings.php" );
$wgUsePHPTal = false;
define("MEDIAWIKI",true);
require_once( "Setup.php" );
require_once( "../install-utils.inc" );
$wgTitle = Title::newFromText( "Command line script" );
$wgCommandLineMode = true;
set_time_limit(0);
?>
|