ComposerInstallersGravInstaller

The Simple Calendar Composer Installers GravInstaller class.

Defined (1)

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

/vendor/composer/installers/src/Composer/Installers/GravInstaller.php  
  1. class GravInstaller extends BaseInstaller 
  2. protected $locations = array( 
  3. 'plugin' => 'user/plugins/{$name}/',  
  4. 'theme' => 'user/themes/{$name}/',  
  5. ); 
  6.  
  7. /** 
  8. * Format package name 
  9. * @param array $vars 
  10. * @return array 
  11. */ 
  12. public function inflectPackageVars($vars) 
  13. $restrictedWords = implode('|', array_keys($this->locations)); 
  14.  
  15. $vars['name'] = strtolower($vars['name']); 
  16. $vars['name'] = preg_replace('/^(?:grav-)?(?:(?:'.$restrictedWords.')-)?(.*?)(?:-(?:'.$restrictedWords.'))?$/ui',  
  17. '$1',  
  18. $vars['name'] 
  19. ); 
  20.  
  21. return $vars;