Preloader class
Framework\Autoload\Preloader
Class Preloader.
Defined in libraries/autoload/src/Preloader.php
Properties #
- $packagesDir
- The main 'webisters' packages directory.
- $loadPackages
- -
- $loadDevPackages
- -
- $autoloader
- The Autoloader instance necessary to autoload required classes.
- $locator
- The Locator instance used to list files.
$packagesDir
protected string $packagesDir
The main 'webisters' packages directory.
$loadPackages
protected bool $loadPackages = true
$loadDevPackages
protected bool $loadDevPackages = false
$autoloader
protected \Framework\Autoload\Autoloader $autoloader
The Autoloader instance necessary to autoload required classes.
$locator
protected \Framework\Autoload\Locator $locator
The Locator instance used to list files.
Methods #
- __construct()
- Preloader constructor.
- getAllDeclarations()
- Get a list of all declared classes, interfaces and traits.
- getAutoloader()
- -
- getDeclarations()
- Get a list of Framework declarations.
- getIncludedFiles()
- Get a list of all included/required files.
- getLocator()
- -
- getPackagesDir()
- -
- listFiles()
- -
- listPackagesFiles()
- -
- load()
- Load files to be seen by the PHP OPcache Preloading when the engine starts.
- setPackagesDir()
- -
- withDevPackages()
- -
- withPackages()
- -
- isDevelopmentClass()
- -
__construct()
public function __construct(?\Framework\Autoload\Autoloader $autoloader = NULL, ?string $packagesDir = 'D:\\WEBISTERS\\libraries\\autoload\\src/../../')
Preloader constructor.
Parameters
- ?\Framework\Autoload\Autoloader $autoloader - A custom Autoloader instance or null to auto initialize a new
- ?string $packagesDir - The main 'webisters' packages directory or null to disable packages loading
getAllDeclarations()
public static function getAllDeclarations(): array
Get a list of all declared classes, interfaces and traits.
Returns
array
getAutoloader()
public function getAutoloader(): \Framework\Autoload\Autoloader
Returns
\Framework\Autoload\Autoloader
getDeclarations()
public static function getDeclarations(): array
Get a list of Framework declarations.
Returns
array
getIncludedFiles()
public static function getIncludedFiles(): array
Get a list of all included/required files.
Returns
array
getLocator()
public function getLocator(): \Framework\Autoload\Locator
Returns
\Framework\Autoload\Locator
getPackagesDir()
public function getPackagesDir(): string
Returns
string
listFiles()
public function listFiles(bool $setClasses = true): array
Parameters
- bool $setClasses
Returns
array
listPackagesFiles()
public function listPackagesFiles(bool $setClasses = true): array
Parameters
- bool $setClasses
Returns
array
load()
public function load(): array
Load files to be seen by the PHP OPcache Preloading when the engine starts.
Returns
array
- The loaded files
setPackagesDir()
public function setPackagesDir(string $packagesDir): static
Parameters
- string $packagesDir
Returns
static
withDevPackages()
public function withDevPackages(): static
Returns
static
withPackages()
public function withPackages(): static
Returns
static
isDevelopmentClass()
protected function isDevelopmentClass(string $className): bool
Parameters
- string $className
Returns
bool