src/Viper/Daemon/Router.php
public static function route(string $command, array $args) : void {
        $object = new static('test');
        echo "\n";
        if (method_exists(static::class, $command)) {
            $response = call_user_func_array([$object, $command], $args);
            if ($response === NULL)
                echo "SUCCESS";
            else if ($response === FALSE)
                echo "FALSE";
            else if ($response === TRUE)
                echo "TRUE";
            else {
                if (is_string($response))
                    echo $response;
                else print_r($response);
            }
        } else echo "No such method available";
        echo "\n\n";
    }
public static function route(string $command, array $args) : void {
        $object = new static('test');
        echo "\n";
        if (method_exists(static::class, $command)) {
            $response = call_user_func_array([$object, $command], $args);
            if ($response === NULL)
                echo "SUCCESS";
            else if ($response === FALSE)
                echo "FALSE";
            else if ($response === TRUE)
                echo "TRUE";
            else {
                if (is_string($response))
                    echo $response;
                else print_r($response);
            }
        } else echo "No such method available";
        echo "\n\n";
    }
public static function route ( string $ command , array $ args ) : void { $ object = new static ( 'test' ) ; echo "\n" ; if ( method_exists ( static :: class , $ command ) ) { $ response = call_user_func_array ( [ $ object , $ command ] , $ args ) ; if ( $ response === NULL ) echo "SUCCESS" ; else if ( $ response === FALSE ) echo "FALSE" ; else if ( $ response === TRUE ) echo "TRUE" ; else { if ( is_string ( $ response ) ) echo $ response ; else print_r ( $ response ) ; } } else echo "No such method available" ; echo "\n\n" ; }
Start a command to services
@param string $command
@param array $args
Start a command to services