Skip to content
Open
Show file tree
Hide file tree
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
19 changes: 17 additions & 2 deletions src/Lw/TYPO3CMSInstallers/TYPO3CMSCoreInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand All @@ -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;
}
}
?>
?>
20 changes: 17 additions & 3 deletions src/Lw/TYPO3CMSInstallers/TYPO3CMSExtensionInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
use Composer\Util\Filesystem;
use Dkd\Downloader\T3xDownloader;


/**
* Installer for TYPO3 CMS
*
* @author Felix Oertel <fo@lightwerk.com>
*/
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);

Expand All @@ -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);
}

/**
Expand All @@ -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;
}
}
?>
?>