ComposerInstallersAsgardInstaller

The Simple Calendar Composer Installers AsgardInstaller class.

Defined (1)

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

/vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php  
  1. class AsgardInstaller extends BaseInstaller 
  2. protected $locations = array( 
  3. 'module' => 'Modules/{$name}/',  
  4. 'theme' => 'Themes/{$name}/' 
  5. ); 
  6.  
  7. /** 
  8. * Format package name. 
  9. * For package type asgard-module, cut off a trailing '-plugin' if present. 
  10. * For package type asgard-theme, cut off a trailing '-theme' if present. 
  11. */ 
  12. public function inflectPackageVars($vars) 
  13. if ($vars['type'] === 'asgard-module') { 
  14. return $this->inflectPluginVars($vars); 
  15.  
  16. if ($vars['type'] === 'asgard-theme') { 
  17. return $this->inflectThemeVars($vars); 
  18.  
  19. return $vars; 
  20.  
  21. protected function inflectPluginVars($vars) 
  22. $vars['name'] = preg_replace('/-module$/', '', $vars['name']); 
  23. $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); 
  24. $vars['name'] = str_replace(' ', '', ucwords($vars['name'])); 
  25.  
  26. return $vars; 
  27.  
  28. protected function inflectThemeVars($vars) 
  29. $vars['name'] = preg_replace('/-theme$/', '', $vars['name']); 
  30. $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); 
  31. $vars['name'] = str_replace(' ', '', ucwords($vars['name'])); 
  32.  
  33. return $vars;