WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
класс не описан

Composer\Installers

OxidInstaller{} WC 1.0

Хуков нет.

Возвращает

Null. Ничего.

Использование

$OxidInstaller = new OxidInstaller();
// use class methods

Методы

  1. getInstallPath(PackageInterface $package, $frameworkType = '')
  2. getInstallPath(PackageInterface $package, $frameworkType = '')
  3. getInstallPath(PackageInterface $package, $frameworkType = '')
  4. prepareVendorDirectory($installPath)
  5. prepareVendorDirectory($installPath)
  6. prepareVendorDirectory($installPath)

Код OxidInstaller{} WC 4.6.1

<?php
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 void
	 */
	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);
	}
}