mirror of
https://github.com/diocloid/LinkTitles.git
synced 2025-07-13 01:39:30 +02:00
Detect location of Maintenance.php in CLI script.
This commit is contained in:
@ -20,11 +20,31 @@
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
// Include the maintenance base class from:
|
||||
// Attempt to include the maintenance base class from:
|
||||
// $wgScriptPath/maintenance/Maintenance.php
|
||||
// Our script is normally located at:
|
||||
// $wgScriptPath/extensions/LinkTitles/LinkTitles.cli.php
|
||||
require_once( "/home/daniel/Documents/Kommunikation/Wiki/maintenance/Maintenance.php" );
|
||||
$maintenanceScript = dirname( __FILE__ ) . "/../../maintenance/Maintenance.php";
|
||||
if ( file_exists( $maintenanceScript ) ) {
|
||||
require_once $maintenanceScript;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Did not find the script where we expected it (maybe because we are a
|
||||
// symlinked file -- __FILE__ resolves symbolic links).
|
||||
$maintenanceScript = dirname( __FILE__ ) . "/Maintenance.php";
|
||||
if ( file_exists( $maintenanceScript ) ) {
|
||||
require_once $maintenanceScript;
|
||||
}
|
||||
else
|
||||
{
|
||||
die("FATAL: Could not locate Maintenance.php.\n" .
|
||||
"You may want to create a symbolic link named Maintenance.php in this directory\n" .
|
||||
"which points to <YOUR_MEDIAWIKI_ROOT_IN_FILESYSTEM>/extensions/Maintenance.php\n" .
|
||||
"Ex.: ln -s /var/www/wiki/extensions/Maintenance.php\n\n");
|
||||
}
|
||||
};
|
||||
|
||||
require_once( dirname( __FILE__ ) . "/LinkTitles.body.php" );
|
||||
|
||||
class LinkTitlesCli extends Maintenance {
|
||||
|
Reference in New Issue
Block a user