Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/IncludeFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*/

use Composer\Composer;
use Composer\Config as ComposerConfig;
use Composer\IO\IOInterface;
use Composer\Util\Filesystem;
use TYPO3\CMS\Composer\Plugin\Core\IncludeFile\TokenInterface;
Expand Down Expand Up @@ -61,13 +62,15 @@ public function register()
$this->io->writeError('<info>Register typo3/class-alias-loader file in root package autoload definition</info>', true, IOInterface::VERBOSE);

// Generate and write the file
$includeFile = $this->composer->getConfig()->get('vendor-dir') . self::INCLUDE_FILE;
$config = $this->composer->getConfig();
$includeFile = $config->get('vendor-dir') . self::INCLUDE_FILE;
$relativeIncludeFile = $config->get('vendor-dir', ComposerConfig::RELATIVE_PATHS) . self::INCLUDE_FILE;
file_put_contents($includeFile, $this->getIncludeFileContent(dirname($includeFile)));

// Register the file in the root package
$rootPackage = $this->composer->getPackage();
$autoloadDefinition = $rootPackage->getAutoload();
$autoloadDefinition['files'][] = $includeFile;
$autoloadDefinition['files'][] = $relativeIncludeFile;
$rootPackage->setAutoload($autoloadDefinition);
}

Expand Down
Loading