2004-02-23 07:44:11 +00:00
|
|
|
<?php
|
2004-09-03 20:33:01 +00:00
|
|
|
/**
|
2010-12-16 19:15:12 +00:00
|
|
|
* Backwards-compatibility wrapper for old-style maintenance scripts.
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
*
|
|
|
|
|
* @file
|
|
|
|
|
* @ingroup Maintenance
|
2004-09-03 20:33:01 +00:00
|
|
|
*/
|
2010-12-16 19:15:12 +00:00
|
|
|
|
2021-01-08 02:16:02 +00:00
|
|
|
// NO_AUTOLOAD -- unsafe file-scope code
|
|
|
|
|
|
2013-05-17 00:16:59 +00:00
|
|
|
require_once __DIR__ . '/Maintenance.php';
|
2009-09-05 19:40:52 +00:00
|
|
|
|
2018-08-02 20:10:31 +00:00
|
|
|
global $optionsWithArgs, $optionsWithoutArgs, $allowUnregisteredOptions;
|
2018-01-01 13:10:16 +00:00
|
|
|
|
2009-09-05 19:40:52 +00:00
|
|
|
if ( !isset( $optionsWithArgs ) ) {
|
2016-02-17 09:09:32 +00:00
|
|
|
$optionsWithArgs = [];
|
2009-09-05 19:40:52 +00:00
|
|
|
}
|
2016-02-03 22:58:53 +00:00
|
|
|
if ( !isset( $optionsWithoutArgs ) ) {
|
|
|
|
|
$optionsWithoutArgs = [];
|
|
|
|
|
}
|
2018-08-02 20:10:31 +00:00
|
|
|
if ( !isset( $allowUnregisteredOptions ) ) {
|
|
|
|
|
$allowUnregisteredOptions = false;
|
|
|
|
|
}
|
2009-09-04 08:02:00 +00:00
|
|
|
|
|
|
|
|
class CommandLineInc extends Maintenance {
|
|
|
|
|
public function __construct() {
|
2018-08-02 20:10:31 +00:00
|
|
|
global $optionsWithArgs, $optionsWithoutArgs, $allowUnregisteredOptions;
|
2018-01-01 13:10:16 +00:00
|
|
|
|
2009-09-04 08:02:00 +00:00
|
|
|
parent::__construct();
|
2018-08-02 20:10:31 +00:00
|
|
|
|
2009-09-04 08:02:00 +00:00
|
|
|
foreach ( $optionsWithArgs as $name ) {
|
|
|
|
|
$this->addOption( $name, '', false, true );
|
2008-06-04 01:46:53 +00:00
|
|
|
}
|
2016-02-03 22:58:53 +00:00
|
|
|
foreach ( $optionsWithoutArgs as $name ) {
|
|
|
|
|
$this->addOption( $name, '', false, false );
|
|
|
|
|
}
|
2018-08-02 20:10:31 +00:00
|
|
|
|
|
|
|
|
$this->setAllowUnregisteredOptions( $allowUnregisteredOptions );
|
2009-09-24 21:41:17 +00:00
|
|
|
}
|
2004-08-14 06:10:56 +00:00
|
|
|
|
2009-09-24 21:41:17 +00:00
|
|
|
/**
|
|
|
|
|
* No help, it would just be misleading since it misses custom options
|
2014-08-15 16:22:34 +00:00
|
|
|
* @param bool $force
|
2009-09-24 21:41:17 +00:00
|
|
|
*/
|
|
|
|
|
protected function maybeHelp( $force = false ) {
|
2011-12-31 00:21:27 +00:00
|
|
|
if ( !$force ) {
|
2009-09-24 21:41:17 +00:00
|
|
|
return;
|
2011-12-31 00:21:27 +00:00
|
|
|
}
|
2009-09-24 21:41:17 +00:00
|
|
|
parent::maybeHelp( true );
|
2008-05-12 22:01:44 +00:00
|
|
|
}
|
2004-06-15 15:18:50 +00:00
|
|
|
|
2009-09-04 08:02:00 +00:00
|
|
|
public function execute() {
|
|
|
|
|
global $args, $options;
|
2018-01-01 13:10:16 +00:00
|
|
|
|
2023-03-14 14:23:19 +00:00
|
|
|
$args = $this->parameters->getArgs();
|
|
|
|
|
$options = $this->parameters->getOptions();
|
2007-12-06 21:07:49 +00:00
|
|
|
}
|
|
|
|
|
}
|
2006-09-28 09:04:39 +00:00
|
|
|
|
2024-08-27 12:00:25 +00:00
|
|
|
// @codeCoverageIgnoreStart
|
2018-01-13 00:02:09 +00:00
|
|
|
$maintClass = CommandLineInc::class;
|
2021-01-08 02:16:02 +00:00
|
|
|
require_once RUN_MAINTENANCE_IF_MAIN;
|
2024-08-27 12:00:25 +00:00
|
|
|
// @codeCoverageIgnoreEnd
|