Docs

Application Class


Definition

Namespace: DafCore
Phar: DafCore.phar
Using: RouterMapMethods

Constructor

new Application(bool $isRelease)
  • bool $isRelease - true for release mode, on release mode true the app will load from phar files.

Properties

static string $BaseFolder - Hold the app base folder.
Router $Router - Hold the app router class.
IServicesProvidor $Services - Hold the app IServicesProvidor class.

Methods

function Run() : void
Start the pipline.
function ShowTimePerformance() : string
Display in the end of the content the seconds take to compleate current response.
function AddGlobalMiddleware() : void
Gets callback function to add to the pipline.
in the callback function Prameters section you can get any dependency that avaible in the DI Container right now. global dependency list
function AddAntiForgeryToken() : void
Add the AntiForgery :class to the DI Container.
Register AntiForgery token to the sesson before app Render. global dependency list
function HostName() : string
Returns the current request host name.

This value is taken from the HTTP_HOST server variable and represents
the domain name (and optional port) used by the client to access
the application (e.g. "example.com" or "example.com:8080").
function IsHttps() : bool
Determines whether the current request is using HTTPS.

Checks the HTTPS server variable and returns true if the request
was made over a secure SSL/TLS connection.