ComposerInstallersSilverStripeInstaller

The WooCommerce Multilingual Composer Installers SilverStripeInstaller class.

Defined (1)

The class is defined in the following location(s).

/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php  
  1. class SilverStripeInstaller extends BaseInstaller 
  2. protected $locations = array( 
  3. 'module' => '{$name}/',  
  4. 'theme' => 'themes/{$name}/',  
  5. ); 
  6.  
  7. /** 
  8. * Return the install path based on package type. 
  9. * Relies on built-in BaseInstaller behaviour with one exception: silverstripe/framework 
  10. * must be installed to 'sapphire' and not 'framework' if the version is <3.0.0 
  11. * @param PackageInterface $package 
  12. * @param string $frameworkType 
  13. * @return string 
  14. */ 
  15. public function getInstallPath(PackageInterface $package, $frameworkType = '') 
  16. if ( 
  17. $package->getName() == 'silverstripe/framework' 
  18. && preg_match('/^\d+\.\d+\.\d+/', $package->getVersion()) 
  19. && version_compare($package->getVersion(), '2.999.999') < 0 
  20. ) { 
  21. return $this->templatePath($this->locations['module'], array('name' => 'sapphire')); 
  22. } else { 
  23. return parent::getInstallPath($package, $frameworkType); 
  24.