ComposerInstallersMicroweberInstaller

The Simple Calendar Composer Installers MicroweberInstaller class.

Defined (1)

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

/vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php  
  1. class MicroweberInstaller extends BaseInstaller 
  2. protected $locations = array( 
  3. 'module' => 'userfiles/modules/{$name}/',  
  4. 'module-skin' => 'userfiles/modules/{$name}/templates/',  
  5. 'template' => 'userfiles/templates/{$name}/',  
  6. 'element' => 'userfiles/elements/{$name}/',  
  7. 'vendor' => 'vendor/{$name}/',  
  8. 'components' => 'components/{$name}/' 
  9. ); 
  10.  
  11. /** 
  12. * Format package name. 
  13. * For package type microweber-module, cut off a trailing '-module' if present 
  14. * For package type microweber-template, cut off a trailing '-template' if present. 
  15. */ 
  16. public function inflectPackageVars($vars) 
  17. if ($vars['type'] === 'microweber-template') { 
  18. return $this->inflectTemplateVars($vars); 
  19. if ($vars['type'] === 'microweber-templates') { 
  20. return $this->inflectTemplatesVars($vars); 
  21. if ($vars['type'] === 'microweber-core') { 
  22. return $this->inflectCoreVars($vars); 
  23. if ($vars['type'] === 'microweber-adapter') { 
  24. return $this->inflectCoreVars($vars); 
  25. if ($vars['type'] === 'microweber-module') { 
  26. return $this->inflectModuleVars($vars); 
  27. if ($vars['type'] === 'microweber-modules') { 
  28. return $this->inflectModulesVars($vars); 
  29. if ($vars['type'] === 'microweber-skin') { 
  30. return $this->inflectSkinVars($vars); 
  31. if ($vars['type'] === 'microweber-element' or $vars['type'] === 'microweber-elements') { 
  32. return $this->inflectElementVars($vars); 
  33.  
  34. return $vars; 
  35.  
  36. protected function inflectTemplateVars($vars) 
  37. $vars['name'] = preg_replace('/-template$/', '', $vars['name']); 
  38. $vars['name'] = preg_replace('/template-$/', '', $vars['name']); 
  39.  
  40. return $vars; 
  41.  
  42. protected function inflectTemplatesVars($vars) 
  43. $vars['name'] = preg_replace('/-templates$/', '', $vars['name']); 
  44. $vars['name'] = preg_replace('/templates-$/', '', $vars['name']); 
  45.  
  46. return $vars; 
  47.  
  48. protected function inflectCoreVars($vars) 
  49. $vars['name'] = preg_replace('/-providers$/', '', $vars['name']); 
  50. $vars['name'] = preg_replace('/-provider$/', '', $vars['name']); 
  51. $vars['name'] = preg_replace('/-adapter$/', '', $vars['name']); 
  52.  
  53. return $vars; 
  54.  
  55. protected function inflectModuleVars($vars) 
  56. $vars['name'] = preg_replace('/-module$/', '', $vars['name']); 
  57. $vars['name'] = preg_replace('/module-$/', '', $vars['name']); 
  58.  
  59. return $vars; 
  60.  
  61. protected function inflectModulesVars($vars) 
  62. $vars['name'] = preg_replace('/-modules$/', '', $vars['name']); 
  63. $vars['name'] = preg_replace('/modules-$/', '', $vars['name']); 
  64.  
  65. return $vars; 
  66.  
  67. protected function inflectSkinVars($vars) 
  68. $vars['name'] = preg_replace('/-skin$/', '', $vars['name']); 
  69. $vars['name'] = preg_replace('/skin-$/', '', $vars['name']); 
  70.  
  71. return $vars; 
  72.  
  73. protected function inflectElementVars($vars) 
  74. $vars['name'] = preg_replace('/-elements$/', '', $vars['name']); 
  75. $vars['name'] = preg_replace('/elements-$/', '', $vars['name']); 
  76. $vars['name'] = preg_replace('/-element$/', '', $vars['name']); 
  77. $vars['name'] = preg_replace('/element-$/', '', $vars['name']); 
  78.  
  79. return $vars;