Airship\Engine\AutoPilot::testLanding PHP Method

testLanding() public static method

Test a path against a URI
public static testLanding ( string $path, string $uri, array &$args = [], boolean $needsPrep = false ) : boolean
$path string
$uri string
$args array
$needsPrep boolean
return boolean
    public static function testLanding(string $path, string $uri, array &$args = [], bool $needsPrep = false) : bool
    {
        if ($needsPrep) {
            $path = self::makePath($path);
            $prefix = '';
        } else {
            $prefix = self::$patternPrefix;
        }
        if ($path === '') {
            return \preg_match('#^/?' . $prefix . '/?$#', $uri, $args) > 0;
        }
        return \preg_match('#^/?' . $prefix . '/' . $path . '#', $uri, $args) > 0;
    }