Kernel
in package
El corazón de FacturaScripts. Se encarga de gestionar las rutas y ejecutar los controladores.
Table of Contents
- $routes : array<string|int, mixed>
- $routesCallbacks : array<string|int, Closure>
- $timers : array<string|int, mixed>
- addRoute() : void
- addRoutes() : void
- getExecutionTime() : float
- getTimer() : float
- getTimers() : array<string|int, mixed>
- init() : void
- lock() : bool
- rebuildRoutes() : void
- run() : void
- saveRoutes() : bool
- startTimer() : void
- stopTimer() : float
- unlock() : bool
- version() : float
- getErrorHandler() : ErrorControllerInterface
- getRelativeUrl() : string
- loadDefaultRoutes() : void
- loadRoutes() : void
- runController() : void
Properties
$routes
private
static array<string|int, mixed>
$routes
= []
$routesCallbacks
private
static array<string|int, Closure>
$routesCallbacks
= []
$timers
private
static array<string|int, mixed>
$timers
= []
Methods
addRoute()
public
static addRoute(string $route, string $controller, int $position[, string $customId = '' ]) : void
Parameters
- $route : string
- $controller : string
- $position : int
- $customId : string = ''
Return values
void —addRoutes()
public
static addRoutes(Closure $closure) : void
Parameters
- $closure : Closure
Return values
void —getExecutionTime()
public
static getExecutionTime([int $decimals = 5 ]) : float
Parameters
- $decimals : int = 5
Return values
float —getTimer()
public
static getTimer(string $name) : float
Parameters
- $name : string
Return values
float —getTimers()
public
static getTimers() : array<string|int, mixed>
Return values
array<string|int, mixed> —init()
public
static init() : void
Return values
void —lock()
public
static lock(string $processName) : bool
Parameters
- $processName : string
Return values
bool —rebuildRoutes()
public
static rebuildRoutes() : void
Return values
void —run()
public
static run(string $url) : void
Parameters
- $url : string
Return values
void —saveRoutes()
public
static saveRoutes() : bool
Return values
bool —startTimer()
public
static startTimer(string $name) : void
Parameters
- $name : string
Return values
void —stopTimer()
public
static stopTimer(string $name) : float
Parameters
- $name : string
Return values
float —unlock()
public
static unlock(string $processName) : bool
Parameters
- $processName : string
Return values
bool —version()
public
static version() : float
Return values
float —getErrorHandler()
private
static getErrorHandler(Exception $exception) : ErrorControllerInterface
Parameters
- $exception : Exception
Return values
ErrorControllerInterface —getRelativeUrl()
private
static getRelativeUrl(string $url) : string
Parameters
- $url : string
Return values
string —loadDefaultRoutes()
private
static loadDefaultRoutes() : void
Return values
void —loadRoutes()
private
static loadRoutes() : void
Return values
void —runController()
private
static runController(string $url) : void
Parameters
- $url : string