Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
StartupAsync Class Reference

Startup for async platforms (Swoole, Workerman, Roadrunner, php-pm...) Ubiquity\controllers$StartupAsync This class is part of Ubiquity. More...

+ Inheritance diagram for StartupAsync:

Static Public Member Functions

static forward (string $url, bool $initialize=true, bool $finalize=true)
 Forwards to url.
 
static runAction (array &$u, bool $initialize=true, bool $finalize=true)
 Runs an action on a controller.
 
static getControllerInstance (string $controllerName)
 
static warmupAction (string $controller, string $action='index')
 
static warmupForward (string $url, bool $initialize=true, bool $finalize=true)
 
- Static Public Member Functions inherited from Startup
static run (array &$config)
 Handles the request.
 
static init (array &$config)
 Initialize the app with $config array.
 
static getTemplateEngineInstance ()
 Returns the template engine instance.
 
static startDefaultTemplateEngine ()
 Starts the default Template engine (Twig for Webtools).
 
static runCallable (array &$u)
 Runs a callback.
 
static injectDependencies ($controller)
 Injects the dependencies from the di config key in a controller.
 
static runAsString (array &$u, bool $initialize=true, bool $finalize=true)
 Runs an action on a controller and returns a string.
 
static onError (int $code, ?string $message=null, $controllerInstance=null)
 
static logError (int $code, string $message)
 
static getController ()
 Returns the active controller name.
 
static getControllerSimpleName ()
 Returns the class simple name of the active controller.
 
static getViewNameFileExtension ()
 Returns the extension for view files.
 
static getAction ()
 Returns tha active action.
 
static getActionParams ()
 Returns the active parameters.
 
static getFrameworkDir ()
 Returns the framework directory.
 
static getApplicationDir ()
 Returns the application directory (app directory)
 
static getApplicationName ()
 Returns the application name.
 

Private Attributes

const IS_VALID = 1
 
const INITIALIZE = 2
 
const FINALIZE = 4
 

Static Private Attributes

static $controllers = [ ]
 
static $routes =[]
 

Additional Inherited Members

- Static Public Attributes inherited from Startup
static $urlParts
 
static $templateEngine
 
- Static Protected Member Functions inherited from Startup
static parseUrl (&$url)
 
static _getControllerInstance (string $controllerName)
 
static startTemplateEngine (array &$config)
 
static setMainParams ($controller, $mainParams)
 
- Static Protected Attributes inherited from Startup
static $controller
 
static $action
 
static $actionParams
 

Detailed Description

Startup for async platforms (Swoole, Workerman, Roadrunner, php-pm...) Ubiquity\controllers$StartupAsync This class is part of Ubiquity.

Author
jcheron myadd.nosp@m.ress.nosp@m.mail@.nosp@m.gmai.nosp@m.l.com
Version
1.1.1

Definition at line 16 of file StartupAsync.php.

Member Function Documentation

◆ forward()

static forward ( string  $url,
bool  $initialize = true,
bool  $finalize = true 
)
static

Forwards to url.

Parameters
string$urlThe url to forward to
boolean$initializeIf true, the initialize method of the controller is called
boolean$finalizeIf true, the finalize method of the controller is called

Reimplemented from Startup.

Definition at line 31 of file StartupAsync.php.

◆ getControllerInstance()

static getControllerInstance ( string  $controllerName)
static

Definition at line 113 of file StartupAsync.php.

◆ runAction()

static runAction ( array &  $u,
bool  $initialize = true,
bool  $finalize = true 
)
static

Runs an action on a controller.

Parameters
array$uAn array containing controller, action and parameters
boolean$initializeIf true, the initialize method of the controller is called
boolean$finalizeIf true, the finalize method of the controller is called

Reimplemented from Startup.

Definition at line 64 of file StartupAsync.php.

◆ warmupAction()

static warmupAction ( string  $controller,
string  $action = 'index' 
)
static

Definition at line 117 of file StartupAsync.php.

◆ warmupForward()

static warmupForward ( string  $url,
bool  $initialize = true,
bool  $finalize = true 
)
static

Definition at line 124 of file StartupAsync.php.

Field Documentation

◆ $controllers

$controllers = [ ]
staticprivate

Definition at line 20 of file StartupAsync.php.

◆ $routes

$routes =[]
staticprivate

Definition at line 22 of file StartupAsync.php.

◆ FINALIZE

const FINALIZE = 4
private

Definition at line 19 of file StartupAsync.php.

◆ INITIALIZE

const INITIALIZE = 2
private

Definition at line 18 of file StartupAsync.php.

◆ IS_VALID

const IS_VALID = 1
private

Definition at line 17 of file StartupAsync.php.


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