Page MenuHomeDevCentral

Command.php
No OneTemporary

Command.php

<?php
namespace Nasqueron\SAAS\MediaWiki\Utilities;
abstract class Command {
public const EXIT_SUCCESS = 0;
public const EXIT_FAILURE = 1;
/**
* @var int
*/
protected $argc;
/**
* @var int
*/
protected $argv;
/**
* @var \Nasqueron\SAAS\MediaWiki\Utilities\Display
*/
protected $display;
public function __construct (int $argc, array $argv, Display $display = null) {
$this->argc = $argc;
$this->argv = $argv;
if ($display === null) {
$display = new OutputDisplay();
}
$this->display = $display;
}
public static function run (int $argc, array $argv) : int {
$command = new static($argc, $argv);
return $command->main();
}
public function getCommandName () : string {
return $this->argv[0];
}
///
/// Methods to implement
///
public abstract function main () : int;
}

File Metadata

Mime Type
text/x-php
Expires
Tue, Jun 16, 13:51 (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3798684
Default Alt Text
Command.php (957 B)

Event Timeline