Home  Support  API

SiteApplication Class Reference
[Web]


Application infrastructure initializer.

Grabs the standart incoming request, wraps it with appropriate objects, and handles the request by passing those objects to the corresponding route.

Consider index.php example:

 $app = new SiteApplication(new ChainedRouter);
 $app->run();

The best practise is to implement your own SiteApplication class by extending this one

Definition at line 35 of file SiteApplication.class.php.

List of all members.

Public Member Functions

 __construct (IRouter $router)
 getRouter ()
 Gets the application router.
 getWebContext ()
 Gets the WebContext.
 run ()
 Runs the application.

Protected Member Functions

 handle404 (Trace $trace)
 Handles the situation when the application failed to found the corresponding route.
 handle500 (Exception $e, Trace $trace=null)
 The failover stub.
 notify500 ($email, Exception $e)
 Notify about the fault.

Constructor & Destructor Documentation

SiteApplication::__construct ( IRouter router  ) 
Parameters:
IRouter router to use when handling the request. See ChainedRouter as basic impl.

Definition at line 50 of file SiteApplication.class.php.


Member Function Documentation

SiteApplication::getRouter (  ) 

Gets the application router.

Returns:
IRouter

Definition at line 79 of file SiteApplication.class.php.

SiteApplication::getWebContext (  ) 

Gets the WebContext.

Returns:
WebContext

Definition at line 69 of file SiteApplication.class.php.

SiteApplication::handle404 ( Trace trace  )  [protected]

Handles the situation when the application failed to found the corresponding route.

Exceptions:
Exception in case of application fault
Parameters:
Trace $trace trace failed to be handled
Returns:
void

Definition at line 116 of file SiteApplication.class.php.

References HttpStatus::CODE_404.

SiteApplication::handle500 ( Exception $  e,
Trace trace = null 
) [protected]

The failover stub.

Handles the application fault

Parameters:
Exception $e uncaught exception that caused fault
Trace $trace handled trace that caused an exception, if built.
Returns:
void

Definition at line 130 of file SiteApplication.class.php.

References HttpStatus::CODE_500, and notify500().

Referenced by run().

SiteApplication::notify500 ( email,
Exception $  e 
) [protected]

Notify about the fault.

Parameters:
string $email address to be notified about the fault
Exception $e uncaught exception that caused application fault
Returns:
void

Definition at line 160 of file SiteApplication.class.php.

Referenced by handle500().

SiteApplication::run (  ) 

Runs the application.

Returns:
void

Definition at line 89 of file SiteApplication.class.php.

References handle500().


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