PHP Класс Symfony\Component\ClassLoader\ClassCollectionLoader

Автор: Fabien Potencier ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
enableTokenizer ( $bool ) This method is only useful for testing.
fixNamespaceDeclarations ( string $source ) : string Adds brackets around each namespace if it's not already the case.
inline ( array $classes, string $cache, array $excluded ) : array Generates a file where classes and their parents are inlined.
load ( array $classes, string $cacheDir, string $name, boolean $autoReload, boolean $adaptive = false, string $extension = '.php' ) Loads a list of classes and caches them in one big file.

Приватные методы

Метод Описание
compressCode ( string $code ) : string Strips leading & trailing ws, multiple EOL, multiple ws.
computeTraitDeps ( ReflectionClass $class )
getClassHierarchy ( ReflectionClass $class )
getInterfaces ( ReflectionClass $class )
getOrderedClasses ( array $classes ) : ReflectionClass[] Gets an ordered array of passed classes including all their dependencies.
resolveDependencies ( array $tree, ReflectionClass $node, ArrayObject $resolved = null, ArrayObject $unresolved = null ) : ArrayObject Dependencies resolution.
writeCacheFile ( string $file, string $content ) Writes a cache file.

Описание методов

enableTokenizer() публичный статический Метод

This method is only useful for testing.
public static enableTokenizer ( $bool )

fixNamespaceDeclarations() публичный статический Метод

Adds brackets around each namespace if it's not already the case.
public static fixNamespaceDeclarations ( string $source ) : string
$source string Namespace string
Результат string Namespaces with brackets

inline() публичный статический Метод

Generates a file where classes and their parents are inlined.
public static inline ( array $classes, string $cache, array $excluded ) : array
$classes array An array of classes to load
$cache string The file where classes are inlined
$excluded array An array of classes that won't be inlined
Результат array The source map of inlined classes, with classes as keys and files as values

load() публичный статический Метод

Loads a list of classes and caches them in one big file.
public static load ( array $classes, string $cacheDir, string $name, boolean $autoReload, boolean $adaptive = false, string $extension = '.php' )
$classes array An array of classes to load
$cacheDir string A cache directory
$name string The cache name prefix
$autoReload boolean Whether to flush the cache when the cache is stale or not
$adaptive boolean Whether to remove already declared classes or not
$extension string File extension of the resulting file