PHP Class Airship\Engine\AutoPilot

RESTful Routing for the Airship
Inheritance: implements Airship\Engine\Contract\RouterInterface
Show file Open project: paragonie/airship

Public Properties

Property Type Description
$active_cabin string
$cabinIndex string
$mypath Current request path
$path string
$patternPrefix string

Protected Properties

Property Type Description
$CSPBuilder ParagonIE\CSPBuilder\CSPBuilder
$cabin array
$databases Database[]
$lens Lens

Public Methods

Method Description
__construct ( array $cabin = [], Lens $lens = null, array $databases = [] ) AutoPilot constructor.
isActiveCabinKey ( string $cabinKey = '*', boolean $https_only = false, string $scheme = '', string $activeHost = '', string $uri = '' ) : boolean Does a given cabin key match the current HTTP host, port, and path?
isHTTPSConnection ( string $scheme = '' ) : boolean Is this user currently connected over HTTPS?
makePath ( string $string ) : string Replace {token}s with their regex stand-ins.
route ( ) Actually serve the HTTP request
setActiveCabin ( array $cabin, string $prefix ) Set the active cabin
testCabinForUrl ( string $url ) : string Which Cabin does this URL belong to?
testLanding ( string $path, string $uri, array &$args = [], boolean $needsPrep = false ) : boolean Test a path against a URI

Protected Methods

Method Description
forceHTTPS ( string $scheme = '' ) : boolean Do not allow insecure HTTP request to proceed
loadInjectedRoutes ( ) : self See Gadgets::injectRoutes()
serve ( array $route, array $args = [] ) : mixed Actually serve the routes. Called by route() above.
serveFallback ( ) : mixed This serves the fallback route, if it's defined.

Method Details

__construct() public method

AutoPilot constructor.
public __construct ( array $cabin = [], Lens $lens = null, array $databases = [] )
$cabin array
$lens Lens (optional)
$databases array (optional)

forceHTTPS() protected static method

Do not allow insecure HTTP request to proceed
protected static forceHTTPS ( string $scheme = '' ) : boolean
$scheme string
return boolean

isActiveCabinKey() public static method

Does a given cabin key match the current HTTP host, port, and path?
public static isActiveCabinKey ( string $cabinKey = '*', boolean $https_only = false, string $scheme = '', string $activeHost = '', string $uri = '' ) : boolean
$cabinKey string
$https_only boolean
$scheme string
$activeHost string
$uri string
return boolean

isHTTPSConnection() public static method

Is this user currently connected over HTTPS?
public static isHTTPSConnection ( string $scheme = '' ) : boolean
$scheme string
return boolean

loadInjectedRoutes() protected method

This loads all of the routes injected by the Gadgets into the current Cabin
protected loadInjectedRoutes ( ) : self
return self

makePath() public static method

Replace {token}s with their regex stand-ins.
public static makePath ( string $string ) : string
$string string
return string

route() public method

Actually serve the HTTP request
public route ( )

serve() protected method

Actually serve the routes. Called by route() above.
protected serve ( array $route, array $args = [] ) : mixed
$route array
$args array
return mixed

serveFallback() protected method

The fallback route handles: - Custom pages (if any exist), or - Redirects
protected serveFallback ( ) : mixed
return mixed

setActiveCabin() public method

Set the active cabin
public setActiveCabin ( array $cabin, string $prefix )
$cabin array
$prefix string

testCabinForUrl() public method

Which Cabin does this URL belong to?
public testCabinForUrl ( string $url ) : string
$url string
return string

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

Property Details

$CSPBuilder protected property

protected CSPBuilder,ParagonIE\CSPBuilder $CSPBuilder
return ParagonIE\CSPBuilder\CSPBuilder

$active_cabin public static property

public static string $active_cabin
return string

$cabin protected property

protected array $cabin
return array

$cabinIndex public static property

public static string $cabinIndex
return string

$databases protected property

protected Database[],Airship\Engine $databases
return Database[]

$lens protected property

protected Lens,Airship\Engine $lens
return Lens

$mypath public static property

Current request path
public static $mypath

$path public static property

public static string $path
return string

$patternPrefix public static property

public static string $patternPrefix
return string