You are here

class MediaWikiInstaller in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php \Composer\Installers\MediaWikiInstaller

Hierarchy

Expanded class hierarchy of MediaWikiInstaller

1 file declares its use of MediaWikiInstaller
MediaWikiInstallerTest.php in vendor/composer/installers/tests/Composer/Installers/Test/MediaWikiInstallerTest.php

File

vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php, line 4

Namespace

Composer\Installers
View source
class MediaWikiInstaller extends BaseInstaller {
  protected $locations = array(
    'extension' => 'extensions/{$name}/',
    'skin' => 'skins/{$name}/',
  );

  /**
   * Format package name.
   *
   * For package type mediawiki-extension, cut off a trailing '-extension' if present and transform
   * to CamelCase keeping existing uppercase chars.
   *
   * For package type mediawiki-skin, cut off a trailing '-skin' if present.
   *
   */
  public function inflectPackageVars($vars) {
    if ($vars['type'] === 'mediawiki-extension') {
      return $this
        ->inflectExtensionVars($vars);
    }
    if ($vars['type'] === 'mediawiki-skin') {
      return $this
        ->inflectSkinVars($vars);
    }
    return $vars;
  }
  protected function inflectExtensionVars($vars) {
    $vars['name'] = preg_replace('/-extension$/', '', $vars['name']);
    $vars['name'] = str_replace('-', ' ', $vars['name']);
    $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
    return $vars;
  }
  protected function inflectSkinVars($vars) {
    $vars['name'] = preg_replace('/-skin$/', '', $vars['name']);
    return $vars;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BaseInstaller::$composer protected property
BaseInstaller::$package protected property
BaseInstaller::getInstallPath public function Return the install path based on package type. 1
BaseInstaller::getLocations public function Gets the installer's locations 1
BaseInstaller::mapCustomInstallPaths protected function Search through a passed paths array for a custom install path.
BaseInstaller::templatePath protected function Replace vars in a path
BaseInstaller::__construct public function Initializes base installer.
MediaWikiInstaller::$locations protected property Overrides BaseInstaller::$locations
MediaWikiInstaller::inflectExtensionVars protected function
MediaWikiInstaller::inflectPackageVars public function Format package name. Overrides BaseInstaller::inflectPackageVars
MediaWikiInstaller::inflectSkinVars protected function