Overview

Namespaces

  • Coast
    • App
      • Access
      • Executable
    • Controller
    • Csrf
    • Dir
    • Feed
    • File
    • Filter
      • Rule
    • Http
    • Image
    • Model
      • Exception
    • Resolver
    • Router
    • Sitemap
    • Transformer
      • Rule
    • Validator
      • Rule
    • View

Classes

  • Acl
  • App
  • Coast
  • Collection
  • Config
  • Controller
  • Csp
  • Csrf
  • Dir
  • Feed
  • File
  • Filter
  • Http
  • Image
  • Lazy
  • Model
  • Path
  • Request
  • Resolver
  • Response
  • Router
  • Session
  • Sitemap
  • Transformer
  • Url
  • Validator
  • View
  • Xml

Exceptions

  • Exception
  • Overview
  • Namespace
  • Class
  • Deprecated
  • Todo

Class App

Coast application object.

Coast\App implements Coast\App\Executable uses Coast\App\Executable\Implementation
Namespace: Coast
Located at App.php
Methods summary
public
# __construct( mixed $baseDir = null, array $envs = array() )

Construct a new Coast application.

Construct a new Coast application.

Parameters

$baseDir
Base directory.
$envs
Additional environment variables.
public Coast\Dir
# baseDir( $baseDir = null )

Get/set base directory.

Get/set base directory.

Returns

Coast\Dir
public boolean
# isSubapp( $isSubapp = null )

Get/set is subapp.

Get/set is subapp.

Returns

boolean
public Coast\Dir
# dir( $path = null, $create = false )

Get child directory.

Get child directory.

Returns

Coast\Dir
public Coast\File
# file( $path )

Get child file.

Get child file.

Returns

Coast\File
public mixed
# load( mixed $file, array $vars = array() )

Load a file without leaking variables, include app object in vars.

Load a file without leaking variables, include app object in vars.

Parameters

$file
$vars

Returns

mixed
public mixed
# lazy( mixed $source, array $vars = array() )

Lazy load a file without leaking variables, include app object in vars.

Lazy load a file without leaking variables, include app object in vars.

Parameters

$source
$file
$vars

Returns

mixed
public mixed
# env( string $name )

Get environment variables.

Get environment variables.

Parameters

$name

Returns

mixed
public string
# mode( )

Get the mode (HTTP or CLI).

Get the mode (HTTP or CLI).

Returns

string
public boolean
# isHttp( )

Is mode HTTP.

Is mode HTTP.

Returns

boolean
public boolean
# isCli( )

Is mode CLI.

Is mode CLI.

Returns

boolean
public Coast\App|mixed
# param( string $name, mixed $value = null )

Set/get param.

Set/get param.

Parameters

$name
$value

Returns

Coast\App|mixed
public Coast\App|array
# params( array $params = null )

Set/get multiple params.

Set/get multiple params.

Parameters

$params

Returns

Coast\App|array
public Coast\App
# executable( string $executable, Closure|Coast\App\Executable $subpath = null )

Add executable to the stack.

Add executable to the stack.

Parameters

$executable
$name
$subpath
$value

Returns

Coast\App
public
# execute( Coast\Request $req = null, Coast\Response $res = null )

Execute the application, running middleware in order.

Execute the application, running middleware in order.

Parameters

$req
Request object.
$res
Response object.

Implementation of

Coast\App\Executable::execute()
public Coast\App
# failureHandler( Closure $failureHandler )

Set the failure handler

Set the failure handler

Parameters

$failureHandler

Returns

Coast\App
public Coast\App
# errorHandler( Closure $errorHandler )

Set the error handler

Set the error handler

Parameters

$errorHandler

Returns

Coast\App
public Coast\App
# __set( string $name, mixed $value )

Set a parameter.

Set a parameter.

Parameters

$name
$value

Returns

Coast\App
public mixed
# __get( string $name )

Get a parameter.

Get a parameter.

Parameters

$name

Returns

mixed
public boolean
# __isset( string $name )

Check if a parameter exists.

Check if a parameter exists.

Parameters

$name

Returns

boolean
public boolean
# __unset( string $name )

Unset a parameter.

Unset a parameter.

Parameters

$name

Returns

boolean
public
# __call( string $name, array $args )

Attempts to call parameter named $name

Attempts to call parameter named $name

Parameters

$name
$args
Methods inherited from Coast\App\Executable
postExecute(), preExecute()
Methods used from Coast\App\Executable\Implementation
postExecute(), preExecute()
Constants summary
string MODE_CLI
# 'cli'
string MODE_HTTP
# 'http'
Properties summary
protected Coast\Dir $_baseDir

Base directory.

Base directory.

#
protected boolean $_isSubapp

Is subapp.

Is subapp.

# false
protected array $_envs

Environment variables.

Environment variables.

# []
protected array $_params

Parameters.

Parameters.

# []
protected array $_executables

Executables stack.

Executables stack.

# []
protected Closure $_failureHandler

Handler for requests that are not handled by middleware.

Handler for requests that are not handled by middleware.

#
protected Closure $_errorHandler

Handler for errors thrown in middleware.

Handler for errors thrown in middleware.

#
Coast API Documentation API documentation generated by ApiGen