woocommerce-multilingual
/
vendor
/
composer
/
installers
/
src
/
Composer
/
Installers
/
OxidInstaller.php
woocommerce-multilingual
/
vendor
/
composer
/
installers
/
src
/
Composer
/
Installers
Last commit date
AglInstaller.php
1 month ago
AimeosInstaller.php
5 years ago
AnnotateCmsInstaller.php
5 years ago
AsgardInstaller.php
1 month ago
AttogramInstaller.php
5 years ago
BaseInstaller.php
1 month ago
BitrixInstaller.php
1 month ago
BonefishInstaller.php
5 years ago
CakePHPInstaller.php
1 month ago
ChefInstaller.php
5 years ago
CiviCrmInstaller.php
5 years ago
ClanCatsFrameworkInstaller.php
5 years ago
CockpitInstaller.php
1 month ago
CodeIgniterInstaller.php
5 years ago
Concrete5Installer.php
5 years ago
CraftInstaller.php
1 month ago
CroogoInstaller.php
1 month ago
DecibelInstaller.php
1 month ago
DframeInstaller.php
5 years ago
DokuWikiInstaller.php
1 month ago
DolibarrInstaller.php
1 month ago
DrupalInstaller.php
5 years ago
ElggInstaller.php
5 years ago
EliasisInstaller.php
5 years ago
ExpressionEngineInstaller.php
5 years ago
EzPlatformInstaller.php
5 years ago
FuelInstaller.php
5 years ago
FuelphpInstaller.php
5 years ago
GravInstaller.php
1 month ago
HuradInstaller.php
1 month ago
ImageCMSInstaller.php
5 years ago
Installer.php
1 month ago
ItopInstaller.php
5 years ago
JoomlaInstaller.php
1 month ago
KanboardInstaller.php
1 month ago
KirbyInstaller.php
5 years ago
KnownInstaller.php
5 years ago
KodiCMSInstaller.php
5 years ago
KohanaInstaller.php
5 years ago
LanManagementSystemInstaller.php
1 month ago
LaravelInstaller.php
5 years ago
LavaLiteInstaller.php
5 years ago
LithiumInstaller.php
5 years ago
MODULEWorkInstaller.php
5 years ago
MODXEvoInstaller.php
1 month ago
MagentoInstaller.php
5 years ago
MajimaInstaller.php
1 month ago
MakoInstaller.php
5 years ago
MantisBTInstaller.php
1 month ago
MauticInstaller.php
1 month ago
MayaInstaller.php
1 month ago
MediaWikiInstaller.php
1 month ago
MiaoxingInstaller.php
4 years ago
MicroweberInstaller.php
1 month ago
ModxInstaller.php
1 month ago
MoodleInstaller.php
4 years ago
OctoberInstaller.php
1 month ago
OntoWikiInstaller.php
1 month ago
OsclassInstaller.php
5 years ago
OxidInstaller.php
1 month ago
PPIInstaller.php
5 years ago
PantheonInstaller.php
1 month ago
PhiftyInstaller.php
5 years ago
PhpBBInstaller.php
5 years ago
PimcoreInstaller.php
1 month ago
PiwikInstaller.php
1 month ago
PlentymarketsInstaller.php
1 month ago
Plugin.php
5 years ago
PortoInstaller.php
5 years ago
PrestashopInstaller.php
5 years ago
ProcessWireInstaller.php
1 month ago
PuppetInstaller.php
5 years ago
PxcmsInstaller.php
1 month ago
RadPHPInstaller.php
1 month ago
ReIndexInstaller.php
5 years ago
Redaxo5Installer.php
5 years ago
RedaxoInstaller.php
5 years ago
RoundcubeInstaller.php
1 month ago
SMFInstaller.php
5 years ago
ShopwareInstaller.php
1 month ago
SilverStripeInstaller.php
1 month ago
SiteDirectInstaller.php
5 years ago
StarbugInstaller.php
4 years ago
SyDESInstaller.php
1 month ago
SyliusInstaller.php
5 years ago
Symfony1Installer.php
1 month ago
TYPO3CmsInstaller.php
1 month ago
TYPO3FlowInstaller.php
1 month ago
TaoInstaller.php
1 month ago
TastyIgniterInstaller.php
1 month ago
TheliaInstaller.php
5 years ago
TuskInstaller.php
1 month ago
UserFrostingInstaller.php
5 years ago
VanillaInstaller.php
5 years ago
VgmcpInstaller.php
1 month ago
WHMCSInstaller.php
5 years ago
WinterInstaller.php
1 month ago
WolfCMSInstaller.php
5 years ago
WordPressInstaller.php
5 years ago
YawikInstaller.php
1 month ago
ZendInstaller.php
5 years ago
ZikulaInstaller.php
5 years ago
OxidInstaller.php
44 lines
| 1 | <?php |
| 2 | namespace Composer\Installers; |
| 3 | |
| 4 | use Composer\Package\PackageInterface; |
| 5 | |
| 6 | class OxidInstaller extends BaseInstaller |
| 7 | { |
| 8 | const VENDOR_PATTERN = '/^modules\/(?P<vendor>.+)\/.+/'; |
| 9 | |
| 10 | protected $locations = array( |
| 11 | 'module' => 'modules/{$name}/', |
| 12 | 'theme' => 'application/views/{$name}/', |
| 13 | 'out' => 'out/{$name}/', |
| 14 | ); |
| 15 | |
| 16 | public function getInstallPath(PackageInterface $package, $frameworkType = '') |
| 17 | { |
| 18 | $installPath = parent::getInstallPath($package, $frameworkType); |
| 19 | $type = $this->package->getType(); |
| 20 | if ($type === 'oxid-module') { |
| 21 | $this->prepareVendorDirectory($installPath); |
| 22 | } |
| 23 | return $installPath; |
| 24 | } |
| 25 | |
| 26 | protected function prepareVendorDirectory($installPath) |
| 27 | { |
| 28 | $matches = ''; |
| 29 | $hasVendorDirectory = preg_match(self::VENDOR_PATTERN, $installPath, $matches); |
| 30 | if (!$hasVendorDirectory) { |
| 31 | return; |
| 32 | } |
| 33 | |
| 34 | $vendorDirectory = $matches['vendor']; |
| 35 | $vendorPath = getcwd() . '/modules/' . $vendorDirectory; |
| 36 | if (!file_exists($vendorPath)) { |
| 37 | mkdir($vendorPath, 0755, true); |
| 38 | } |
| 39 | |
| 40 | $vendorMetaDataPath = $vendorPath . '/vendormetadata.php'; |
| 41 | touch($vendorMetaDataPath); |
| 42 | } |
| 43 | } |
| 44 |