public function getCommand( $args )
    {
        $class = strtoupper( substr( $args[ 1 ], 0, 1 ) ) . substr( $args[ 1 ], 1 );
        $class .= 'Command';

        /** @var Command $command */
        $command = NULL;

        if ( class_exists( $class ) )
        {
            $command = new $class();
        }

        if ( NULL === $command && !empty( $this->namespaces ) )
        {
            foreach ( $this->namespaces as $ns )
            {
                $name = $ns . $class;

                if ( class_exists( $name ) )
                {
                    $command = new $name();
                    $command->init( $args );

                    break;
                }
            }
        }

        if ( NULL !== $command )
        {
            $command->configure();
        }

        return $command;
    }
public function getCommand( $args )
    {
        $class = strtoupper( substr( $args[ 1 ], 0, 1 ) ) . substr( $args[ 1 ], 1 );
        $class .= 'Command';

        /** @var Command $command */
        $command = NULL;

        if ( class_exists( $class ) )
        {
            $command = new $class();
        }

        if ( NULL === $command && !empty( $this->namespaces ) )
        {
            foreach ( $this->namespaces as $ns )
            {
                $name = $ns . $class;

                if ( class_exists( $name ) )
                {
                    $command = new $name();
                    $command->init( $args );

                    break;
                }
            }
        }

        if ( NULL !== $command )
        {
            $command->configure();
        }

        return $command;
    }
public function getCommand ( $ args ) { $ class = strtoupper ( substr ( $ args [ 1 ] , 0 , 1 ) ) . substr ( $ args [ 1 ] , 1 ) ; $ class .= 'Command' ; /** @var Command $command */ $ command = NULL ; if ( class_exists ( $ class ) ) { $ command = new $ class ( ) ; } if ( NULL === $ command && ! empty ( $ this -> namespaces ) ) { foreach ( $ this -> namespaces as $ ns ) { $ name = $ ns . $ class ; if ( class_exists ( $ name ) ) { $ command = new $ name ( ) ; $ command -> init ( $ args ) ; break ; } } } if ( NULL !== $ command ) { $ command -> configure ( ) ; } return $ command ; }
Get the requested command.

@param array  $args              command line arguments

@global array $commandNamespaces command namespaces

@return ICommand the command
Get the requested command .