src/Vectorface/SnappyRouter/Handler/JsonRpcHandler.php
private function getServiceFromPath($path)
    {
        /* Ensure the path is in a standard form, removing empty elements. */
        $path = implode('/', array_filter(array_map('trim', explode('/', $path)), 'strlen'));

        /* If using the basePath option, strip the basePath. Otherwise, the path becomes the basename of the URI. */
        if (isset($this->options[self::KEY_BASE_PATH])) {
            $basePathPosition = strpos($path, $this->options[self::KEY_BASE_PATH]);
            if (false !== $basePathPosition) {
                $path = substr($path, $basePathPosition + strlen($this->options[self::KEY_BASE_PATH]));
            }

            return trim(dirname($path), "/") . '/' .  basename($path, '.php'); /* For example, x/y/z/FooService */
        } else {
            return basename($path, '.php'); /* For example: FooService, from /x/y/z/FooService.php */
        }
    }
private function getServiceFromPath($path)
    {
        /* Ensure the path is in a standard form, removing empty elements. */
        $path = implode('/', array_filter(array_map('trim', explode('/', $path)), 'strlen'));

        /* If using the basePath option, strip the basePath. Otherwise, the path becomes the basename of the URI. */
        if (isset($this->options[self::KEY_BASE_PATH])) {
            $basePathPosition = strpos($path, $this->options[self::KEY_BASE_PATH]);
            if (false !== $basePathPosition) {
                $path = substr($path, $basePathPosition + strlen($this->options[self::KEY_BASE_PATH]));
            }

            return trim(dirname($path), "/") . '/' .  basename($path, '.php'); /* For example, x/y/z/FooService */
        } else {
            return basename($path, '.php'); /* For example: FooService, from /x/y/z/FooService.php */
        }
    }
private function getServiceFromPath ( $ path ) { /* Ensure the path is in a standard form, removing empty elements. */ $ path = implode ( '/' , array_filter ( array_map ( 'trim' , explode ( '/' , $ path ) ) , 'strlen' ) ) ; /* If using the basePath option, strip the basePath. Otherwise, the path becomes the basename of the URI. */ if ( isset ( $ this -> options [ self :: KEY_BASE_PATH ] ) ) { $ basePathPosition = strpos ( $ path , $ this -> options [ self :: KEY_BASE_PATH ] ) ; if ( false !== $ basePathPosition ) { $ path = substr ( $ path , $ basePathPosition + strlen ( $ this -> options [ self :: KEY_BASE_PATH ] ) ) ; } return trim ( dirname ( $ path ) , "/" ) . '/' . basename ( $ path , '.php' ) ; /* For example, x/y/z/FooService */ } else { return basename ( $ path , '.php' ) ; /* For example: FooService, from /x/y/z/FooService.php */ } }
Determine the service to load via the ServiceProvider based on path

@param string $path The raw path (URI) used to determine the service.
@return string The name of the service that we should attempt to load.
Determine the service to load via the ServiceProvider based on path