ComposerInstallersMediaWikiInstaller

The WooCommerce Multilingual Composer Installers MediaWikiInstaller class.

Defined (1)

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

/vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php  
  1. class MediaWikiInstaller extends BaseInstaller 
  2. protected $locations = array( 
  3. 'extension' => 'extensions/{$name}/',  
  4. 'skin' => 'skins/{$name}/',  
  5. ); 
  6.  
  7. /** 
  8. * Format package name. 
  9. * For package type mediawiki-extension, cut off a trailing '-extension' if present and transform 
  10. * to CamelCase keeping existing uppercase chars. 
  11. * For package type mediawiki-skin, cut off a trailing '-skin' if present. 
  12. */ 
  13. public function inflectPackageVars($vars) 
  14.  
  15. if ($vars['type'] === 'mediawiki-extension') { 
  16. return $this->inflectExtensionVars($vars); 
  17.  
  18. if ($vars['type'] === 'mediawiki-skin') { 
  19. return $this->inflectSkinVars($vars); 
  20.  
  21. return $vars; 
  22.  
  23. protected function inflectExtensionVars($vars) 
  24. $vars['name'] = preg_replace('/-extension$/', '', $vars['name']); 
  25. $vars['name'] = str_replace('-', ' ', $vars['name']); 
  26. $vars['name'] = str_replace(' ', '', ucwords($vars['name'])); 
  27.  
  28. return $vars; 
  29.  
  30. protected function inflectSkinVars($vars) 
  31. $vars['name'] = preg_replace('/-skin$/', '', $vars['name']); 
  32.  
  33. return $vars; 
  34.