AglInstaller.php
4 years ago
AkauntingInstaller.php
4 years ago
AnnotateCmsInstaller.php
4 years ago
AsgardInstaller.php
4 years ago
AttogramInstaller.php
4 years ago
BaseInstaller.php
4 years ago
BitrixInstaller.php
4 years ago
BonefishInstaller.php
4 years ago
BotbleInstaller.php
11 months ago
CakePHPInstaller.php
11 months ago
ChefInstaller.php
4 years ago
CiviCrmInstaller.php
4 years ago
ClanCatsFrameworkInstaller.php
4 years ago
CockpitInstaller.php
4 years ago
CodeIgniterInstaller.php
4 years ago
Concrete5Installer.php
4 years ago
ConcreteCMSInstaller.php
11 months ago
CroogoInstaller.php
4 years ago
DecibelInstaller.php
4 years ago
DframeInstaller.php
4 years ago
DokuWikiInstaller.php
4 years ago
DolibarrInstaller.php
4 years ago
DrupalInstaller.php
11 months ago
ElggInstaller.php
4 years ago
EliasisInstaller.php
4 years ago
ExpressionEngineInstaller.php
4 years ago
EzPlatformInstaller.php
4 years ago
ForkCMSInstaller.php
11 months ago
FuelInstaller.php
4 years ago
FuelphpInstaller.php
4 years ago
GravInstaller.php
4 years ago
HuradInstaller.php
4 years ago
ImageCMSInstaller.php
4 years ago
Installer.php
11 months ago
ItopInstaller.php
4 years ago
KanboardInstaller.php
4 years ago
KnownInstaller.php
4 years ago
KodiCMSInstaller.php
4 years ago
KohanaInstaller.php
4 years ago
LanManagementSystemInstaller.php
4 years ago
LaravelInstaller.php
4 years ago
LavaLiteInstaller.php
4 years ago
LithiumInstaller.php
4 years ago
MODULEWorkInstaller.php
4 years ago
MODXEvoInstaller.php
4 years ago
MagentoInstaller.php
4 years ago
MajimaInstaller.php
4 years ago
MakoInstaller.php
4 years ago
MantisBTInstaller.php
4 years ago
MatomoInstaller.php
2 years ago
MauticInstaller.php
4 years ago
MayaInstaller.php
4 years ago
MediaWikiInstaller.php
4 years ago
MiaoxingInstaller.php
4 years ago
MicroweberInstaller.php
4 years ago
ModxInstaller.php
4 years ago
MoodleInstaller.php
11 months ago
OctoberInstaller.php
4 years ago
OntoWikiInstaller.php
4 years ago
OsclassInstaller.php
4 years ago
OxidInstaller.php
4 years ago
PPIInstaller.php
4 years ago
PantheonInstaller.php
4 years ago
PhiftyInstaller.php
4 years ago
PhpBBInstaller.php
4 years ago
PiwikInstaller.php
4 years ago
PlentymarketsInstaller.php
4 years ago
Plugin.php
4 years ago
PortoInstaller.php
4 years ago
PrestashopInstaller.php
4 years ago
ProcessWireInstaller.php
4 years ago
PuppetInstaller.php
4 years ago
PxcmsInstaller.php
4 years ago
RadPHPInstaller.php
4 years ago
ReIndexInstaller.php
4 years ago
Redaxo5Installer.php
4 years ago
RedaxoInstaller.php
4 years ago
RoundcubeInstaller.php
4 years ago
SMFInstaller.php
4 years ago
ShopwareInstaller.php
4 years ago
SilverStripeInstaller.php
4 years ago
SiteDirectInstaller.php
4 years ago
StarbugInstaller.php
4 years ago
SyDESInstaller.php
4 years ago
SyliusInstaller.php
4 years ago
TaoInstaller.php
4 years ago
TastyIgniterInstaller.php
4 years ago
TheliaInstaller.php
4 years ago
TuskInstaller.php
4 years ago
UserFrostingInstaller.php
4 years ago
VanillaInstaller.php
4 years ago
VgmcpInstaller.php
4 years ago
WHMCSInstaller.php
4 years ago
WinterInstaller.php
4 years ago
WolfCMSInstaller.php
4 years ago
WordPressInstaller.php
4 years ago
YawikInstaller.php
4 years ago
ZendInstaller.php
4 years ago
ZikulaInstaller.php
4 years ago
WinterInstaller.php
72 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Composer\Installers; |
| 4 | |
| 5 | class WinterInstaller extends BaseInstaller |
| 6 | { |
| 7 | /** @var array<string, string> */ |
| 8 | protected $locations = array( |
| 9 | 'module' => 'modules/{$name}/', |
| 10 | 'plugin' => 'plugins/{$vendor}/{$name}/', |
| 11 | 'theme' => 'themes/{$name}/' |
| 12 | ); |
| 13 | |
| 14 | /** |
| 15 | * Format package name. |
| 16 | * |
| 17 | * For package type winter-plugin, cut off a trailing '-plugin' if present. |
| 18 | * |
| 19 | * For package type winter-theme, cut off a trailing '-theme' if present. |
| 20 | */ |
| 21 | public function inflectPackageVars(array $vars): array |
| 22 | { |
| 23 | if ($vars['type'] === 'winter-module') { |
| 24 | return $this->inflectModuleVars($vars); |
| 25 | } |
| 26 | |
| 27 | if ($vars['type'] === 'winter-plugin') { |
| 28 | return $this->inflectPluginVars($vars); |
| 29 | } |
| 30 | |
| 31 | if ($vars['type'] === 'winter-theme') { |
| 32 | return $this->inflectThemeVars($vars); |
| 33 | } |
| 34 | |
| 35 | return $vars; |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * @param array<string, string> $vars |
| 40 | * @return array<string, string> |
| 41 | */ |
| 42 | protected function inflectModuleVars(array $vars): array |
| 43 | { |
| 44 | $vars['name'] = $this->pregReplace('/^wn-|-module$/', '', $vars['name']); |
| 45 | |
| 46 | return $vars; |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * @param array<string, string> $vars |
| 51 | * @return array<string, string> |
| 52 | */ |
| 53 | protected function inflectPluginVars(array $vars): array |
| 54 | { |
| 55 | $vars['name'] = $this->pregReplace('/^wn-|-plugin$/', '', $vars['name']); |
| 56 | $vars['vendor'] = $this->pregReplace('/[^a-z0-9_]/i', '', $vars['vendor']); |
| 57 | |
| 58 | return $vars; |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * @param array<string, string> $vars |
| 63 | * @return array<string, string> |
| 64 | */ |
| 65 | protected function inflectThemeVars(array $vars): array |
| 66 | { |
| 67 | $vars['name'] = $this->pregReplace('/^wn-|-theme$/', '', $vars['name']); |
| 68 | |
| 69 | return $vars; |
| 70 | } |
| 71 | } |
| 72 |