SlaxWeb Framework
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Protected Member Functions | List of all members
SlaxWeb\Bootstrap\Application Class Reference
Inheritance diagram for SlaxWeb\Bootstrap\Application:
Inheritance graph
[legend]
Collaboration diagram for SlaxWeb\Bootstrap\Application:
Collaboration graph
[legend]

Public Member Functions

 __construct (string $pubDir, string $appDir)
 
 init ()
 
 run (Request $request, Response $response)
 

Protected Member Functions

 loadResources ()
 
 loadConfig (string $dir, bool $prepend=true)
 
 prepRequestData ()
 
 setRequestProperties (Request $request)
 
 load404Page ()
 

Constructor & Destructor Documentation

SlaxWeb\Bootstrap\Application::__construct ( string  $pubDir,
string  $appDir 
)

Constructor

Sets application properties. Retrieves the public directory and application directiories as input.

Parameters
string$pubDirPublic directory path
string$appDirApplication directory path

Member Function Documentation

SlaxWeb\Bootstrap\Application::init ( )

Application Initialization

Initialize the Application class by loading providers and routesfrom their respective locations.

Returns
void
SlaxWeb\Bootstrap\Application::load404Page ( )
protected

Load Route Not Found Page

Loads the 404 page and returns its contents.

Returns
string
SlaxWeb\Bootstrap\Application::loadConfig ( string  $dir,
bool  $prepend = true 
)
protected

Load configuration files

Scan the configuration resource location directory and load all found PHP files with the Config component, recursively.

Parameters
string$dirDirectory from which the configuration files are loaded
bool$prependShould configuration item names be prependedi with the names of configuration file names
Returns
void
SlaxWeb\Bootstrap\Application::loadResources ( )
protected

Load resources

Load the resource class names from the configuration, and register them with the service provider.

Returns
void
SlaxWeb\Bootstrap\Application::prepRequestData ( )
protected

Prepare request data

Prepares the request URL if the config has a predefined base url set. If this is not set, then the request data is not set, and the Request class will do its best to guess its data. If the base url is set, then the HTTP method and the request URI have to be read from the $_SERVER superglobal.

Returns
void
SlaxWeb\Bootstrap\Application::run ( Request  $request,
Response  $response 
)

Execute Application

Take a Request and Resonse, and dispatch them with the help of the Route Dispatcher.

Parameters
\SlaxWeb\Route\Request$requestReceived Request
Symfony Prepared Response
Returns
void
SlaxWeb\Bootstrap\Application::setRequestProperties ( Request  $request)
protected

Set application properties

Sets some basic request properties for the application.

Parameters
\SlaxWeb\Route\Request$requestReceived Request
Returns
void

The documentation for this class was generated from the following file: