Aplus Framework Docs

Preloader
in package

Class Preloader.

Tags
see
https://www.php.net/manual/en/opcache.preloading.php

Table of Contents

$autoloader  : Autoloader
The Autoloader instance necessary to autoload required classes.
$loadDevPackages  : bool
$loadPackages  : bool
$locator  : Locator
The Locator instance used to list files.
$packagesDir  : string
The main 'aplus' packages directory.
__construct()  : mixed
Preloader constructor.
getAllDeclarations()  : array<int, string>
Get a list of all declared classes, interfaces and traits.
getAutoloader()  : Autoloader
getDeclarations()  : array<int, string>
Get a list of Framework declarations.
getIncludedFiles()  : array<int, string>
Get a list of all included/required files.
getLocator()  : Locator
getPackagesDir()  : string
listFiles()  : array<int, string>
listPackagesFiles()  : array<int, string>
load()  : array<int, string>
Load files to be seen by the PHP OPcache Preloading when the engine starts.
setPackagesDir()  : static
withDevPackages()  : static
withPackages()  : static
isDevelopmentClass()  : bool

Properties

$autoloader

The Autoloader instance necessary to autoload required classes.

protected Autoloader $autoloader

$loadDevPackages

protected bool $loadDevPackages = false

$loadPackages

protected bool $loadPackages = true

$packagesDir

The main 'aplus' packages directory.

protected string $packagesDir

Methods

__construct()

Preloader constructor.

public __construct([Autoloader|null $autoloader = null ][, string|null $packagesDir = __DIR__ . '/../../' ]) : mixed
Parameters
$autoloader : Autoloader|null = null

A custom Autoloader instance or null to auto initialize a new

$packagesDir : string|null = __DIR__ . '/../../'

The main 'aplus' packages directory or null to disable packages loading

Return values
mixed

getAllDeclarations()

Get a list of all declared classes, interfaces and traits.

public static getAllDeclarations() : array<int, string>
Return values
array<int, string>

getDeclarations()

Get a list of Framework declarations.

public static getDeclarations() : array<int, string>
Return values
array<int, string>

getIncludedFiles()

Get a list of all included/required files.

public static getIncludedFiles() : array<int, string>
Return values
array<int, string>

getPackagesDir()

public getPackagesDir() : string
Return values
string

listFiles()

public listFiles([bool $setClasses = true ]) : array<int, string>
Parameters
$setClasses : bool = true
Return values
array<int, string>

listPackagesFiles()

public listPackagesFiles([bool $setClasses = true ]) : array<int, string>
Parameters
$setClasses : bool = true
Return values
array<int, string>

load()

Load files to be seen by the PHP OPcache Preloading when the engine starts.

public load() : array<int, string>
Return values
array<int, string>

The loaded files

setPackagesDir()

public setPackagesDir(string $packagesDir) : static
Parameters
$packagesDir : string
Return values
static

withDevPackages()

public withDevPackages() : static
Return values
static

withPackages()

public withPackages() : static
Return values
static

isDevelopmentClass()

protected isDevelopmentClass(string $className) : bool
Parameters
$className : string
Return values
bool

Search results