PluginProbe
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP / 1.2.71
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP v1.2.71
1.2.74 1.2.73 1.2.72 1.2.71 1.2.70 1.2.69 1.2.68 1.2.67 1.2.66 1.2.65 1.2.64 1.2.63 trunk 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 All 174 releases
userswp / vendor / composer / installers / src / Composer / Installers / OxidInstaller.php

OxidInstaller.php in UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP 1.2.71, at vendor/composer/installers/src/Composer/Installers/OxidInstaller.php

60 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 /**
17 * getInstallPath
18 *
19 * @param PackageInterface $package
20 * @param string $frameworkType
21 * @return string
22 */
23 public function getInstallPath(PackageInterface $package, $frameworkType = '')
24 {
25 $installPath = parent::getInstallPath($package, $frameworkType);
26 $type = $this->package->getType();
27 if ($type === 'oxid-module') {
28 $this->prepareVendorDirectory($installPath);
29 }
30 return $installPath;
31 }
32
33 /**
34 * prepareVendorDirectory
35 *
36 * Makes sure there is a vendormetadata.php file inside
37 * the vendor folder if there is a vendor folder.
38 *
39 * @param string $installPath
40 * @return void
41 */
42 protected function prepareVendorDirectory($installPath)
43 {
44 $matches = '';
45 $hasVendorDirectory = preg_match(self::VENDOR_PATTERN, $installPath, $matches);
46 if (!$hasVendorDirectory) {
47 return;
48 }
49
50 $vendorDirectory = $matches['vendor'];
51 $vendorPath = getcwd() . '/modules/' . $vendorDirectory;
52 if (!file_exists($vendorPath)) {
53 mkdir($vendorPath, 0755, true);
54 }
55
56 $vendorMetaDataPath = $vendorPath . '/vendormetadata.php';
57 touch($vendorMetaDataPath);
58 }
59 }
60