diff --git a/src/Lw/TYPO3CMSInstallers/TYPO3CMSCoreInstaller.php b/src/Lw/TYPO3CMSInstallers/TYPO3CMSCoreInstaller.php index a8437c6..f8dca03 100644 --- a/src/Lw/TYPO3CMSInstallers/TYPO3CMSCoreInstaller.php +++ b/src/Lw/TYPO3CMSInstallers/TYPO3CMSCoreInstaller.php @@ -16,11 +16,13 @@ */ class TYPO3CMSCoreInstaller extends LibraryInstaller { + const DEFAULT_INSTALL_CORE_PATH = 'typo3_src'; + /** * {@inheritDoc} */ public function getPackageBasePath(PackageInterface $package) { - return 'typo3_src'; + return $this->getInstallationPath(); } /** @@ -29,5 +31,18 @@ public function getPackageBasePath(PackageInterface $package) { public function supports($packageType) { return ('typo3cms-core' === $packageType); } + + /** + * Get the installation path from composer.json "extra" section + * or the default path 'typo3conf/ext/' + * + * @return string + */ + protected function getInstallationPath() { + $extra = $this->composer->getPackage()->getExtra(); + + return isset($extra['typo3-cms-core-installer-path']) ? + $extra['typo3-cms-core-installer-path'] : self::DEFAULT_INSTALL_CORE_PATH; + } } -?> \ No newline at end of file +?> diff --git a/src/Lw/TYPO3CMSInstallers/TYPO3CMSExtensionInstaller.php b/src/Lw/TYPO3CMSInstallers/TYPO3CMSExtensionInstaller.php index 56eb974..84b6fd2 100644 --- a/src/Lw/TYPO3CMSInstallers/TYPO3CMSExtensionInstaller.php +++ b/src/Lw/TYPO3CMSInstallers/TYPO3CMSExtensionInstaller.php @@ -8,7 +8,6 @@ use Composer\Util\Filesystem; use Dkd\Downloader\T3xDownloader; - /** * Installer for TYPO3 CMS * @@ -16,6 +15,8 @@ */ class TYPO3CMSExtensionInstaller extends LibraryInstaller { + const DEFAULT_INSTALL_EXTENSION_PATH = 'typo3conf/ext/'; + public function __construct(IOInterface $io, Composer $composer, $type = 'library', Filesystem $filesystem = null) { parent::__construct($io, $composer, $type, $filesystem); @@ -27,7 +28,7 @@ public function __construct(IOInterface $io, Composer $composer, $type = 'librar */ public function getPackageBasePath(PackageInterface $package) { $extensionName = explode('/', $package->getName()); - return 'typo3conf/ext/' . array_pop($extensionName); + return $this->getInstallationPath() . array_pop($extensionName); } /** @@ -36,5 +37,18 @@ public function getPackageBasePath(PackageInterface $package) { public function supports($packageType) { return ('typo3cms-extension' === $packageType); } + + /** + * Get the installation path from composer.json "extra" section + * or the default path 'typo3conf/ext/' + * + * @return string + */ + protected function getInstallationPath() { + $extra = $this->composer->getPackage()->getExtra(); + + return isset($extra['typo3-cms-extension-installer-path']) ? + $extra['typo3-cms-extension-installer-path'] : self::DEFAULT_INSTALL_EXTENSION_PATH; + } } -?> \ No newline at end of file +?>