public function set($route = null)
    {
        if (!isset($route)) {

            $routes = $this->getList();
            $command = array_shift($this->params);

            if (isset($this->aliases[$command])) {
                $command = $this->aliases[$command];
            }

            if (empty($routes[$command])) {
                $command = 'help';
                $this->params = array();
            }

            if (empty($routes[$command])) {
                throw new OutOfBoundsException('Unknown command');
            }

            if (isset($routes[$command]['status']) && empty($routes[$command]['status'])) {
                throw new OutOfBoundsException('Disabled command');
            }

            $route = $routes[$command];
            $route['command'] = $command;
            $route['params'] = $this->params;
        }

        $this->route = (array) $route;
        return $this;
    }
public function set($route = null)
    {
        if (!isset($route)) {

            $routes = $this->getList();
            $command = array_shift($this->params);

            if (isset($this->aliases[$command])) {
                $command = $this->aliases[$command];
            }

            if (empty($routes[$command])) {
                $command = 'help';
                $this->params = array();
            }

            if (empty($routes[$command])) {
                throw new OutOfBoundsException('Unknown command');
            }

            if (isset($routes[$command]['status']) && empty($routes[$command]['status'])) {
                throw new OutOfBoundsException('Disabled command');
            }

            $route = $routes[$command];
            $route['command'] = $command;
            $route['params'] = $this->params;
        }

        $this->route = (array) $route;
        return $this;
    }
public function set ( $ route = null ) { if ( ! isset ( $ route ) ) { $ routes = $ this -> getList ( ) ; $ command = array_shift ( $ this -> params ) ; if ( isset ( $ this -> aliases [ $ command ] ) ) { $ command = $ this -> aliases [ $ command ] ; } if ( empty ( $ routes [ $ command ] ) ) { $ command = 'help' ; $ this -> params = array ( ) ; } if ( empty ( $ routes [ $ command ] ) ) { throw new OutOfBoundsException ( 'Unknown command' ) ; } if ( isset ( $ routes [ $ command ] [ 'status' ] ) && empty ( $ routes [ $ command ] [ 'status' ] ) ) { throw new OutOfBoundsException ( 'Disabled command' ) ; } $ route = $ routes [ $ command ] ; $ route [ 'command' ] = $ command ; $ route [ 'params' ] = $ this -> params ; } $ this -> route = ( array ) $ route ; return $ this ; }
Sets the current route
@param array|null $route
@return $this
@throws OutOfBoundsException
Sets the current route