Source of file MauticInstaller.php
Size: 1,167 Bytes - Last Modified: 2021-12-24T06:19:18+00:00
/var/www/docs.ssmods.com/process/src/vendor/composer/installers/src/Composer/Installers/MauticInstaller.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344 | <?php namespace Composer\Installers; use Composer\Package\PackageInterface; class MauticInstaller extends BaseInstaller { /** @var array<string, string> */ protected $locations = array( 'plugin' => 'plugins/{$name}/', 'theme' => 'themes/{$name}/', 'core' => 'app/', ); private function getDirectoryName(): string { $extra = $this->package->getExtra(); if (!empty($extra['install-directory-name'])) { return $extra['install-directory-name']; } return $this->toCamelCase($this->package->getPrettyName()); } private function toCamelCase(string $packageName): string { return str_replace(' ', '', ucwords(str_replace('-', ' ', basename($packageName)))); } /** * Format package name of mautic-plugins to CamelCase */ public function inflectPackageVars(array $vars): array { if ($vars['type'] == 'mautic-plugin' || $vars['type'] == 'mautic-theme') { $directoryName = $this->getDirectoryName(); $vars['name'] = $directoryName; } return $vars; } } |