ComposerInstallersCraftInstaller

Installer for Craft Plugins.

Defined (1)

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

/vendor/composer/installers/src/Composer/Installers/CraftInstaller.php  
  1. class CraftInstaller extends BaseInstaller 
  2. const NAME_PREFIX = 'craft'; 
  3. const NAME_SUFFIX = 'plugin'; 
  4.  
  5. protected $locations = array( 
  6. 'plugin' => 'craft/plugins/{$name}/',  
  7. ); 
  8.  
  9. /** 
  10. * Strip `craft-` prefix and/or `-plugin` suffix from package names 
  11. * @param array $vars 
  12. * @return array 
  13. */ 
  14. final public function inflectPackageVars($vars) 
  15. return $this->inflectPluginVars($vars); 
  16.  
  17. private function inflectPluginVars($vars) 
  18. $vars['name'] = preg_replace('/-' . self::NAME_SUFFIX . '$/i', '', $vars['name']); 
  19. $vars['name'] = preg_replace('/^' . self::NAME_PREFIX . '-/i', '', $vars['name']); 
  20.  
  21. return $vars;