ClassCollectionLoader deprecated

class ClassCollectionLoader

deprecated

since version 3.3, to be removed in 4.0.

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 array inline(array $classes, string $cache, array $excluded)

Generates a file where classes and their parents are inlined.

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 array inline(array $classes, string $cache, array $excluded)

Generates a file where classes and their parents are inlined.

Parameters

array $classes An array of classes to load
string $cache The file where classes are inlined
array $excluded An array of classes that won't be inlined

Return Value

array The source map of inlined classes, with classes as keys and files as values

Exceptions

RuntimeException 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/4.0/Symfony/Component/ClassLoader/ClassCollectionLoader.html