AutoloadGenerator
in package
Tags
Table of Contents
- $apcu : bool
- $classMapAuthoritative : bool
- $devMode : bool
- $eventDispatcher : EventDispatcher
- $io : IOInterface
- $runScripts : bool
- __construct() : mixed
- buildPackageMap() : mixed
- createLoader() : ClassLoader
- Registers an autoloader based on an autoload map returned by parseAutoloads
- dump() : mixed
- parseAutoloads() : array<string|int, mixed>
- Compiles an ordered list of namespace => path mappings
- setApcu() : mixed
- Whether or not generated autoloader considers APCu caching.
- setClassMapAuthoritative() : mixed
- Whether or not generated autoloader considers the class map authoritative.
- setDevMode() : mixed
- setRunScripts() : mixed
- Set whether to run scripts or not
- filterPackageMap() : array<string|int, mixed>
- Filters out dev-dependencies
- getAutoloadFile() : mixed
- getAutoloadRealFile() : mixed
- getFileIdentifier() : mixed
- getIncludeFilesFile() : mixed
- getIncludePathsFile() : mixed
- getPathCode() : mixed
- getStaticFile() : mixed
- parseAutoloadsType() : mixed
- safeCopy() : mixed
- Copy file using stream_copy_to_stream to work around https://bugs.php.net/bug.php?id=6463
- sortPackageMap() : array<string|int, mixed>
- Sorts packages by dependency weight
- validatePackage() : mixed
- addClassMapCode() : mixed
- filePutContentsIfModified() : mixed
- filesAreEqual() : mixed
- compare 2 files https://stackoverflow.com/questions/3060125/can-i-use-file-get-contents-to-compare-two-files
- generateClassMap() : mixed
Properties
$apcu
private
bool
$apcu
= false
$classMapAuthoritative
private
bool
$classMapAuthoritative
= false
$devMode
private
bool
$devMode
= false
$eventDispatcher
private
EventDispatcher
$eventDispatcher
$io
private
IOInterface
$io
$runScripts
private
bool
$runScripts
= false
Methods
__construct()
public
__construct(EventDispatcher $eventDispatcher[, IOInterface $io = null ]) : mixed
Parameters
- $eventDispatcher : EventDispatcher
- $io : IOInterface = null
Return values
mixed —buildPackageMap()
public
buildPackageMap(InstallationManager $installationManager, PackageInterface $mainPackage, array<string|int, mixed> $packages) : mixed
Parameters
- $installationManager : InstallationManager
- $mainPackage : PackageInterface
- $packages : array<string|int, mixed>
Return values
mixed —createLoader()
Registers an autoloader based on an autoload map returned by parseAutoloads
public
createLoader(array<string|int, mixed> $autoloads) : ClassLoader
Parameters
- $autoloads : array<string|int, mixed>
-
see parseAutoloads return value
Return values
ClassLoader —dump()
public
dump(Config $config, InstalledRepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, mixed $targetDir[, mixed $scanPsrPackages = false ][, mixed $suffix = '' ]) : mixed
Parameters
- $config : Config
- $localRepo : InstalledRepositoryInterface
- $mainPackage : PackageInterface
- $installationManager : InstallationManager
- $targetDir : mixed
- $scanPsrPackages : mixed = false
- $suffix : mixed = ''
Return values
mixed —parseAutoloads()
Compiles an ordered list of namespace => path mappings
public
parseAutoloads(array<string|int, mixed> $packageMap, PackageInterface $mainPackage[, bool $filterOutRequireDevPackages = false ]) : array<string|int, mixed>
Parameters
- $packageMap : array<string|int, mixed>
-
array of array(package, installDir-relative-to-composer.json)
- $mainPackage : PackageInterface
-
root package instance
- $filterOutRequireDevPackages : bool = false
-
whether to filter out require-dev packages
Return values
array<string|int, mixed> —array('psr-0' => array('Ns\Foo' => array('installDir')))
setApcu()
Whether or not generated autoloader considers APCu caching.
public
setApcu(bool $apcu) : mixed
Parameters
- $apcu : bool
Return values
mixed —setClassMapAuthoritative()
Whether or not generated autoloader considers the class map authoritative.
public
setClassMapAuthoritative(bool $classMapAuthoritative) : mixed
Parameters
- $classMapAuthoritative : bool
Return values
mixed —setDevMode()
public
setDevMode([mixed $devMode = true ]) : mixed
Parameters
- $devMode : mixed = true
Return values
mixed —setRunScripts()
Set whether to run scripts or not
public
setRunScripts([bool $runScripts = true ]) : mixed
Parameters
- $runScripts : bool = true
Return values
mixed —filterPackageMap()
Filters out dev-dependencies
protected
filterPackageMap(array<string|int, mixed> $packageMap, PackageInterface $mainPackage) : array<string|int, mixed>
Parameters
- $packageMap : array<string|int, mixed>
- $mainPackage : PackageInterface
Return values
array<string|int, mixed> —getAutoloadFile()
protected
getAutoloadFile(mixed $vendorPathToTargetDirCode, mixed $suffix) : mixed
Parameters
- $vendorPathToTargetDirCode : mixed
- $suffix : mixed
Return values
mixed —getAutoloadRealFile()
protected
getAutoloadRealFile(mixed $useClassMap, mixed $useIncludePath, mixed $targetDirLoader, mixed $useIncludeFiles, mixed $vendorPathCode, mixed $appBaseDirCode, mixed $suffix, mixed $useGlobalIncludePath, mixed $prependAutoloader[, mixed $staticPhpVersion = 70000 ]) : mixed
Parameters
- $useClassMap : mixed
- $useIncludePath : mixed
- $targetDirLoader : mixed
- $useIncludeFiles : mixed
- $vendorPathCode : mixed
- $appBaseDirCode : mixed
- $suffix : mixed
- $useGlobalIncludePath : mixed
- $prependAutoloader : mixed
- $staticPhpVersion : mixed = 70000
Return values
mixed —getFileIdentifier()
protected
getFileIdentifier(PackageInterface $package, mixed $path) : mixed
Parameters
- $package : PackageInterface
- $path : mixed
Return values
mixed —getIncludeFilesFile()
protected
getIncludeFilesFile(array<string|int, mixed> $files, Filesystem $filesystem, mixed $basePath, mixed $vendorPath, mixed $vendorPathCode, mixed $appBaseDirCode) : mixed
Parameters
- $files : array<string|int, mixed>
- $filesystem : Filesystem
- $basePath : mixed
- $vendorPath : mixed
- $vendorPathCode : mixed
- $appBaseDirCode : mixed
Return values
mixed —getIncludePathsFile()
protected
getIncludePathsFile(array<string|int, mixed> $packageMap, Filesystem $filesystem, mixed $basePath, mixed $vendorPath, mixed $vendorPathCode, mixed $appBaseDirCode) : mixed
Parameters
- $packageMap : array<string|int, mixed>
- $filesystem : Filesystem
- $basePath : mixed
- $vendorPath : mixed
- $vendorPathCode : mixed
- $appBaseDirCode : mixed
Return values
mixed —getPathCode()
protected
getPathCode(Filesystem $filesystem, mixed $basePath, mixed $vendorPath, mixed $path) : mixed
Parameters
- $filesystem : Filesystem
- $basePath : mixed
- $vendorPath : mixed
- $path : mixed
Return values
mixed —getStaticFile()
protected
getStaticFile(mixed $suffix, mixed $targetDir, mixed $vendorPath, mixed $basePath, mixed &$staticPhpVersion) : mixed
Parameters
- $suffix : mixed
- $targetDir : mixed
- $vendorPath : mixed
- $basePath : mixed
- $staticPhpVersion : mixed
Return values
mixed —parseAutoloadsType()
protected
parseAutoloadsType(array<string|int, mixed> $packageMap, mixed $type, PackageInterface $mainPackage) : mixed
Parameters
- $packageMap : array<string|int, mixed>
- $type : mixed
- $mainPackage : PackageInterface
Return values
mixed —safeCopy()
Copy file using stream_copy_to_stream to work around https://bugs.php.net/bug.php?id=6463
protected
safeCopy(string $source, string $target) : mixed
Parameters
- $source : string
- $target : string
Return values
mixed —sortPackageMap()
Sorts packages by dependency weight
protected
sortPackageMap(array<string|int, mixed> $packageMap) : array<string|int, mixed>
Packages of equal weight retain the original order
Parameters
- $packageMap : array<string|int, mixed>
Return values
array<string|int, mixed> —validatePackage()
protected
validatePackage(PackageInterface $package) : mixed
Parameters
- $package : PackageInterface
Tags
Return values
mixed —addClassMapCode()
private
addClassMapCode(mixed $filesystem, mixed $basePath, mixed $vendorPath, mixed $dir, mixed $excluded, mixed $namespaceFilter, mixed $autoloadType, array<string|int, mixed> $classMap, array<string|int, mixed> &$ambiguousClasses, array<string|int, mixed> &$scannedFiles) : mixed
Parameters
- $filesystem : mixed
- $basePath : mixed
- $vendorPath : mixed
- $dir : mixed
- $excluded : mixed
- $namespaceFilter : mixed
- $autoloadType : mixed
- $classMap : array<string|int, mixed>
- $ambiguousClasses : array<string|int, mixed>
- $scannedFiles : array<string|int, mixed>
Return values
mixed —filePutContentsIfModified()
private
filePutContentsIfModified(mixed $path, mixed $content) : mixed
Parameters
- $path : mixed
- $content : mixed
Return values
mixed —filesAreEqual()
compare 2 files https://stackoverflow.com/questions/3060125/can-i-use-file-get-contents-to-compare-two-files
private
filesAreEqual(mixed $a, mixed $b) : mixed
Parameters
- $a : mixed
- $b : mixed
Return values
mixed —generateClassMap()
private
generateClassMap(mixed $dir, mixed $excluded, mixed $namespaceFilter, mixed $autoloadType, mixed $showAmbiguousWarning, array<string|int, mixed> &$scannedFiles) : mixed
Parameters
- $dir : mixed
- $excluded : mixed
- $namespaceFilter : mixed
- $autoloadType : mixed
- $showAmbiguousWarning : mixed
- $scannedFiles : array<string|int, mixed>