Composer API
Class

Composer\Autoload\AutoloadGenerator

class AutoloadGenerator

Methods

__construct(EventDispatcher $eventDispatcher, IOInterface $io = null)

setDevMode($devMode = true)

setClassMapAuthoritative(bool $classMapAuthoritative)

Whether or not generated autoloader considers the class map authoritative.

setApcu(bool $apcu)

Whether or not generated autoloader considers APCu caching.

setRunScripts(bool $runScripts = true)

Set whether to run scripts or not

dump(Config $config, InstalledRepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, $targetDir, $scanPsr0Packages = false, $suffix = '')

buildPackageMap(InstallationManager $installationManager, PackageInterface $mainPackage, array $packages)

array parseAutoloads(array $packageMap, PackageInterface $mainPackage)

Compiles an ordered list of namespace => path mappings

ClassLoader createLoader(array $autoloads)

Registers an autoloader based on an autoload map returned by parseAutoloads

Details

at line 61
public __construct(EventDispatcher $eventDispatcher, IOInterface $io = null)

Parameters

EventDispatcher $eventDispatcher
IOInterface $io

at line 67
public setDevMode($devMode = true)

Parameters

$devMode

at line 78
public setClassMapAuthoritative(bool $classMapAuthoritative)

Whether or not generated autoloader considers the class map authoritative.

Parameters

bool $classMapAuthoritative

at line 88
public setApcu(bool $apcu)

Whether or not generated autoloader considers APCu caching.

Parameters

bool $apcu

at line 98
public setRunScripts(bool $runScripts = true)

Set whether to run scripts or not

Parameters

bool $runScripts

at line 103
public dump(Config $config, InstalledRepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, $targetDir, $scanPsr0Packages = false, $suffix = '')

Parameters

Config $config
InstalledRepositoryInterface $localRepo
PackageInterface $mainPackage
InstallationManager $installationManager
$targetDir
$scanPsr0Packages
$suffix

at line 339
public buildPackageMap(InstallationManager $installationManager, PackageInterface $mainPackage, array $packages)

Parameters

InstallationManager $installationManager
PackageInterface $mainPackage
array $packages

at line 388
public array parseAutoloads(array $packageMap, PackageInterface $mainPackage)

Compiles an ordered list of namespace => path mappings

Parameters

array $packageMap array of array(package, installDir-relative-to-composer.json)
PackageInterface $mainPackage root package instance

Return Value

array array('psr-0' => array('Ns\Foo' => array('installDir')))

at line 419
public ClassLoader createLoader(array $autoloads)

Registers an autoloader based on an autoload map returned by parseAutoloads

Parameters

array $autoloads see parseAutoloads return value

Return Value

ClassLoader