public static function getEngine(&$class)
    {
        $engine = null;

        if (($pos = strpos($class, '://')) !== false) {
            $proto = substr($class, 0, $pos);

            switch ($proto) {
                case 'file':
                    $class  = substr($class, $pos + 3);
                    $engine = self::getEngineByFile($class);
                    break;

                case 'http':
                case 'https':
                    $engine = Resolver\HttpUrl::class;
                    break;

                default:
                    $class  = substr($class, $pos + 3);
                    $engine = self::getEngineByProto($proto);
            }
        } elseif (is_file($class)) {
            $engine = self::getEngineByFile($class);
        } elseif (class_exists($class)) {
            $engine = PhpClass::class;
        }

        if ($engine === null) {
            $engine = PhpClass::class;
        }

        return $engine;
    }
public static function getEngine(&$class)
    {
        $engine = null;

        if (($pos = strpos($class, '://')) !== false) {
            $proto = substr($class, 0, $pos);

            switch ($proto) {
                case 'file':
                    $class  = substr($class, $pos + 3);
                    $engine = self::getEngineByFile($class);
                    break;

                case 'http':
                case 'https':
                    $engine = Resolver\HttpUrl::class;
                    break;

                default:
                    $class  = substr($class, $pos + 3);
                    $engine = self::getEngineByProto($proto);
            }
        } elseif (is_file($class)) {
            $engine = self::getEngineByFile($class);
        } elseif (class_exists($class)) {
            $engine = PhpClass::class;
        }

        if ($engine === null) {
            $engine = PhpClass::class;
        }

        return $engine;
    }
public static function getEngine ( & $ class ) { $ engine = null ; if ( ( $ pos = strpos ( $ class , '://' ) ) !== false ) { $ proto = substr ( $ class , 0 , $ pos ) ; switch ( $ proto ) { case 'file' : $ class = substr ( $ class , $ pos + 3 ) ; $ engine = self :: getEngineByFile ( $ class ) ; break ; case 'http' : case 'https' : $ engine = Resolver \ HttpUrl :: class ; break ; default : $ class = substr ( $ class , $ pos + 3 ) ; $ engine = self :: getEngineByProto ( $ proto ) ; } } elseif ( is_file ( $ class ) ) { $ engine = self :: getEngineByFile ( $ class ) ; } elseif ( class_exists ( $ class ) ) { $ engine = PhpClass :: class ; } if ( $ engine === null ) { $ engine = PhpClass :: class ; } return $ engine ; }
This method determines the fitting engine for the provided string. The
provided string gets modified in case it has the uri format

@param string $class
@return string
This method determines the fitting engine for the provided string . The provided string gets modified in case it has the uri format