WordPress at a glance
function is not described


CustomAutoloaderPlugin::postAutoloadDump() public WC 1.0

Generate the custom autolaoder.

{} It's a method of the class: CustomAutoloaderPlugin{}

No Hooks.


null. Nothing.


$CustomAutoloaderPlugin = new CustomAutoloaderPlugin();
$CustomAutoloaderPlugin->postAutoloadDump( $event );
$event(Event) (required)
Script event object.

Code of CustomAutoloaderPlugin::postAutoloadDump() WC 5.3.0

public function postAutoloadDump( Event $event ) {
	// When the autoloader is not required by the root package we don't want to execute it.
	// This prevents unwanted transitive execution that generates unused autoloaders or
	// at worst throws fatal executions.
	if ( ! $this->isRequiredByRoot() ) {

	$config = $this->composer->getConfig();

	if ( 'vendor' !== $config->raw()['config']['vendor-dir'] ) {
		$this->io->writeError( "\n<error>An error occurred while generating the autoloader files:", true );
		$this->io->writeError( 'The project\'s composer.json or composer environment set a non-default vendor directory.', true );
		$this->io->writeError( 'The default composer vendor directory must be used.</error>', true );

	$installationManager = $this->composer->getInstallationManager();
	$repoManager         = $this->composer->getRepositoryManager();
	$localRepo           = $repoManager->getLocalRepository();
	$package             = $this->composer->getPackage();
	$optimize            = $event->getFlags()['optimize'];
	$suffix              = $this->determineSuffix();

	$generator = new AutoloadGenerator( $this->io );
	$generator->dump( $this->composer, $config, $localRepo, $package, $installationManager, 'composer', $optimize, $suffix );
	$this->generated = true;