Ubiquity  2.5.2
php rapid development framework
Preloader Class Reference

Ubiquity$Preloader This class is part of Ubiquity. More...

+ Inheritance diagram for Preloader:

Public Member Functions

 __construct ($appRoot)
 Creates a new loader instance for this application. More...
 
 paths (string ... $paths)
 Adds paths to be scanned during preloading. More...
 
 exclude (string ... $names)
 Adds namespaces to exclude from preloading. More...
 
 addClass (string $class)
 Adds a class to preload. More...
 
 addClasses (array $classes)
 Adds an array of classes to preload. More...
 
 load ()
 Preload all added classes. More...
 
 generateClassesFiles ()
 Returns a generated associative array of classes to preload (key: class, value: file). More...
 
 generateToFile (string $filename, ?bool $preserve=true)
 Generate a file containing the associative array of classes to preload (classes-files=>[key: class, value: file}). More...
 
 addDir (string $dirname)
 Adds a directory to be scanned during preloading. More...
 
 addLibraryPart (string $library, ?string $part='')
 Adds a part of an existing library to be preloaded. More...
 
 addUbiquityControllers ()
 Adds Ubiquity framework controller and routing classes preload. More...
 
 addUbiquityCache ()
 Adds Ubiquity framework cache system classes to preload. More...
 
 addUbiquityPdo ()
 Adds Ubiquity framework PDO classes to preload. More...
 
 addUbiquityORM ()
 Adds Ubiquity framework ORM classes to preload. More...
 
 addUbiquityHttpUtils ()
 Adds Ubiquity framework Http classes to preload. More...
 
 addUbiquityViews ()
 Adds Ubiquity framework MicroTemplateEngine classes to preload. More...
 
 addUbiquityTranslations ()
 Adds Ubiquity framework Translations classes to preload. More...
 
 addUbiquityWorkerman ()
 Adds Ubiquity-workerman classes to preload. More...
 
 addUbiquitySwoole ()
 Adds Ubiquity-swoole classes to preload. More...
 
 addApplicationPart (?string $part='')
 Adds classes from an application part (app folder) to preload. More...
 
 addApplicationModels ($dir='models')
 
 addApplicationCache ($dir='cache')
 
 addApplicationControllers ($dir='controllers')
 
 addUbiquityBasics ($hasDatabase=true)
 Add Ubiquity hot classes for preloading. More...
 
 addUbiquityTwig ()
 Adds Twig templating system classes to preload. More...
 
 generateClassesFromRunning ($resetExisting=true)
 Generates a preload classes-files array from cached files. More...
 

Static Public Member Functions

static fromFile (string $appRoot, string $filename)
 Defines classes to be preloaded in a file returning an associative array keys : (classes-files, excludeds, paths, classes, libraries-parts, callback). More...
 
static fromArray (string $appRoot, array $array)
 Defines classes to be preloaded with an associative array keys : (classes-files, excludeds, paths, classes, libraries-parts, callback). More...
 
static getLibraries ()
 Returns an array of available libraries to be preloaded. More...
 

Detailed Description

Ubiquity$Preloader This class is part of Ubiquity.

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

Definition at line 15 of file Preloader.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $appRoot)

Creates a new loader instance for this application.

Parameters
string$appRootThe app root

Definition at line 22 of file Preloader.php.

Member Function Documentation

◆ addApplicationCache()

addApplicationCache (   $dir = 'cache')
Parameters
string$dir
Returns

Definition at line 287 of file Preloader.php.

◆ addApplicationControllers()

addApplicationControllers (   $dir = 'controllers')
Parameters
string$dir
Returns

Definition at line 297 of file Preloader.php.

◆ addApplicationModels()

addApplicationModels (   $dir = 'models')
Parameters
string$dir
Returns

Definition at line 277 of file Preloader.php.

◆ addApplicationPart()

addApplicationPart ( ?string  $part = '')

Adds classes from an application part (app folder) to preload.

Parameters
string$part
Returns

Definition at line 267 of file Preloader.php.

◆ addClass()

addClass ( string  $class)

Adds a class to preload.

Parameters
string$class
Returns
bool

Definition at line 57 of file Preloader.php.

◆ addClasses()

addClasses ( array  $classes)

Adds an array of classes to preload.

Parameters
array$classes

Definition at line 75 of file Preloader.php.

◆ addDir()

addDir ( string  $dirname)

