![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mautic.corals.io/vendor/composer/installers/src/Composer/Installers/ |
<?php namespace Composer\Installers; use Composer\Package\PackageInterface; class OxidInstaller extends BaseInstaller { const VENDOR_PATTERN = '/^modules\/(?P<vendor>.+)\/.+/'; protected $locations = array( 'module' => 'modules/{$name}/', 'theme' => 'application/views/{$name}/', 'out' => 'out/{$name}/', ); /** * getInstallPath * * @param PackageInterface $package * @param string $frameworkType * @return string */ public function getInstallPath(PackageInterface $package, $frameworkType = '') { $installPath = parent::getInstallPath($package, $frameworkType); $type = $this->package->getType(); if ($type === 'oxid-module') { $this->prepareVendorDirectory($installPath); } return $installPath; } /** * prepareVendorDirectory * * Makes sure there is a vendormetadata.php file inside * the vendor folder if there is a vendor folder. * * @param string $installPath * @return void */ protected function prepareVendorDirectory($installPath) { $matches = ''; $hasVendorDirectory = preg_match(self::VENDOR_PATTERN, $installPath, $matches); if (!$hasVendorDirectory) { return; } $vendorDirectory = $matches['vendor']; $vendorPath = getcwd() . '/modules/' . $vendorDirectory; if (!file_exists($vendorPath)) { mkdir($vendorPath, 0755, true); } $vendorMetaDataPath = $vendorPath . '/vendormetadata.php'; touch($vendorMetaDataPath); } }