src/Vectorface/SnappyRouter/SnappyRouter.php
public function handleRoute($environment = null)
    {
        if (null === $environment) {
            $environment = PHP_SAPI;
        }

        switch ($environment) {
            case 'cli':
            case 'phpdbg':
                $components = empty($_SERVER['argv']) ? array() : $_SERVER['argv'];
                return $this->handleCliRoute($components).PHP_EOL;
            default:
                $queryPos = strpos($_SERVER['REQUEST_URI'], '?');
                $path = (false === $queryPos) ? $_SERVER['REQUEST_URI'] : substr($_SERVER['REQUEST_URI'], 0, $queryPos);
                return $this->handleHttpRoute(
                    $path,
                    $_GET,
                    $_POST,
                    isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET'
                );
        }
    }
public function handleRoute($environment = null)
    {
        if (null === $environment) {
            $environment = PHP_SAPI;
        }

        switch ($environment) {
            case 'cli':
            case 'phpdbg':
                $components = empty($_SERVER['argv']) ? array() : $_SERVER['argv'];
                return $this->handleCliRoute($components).PHP_EOL;
            default:
                $queryPos = strpos($_SERVER['REQUEST_URI'], '?');
                $path = (false === $queryPos) ? $_SERVER['REQUEST_URI'] : substr($_SERVER['REQUEST_URI'], 0, $queryPos);
                return $this->handleHttpRoute(
                    $path,
                    $_GET,
                    $_POST,
                    isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET'
                );
        }
    }
public function handleRoute ( $ environment = null ) { if ( null === $ environment ) { $ environment = PHP_SAPI ; } switch ( $ environment ) { case 'cli' : case 'phpdbg' : $ components = empty ( $ _SERVER [ 'argv' ] ) ? array ( ) : $ _SERVER [ 'argv' ] ; return $ this -> handleCliRoute ( $ components ) . PHP_EOL ; default : $ queryPos = strpos ( $ _SERVER [ 'REQUEST_URI' ] , '?' ) ; $ path = ( false === $ queryPos ) ? $ _SERVER [ 'REQUEST_URI' ] : substr ( $ _SERVER [ 'REQUEST_URI' ] , 0 , $ queryPos ) ; return $ this -> handleHttpRoute ( $ path , $ _GET , $ _POST , isset ( $ _SERVER [ 'REQUEST_METHOD' ] ) ? $ _SERVER [ 'REQUEST_METHOD' ] : 'GET' ) ; } }
Handles the standard route. Determines the execution environment
and makes the appropriate call.
@param string $environment (optional) An optional environment variable, if not
specified, the method will fallback to php_sapi_name().
@return string Returns the encoded response string.
Handles the standard route . Determines the execution environment and makes the appropriate call .