Skip to content

Commit ff8613d

Browse files
author
Teppo Koivula
committed
Add class constant BASE_PATH
1 parent 7261ae8 commit ff8613d

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/ComposerInstaller/ModuleInstaller.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
*/
1616
class ModuleInstaller extends BaseInstaller
1717
{
18+
/**
19+
* @var string Base path for site profiles
20+
*/
21+
const BASE_PATH = 'site/modules';
22+
1823
/**
1924
* {@inheritDoc}
2025
*/
@@ -28,6 +33,6 @@ public function supports($packageType)
2833
*/
2934
public function getInstallPath(PackageInterface $package)
3035
{
31-
return $this->getFullPath($package, 'site/modules');
36+
return $this->getFullPath($package, static::BASE_PATH);
3237
}
3338
}

src/ComposerInstaller/SiteProfileInstaller.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
*/
1818
class SiteProfileInstaller extends BaseInstaller
1919
{
20+
/**
21+
* @var string Base path for site profiles
22+
*/
23+
const BASE_PATH = '';
24+
2025
/**
2126
* {@inheritDoc}
2227
*/
@@ -40,7 +45,7 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa
4045
if ($site) {
4146
$filesystem = new Filesystem();
4247
$filesystem->rename($path, 'temp-' . $path);
43-
$filesystem->rename('temp-' . $path . $site, $this->getBasePath('') . $site);
48+
$filesystem->rename('temp-' . $path . $site, $this->getBasePath(static::BASE_PATH) . $site);
4449
$filesystem->remove('temp-' . $path);
4550
}
4651
}
@@ -50,7 +55,7 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa
5055
*/
5156
public function getInstallPath(PackageInterface $package)
5257
{
53-
return $this->getFullPath($package, '');
58+
return $this->getFullPath($package, static::BASE_PATH);
5459
}
5560

5661
/**

0 commit comments

Comments
 (0)