mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 23:42:48 +08:00
35 lines
674 B
PHP
35 lines
674 B
PHP
<?php
|
|
|
|
namespace base\common\console;
|
|
|
|
use think\console\Input;
|
|
|
|
class InputBase extends Input
|
|
{
|
|
public function __construct($argv = null)
|
|
{
|
|
if (null === $argv) {
|
|
$argv = $_SERVER['argv'];
|
|
array_shift($argv);
|
|
}
|
|
|
|
$argv = $this->normalizeTokens($argv);
|
|
|
|
parent::__construct($argv);
|
|
}
|
|
|
|
protected function normalizeTokens(array $tokens): array
|
|
{
|
|
$result = [];
|
|
foreach ($tokens as $token) {
|
|
if ($token === '-ff') {
|
|
$result[] = '--force-force';
|
|
continue;
|
|
}
|
|
$result[] = $token;
|
|
}
|
|
|
|
return $result;
|
|
}
|
|
}
|