Adds a directory to be scanned during preloading.

Parameters
string$dirname
Returns

Definition at line 130 of file Preloader.php.

◆ addLibraryPart()

addLibraryPart ( string  $library,
?string  $part = '' 
)

Adds a part of an existing library to be preloaded.

The available libraries can be obtained with the getLibraries method.

Parameters
string$library
?string$part
Returns
bool

Definition at line 149 of file Preloader.php.

◆ addUbiquityBasics()

addUbiquityBasics (   $hasDatabase = true)

Add Ubiquity hot classes for preloading.

Parameters
boolean$hasDatabase
Returns

Definition at line 309 of file Preloader.php.

◆ addUbiquityCache()

addUbiquityCache ( )

Adds Ubiquity framework cache system classes to preload.

Returns

Definition at line 178 of file Preloader.php.

◆ addUbiquityControllers()

addUbiquityControllers ( )

Adds Ubiquity framework controller and routing classes preload.

Returns

Definition at line 165 of file Preloader.php.

◆ addUbiquityHttpUtils()

addUbiquityHttpUtils ( )

Adds Ubiquity framework Http classes to preload.

Returns

Definition at line 213 of file Preloader.php.

◆ addUbiquityORM()

addUbiquityORM ( )

Adds Ubiquity framework ORM classes to preload.

Returns

Definition at line 202 of file Preloader.php.

◆ addUbiquityPdo()

addUbiquityPdo ( )

Adds Ubiquity framework PDO classes to preload.

Returns

Definition at line 189 of file Preloader.php.

◆ addUbiquitySwoole()

addUbiquitySwoole ( )

Adds Ubiquity-swoole classes to preload.

Returns

Definition at line 256 of file Preloader.php.

◆ addUbiquityTranslations()

addUbiquityTranslations ( )

Adds Ubiquity framework Translations classes to preload.

Returns

Definition at line 236 of file Preloader.php.

◆ addUbiquityTwig()

addUbiquityTwig ( )

Adds Twig templating system classes to preload.

Returns

Definition at line 325 of file Preloader.php.

◆ addUbiquityViews()

addUbiquityViews ( )

Adds Ubiquity framework MicroTemplateEngine classes to preload.

Returns

Definition at line 225 of file Preloader.php.

◆ addUbiquityWorkerman()

addUbiquityWorkerman ( )

Adds Ubiquity-workerman classes to preload.

Returns

Definition at line 246 of file Preloader.php.

◆ exclude()

exclude ( string ...  $names)

Adds namespaces to exclude from preloading.

Parameters
string...$names
Returns
Preloader

Definition at line 46 of file Preloader.php.

◆ fromArray()

static fromArray ( string  $appRoot,
array  $array 
)
static

Defines classes to be preloaded with an associative array keys : (classes-files, excludeds, paths, classes, libraries-parts, callback).

Parameters
string$appRoot
array$array
Returns
bool

Definition at line 352 of file Preloader.php.

◆ fromFile()

static fromFile ( string  $appRoot,
string  $filename 
)
static

Defines classes to be preloaded in a file returning an associative array keys : (classes-files, excludeds, paths, classes, libraries-parts, callback).

Parameters
string$appRoot
string$filename
Returns
bool

Definition at line 337 of file Preloader.php.

◆ generateClassesFiles()

generateClassesFiles ( )

Returns a generated associative array of classes to preload (key: class, value: file).

Returns
array

Definition at line 97 of file Preloader.php.

◆ generateClassesFromRunning()

generateClassesFromRunning (   $resetExisting = true)

Generates a preload classes-files array from cached files.

Parameters
boolean$resetExisting

Definition at line 393 of file Preloader.php.

◆ generateToFile()

generateToFile ( string  $filename,
?bool  $preserve = true 
)

Generate a file containing the associative array of classes to preload (classes-files=>[key: class, value: file}).

Parameters
string$filename
?bool$preserve
Returns
int

Definition at line 114 of file Preloader.php.

◆ getLibraries()

static getLibraries ( )
static

Returns an array of available libraries to be preloaded.

Returns
array

Definition at line 412 of file Preloader.php.

◆ load()

load ( )

Preload all added classes.

Definition at line 84 of file Preloader.php.

◆ paths()

paths ( string ...  $paths)

Adds paths to be scanned during preloading.

Parameters
string...$paths
Returns
Preloader

Definition at line 33 of file Preloader.php.


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