* add wfRunMaintenance() script to simplify maint script writing
[lhc/web/wiklou.git] / maintenance / helloWorld.php
1 <?php
2
3 /**
4 * To the extent possible under law, I, Mark Hershberger, have waived all copyright and
5 * related or neighboring rights to Hello World. This work is published from United States.
6 * @copyright CC0 http://creativecommons.org/publicdomain/zero/1.0/
7 * @author Mark A. Hershberger <mah@everybody.org>
8 * @ingroup Maintenance
9 */
10
11 require_once( dirname( __FILE__ ) . "/Maintenance.php" );
12
13 class CommandLineInstaller extends Maintenance {
14
15 public function __construct() {
16 parent::__construct();
17
18 $this->addOption( 'name', 'Who to say Hello to', false, true);
19 }
20
21 public function execute() {
22 $name = $this->getOption( 'name', 'World' );
23 echo "Hello, $name!\n";
24 }
25 }
26
27 wfRunMaintenance( "CommandLineInstaller" );
28