forked from composer/installers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX: Ensure that silverstripe/framework 2.* is installed to
sapphire, not framework, as the package requires. Closes composerGH-70
- Loading branch information
Showing
2 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,32 @@ | ||
<?php | ||
namespace Composer\Installers; | ||
|
||
use Composer\Package\PackageInterface; | ||
|
||
class SilverStripeInstaller extends BaseInstaller | ||
{ | ||
protected $locations = array( | ||
'module' => '{$name}/', | ||
'theme' => 'themes/{$name}/', | ||
); | ||
|
||
/** | ||
* Return the install path based on package type. | ||
* | ||
* Relies on built-in BaseInstaller behaviour with one exception: silverstripe/framework | ||
* must be installed to 'sapphire' and not 'framework' if the version is <3.0.0 | ||
* | ||
* @param PackageInterface $package | ||
* @param string $frameworkType | ||
* @return string | ||
*/ | ||
public function getInstallPath(PackageInterface $package, $frameworkType = '') | ||
{ | ||
if($package->getName() == 'silverstripe/framework' && version_compare($package->getVersion(), '3.0.0') < 0) { | ||
return $this->templatePath($this->locations['module'], array('name' => 'sapphire')); | ||
} else { | ||
return parent::getInstallPath($package, $frameworkType); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters