src/classes/Slion/Console.php
public function add(Console\Command $command) {
        $domain = $command->getDomain();
        if (!$domain || isset($this->commands[$domain])) {
            return;
        }
        $this->commands[$domain] = $command;

        $this->buildCommandsIndex($command);
    }
public function add(Console\Command $command) {
        $domain = $command->getDomain();
        if (!$domain || isset($this->commands[$domain])) {
            return;
        }
        $this->commands[$domain] = $command;

        $this->buildCommandsIndex($command);
    }
public function add ( Console \ Command $ command ) { $ domain = $ command -> getDomain ( ) ; if ( ! $ domain || isset ( $ this -> commands [ $ domain ] ) ) { return ; } $ this -> commands [ $ domain ] = $ command ; $ this -> buildCommandsIndex ( $ command ) ; }
添加一个命令。

如果在同一域下重复添加，后者不会生效。

@param \Slion\Console\Command $command
添加一个命令。