ClassCollectionLoader

class ClassCollectionLoader

ClassCollectionLoader.

Methods

static load(array $classes, string $cacheDir, string $name, bool $autoReload, bool $adaptive = false, string $extension = '.php')

Loads a list of classes and caches them in one big file.

static string fixNamespaceDeclarations(string $source)

Adds brackets around each namespace if it's not already the case.

static enableTokenizer($bool)

This method is only useful for testing.

Details

static load(array $classes, string $cacheDir, string $name, bool $autoReload, bool $adaptive = false, string $extension = '.php')

Loads a list of classes and caches them in one big file.

Parameters

array $classes An array of classes to load
string $cacheDir A cache directory
string $name The cache name prefix
bool $autoReload Whether to flush the cache when the cache is stale or not
bool $adaptive Whether to remove already declared classes or not
string $extension File extension of the resulting file

Exceptions

InvalidArgumentException When class can't be loaded

static string fixNamespaceDeclarations(string $source)

Adds brackets around each namespace if it's not already the case.

Parameters

string $source Namespace string

Return Value

string Namespaces with brackets

static enableTokenizer($bool)

This method is only useful for testing.

Parameters

$bool

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.1/Symfony/Component/ClassLoader/ClassCollectionLoader.html