Plugins
This commit is contained in:
@@ -1,579 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
/**
|
||||
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
|
||||
*
|
||||
* $loader = new \Composer\Autoload\ClassLoader();
|
||||
*
|
||||
* // register classes with namespaces
|
||||
* $loader->add('Symfony\Component', __DIR__.'/component');
|
||||
* $loader->add('Symfony', __DIR__.'/framework');
|
||||
*
|
||||
* // activate the autoloader
|
||||
* $loader->register();
|
||||
*
|
||||
* // to enable searching the include path (eg. for PEAR packages)
|
||||
* $loader->setUseIncludePath(true);
|
||||
*
|
||||
* In this example, if you try to use a class in the Symfony\Component
|
||||
* namespace or one of its children (Symfony\Component\Console for instance),
|
||||
* the autoloader will first look for the class under the component/
|
||||
* directory, and it will then fallback to the framework/ directory if not
|
||||
* found before giving up.
|
||||
*
|
||||
* This class is loosely based on the Symfony UniversalClassLoader.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
* @see https://www.php-fig.org/psr/psr-0/
|
||||
* @see https://www.php-fig.org/psr/psr-4/
|
||||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
/** @var \Closure(string):void */
|
||||
private static $includeFile;
|
||||
|
||||
/** @var string|null */
|
||||
private $vendorDir;
|
||||
|
||||
// PSR-4
|
||||
/**
|
||||
* @var array<string, array<string, int>>
|
||||
*/
|
||||
private $prefixLengthsPsr4 = array();
|
||||
/**
|
||||
* @var array<string, list<string>>
|
||||
*/
|
||||
private $prefixDirsPsr4 = array();
|
||||
/**
|
||||
* @var list<string>
|
||||
*/
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
/**
|
||||
* List of PSR-0 prefixes
|
||||
*
|
||||
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
|
||||
*
|
||||
* @var array<string, array<string, list<string>>>
|
||||
*/
|
||||
private $prefixesPsr0 = array();
|
||||
/**
|
||||
* @var list<string>
|
||||
*/
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
/** @var bool */
|
||||
private $useIncludePath = false;
|
||||
|
||||
/**
|
||||
* @var array<string, string>
|
||||
*/
|
||||
private $classMap = array();
|
||||
|
||||
/** @var bool */
|
||||
private $classMapAuthoritative = false;
|
||||
|
||||
/**
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
private $missingClasses = array();
|
||||
|
||||
/** @var string|null */
|
||||
private $apcuPrefix;
|
||||
|
||||
/**
|
||||
* @var array<string, self>
|
||||
*/
|
||||
private static $registeredLoaders = array();
|
||||
|
||||
/**
|
||||
* @param string|null $vendorDir
|
||||
*/
|
||||
public function __construct($vendorDir = null)
|
||||
{
|
||||
$this->vendorDir = $vendorDir;
|
||||
self::initializeIncludeClosure();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, list<string>>
|
||||
*/
|
||||
public function getPrefixes()
|
||||
{
|
||||
if (!empty($this->prefixesPsr0)) {
|
||||
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, list<string>>
|
||||
*/
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
return $this->prefixDirsPsr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
return $this->fallbackDirsPsr0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
return $this->fallbackDirsPsr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string> Array of classname => path
|
||||
*/
|
||||
public function getClassMap()
|
||||
{
|
||||
return $this->classMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $classMap Class to filename map
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addClassMap(array $classMap)
|
||||
{
|
||||
if ($this->classMap) {
|
||||
$this->classMap = array_merge($this->classMap, $classMap);
|
||||
} else {
|
||||
$this->classMap = $classMap;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix, either
|
||||
* appending or prepending to the ones previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param list<string>|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
$paths = (array) $paths;
|
||||
if (!$prefix) {
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$paths,
|
||||
$this->fallbackDirsPsr0
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$this->fallbackDirsPsr0,
|
||||
$paths
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$first = $prefix[0];
|
||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||
$this->prefixesPsr0[$first][$prefix] = $paths;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($prepend) {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$paths,
|
||||
$this->prefixesPsr0[$first][$prefix]
|
||||
);
|
||||
} else {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix],
|
||||
$paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace, either
|
||||
* appending or prepending to the ones previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param list<string>|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
$paths = (array) $paths;
|
||||
if (!$prefix) {
|
||||
// Register directories for the root namespace.
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$paths,
|
||||
$this->fallbackDirsPsr4
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$this->fallbackDirsPsr4,
|
||||
$paths
|
||||
);
|
||||
}
|
||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||
// Register directories for a new namespace.
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = $paths;
|
||||
} elseif ($prepend) {
|
||||
// Prepend directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$paths,
|
||||
$this->prefixDirsPsr4[$prefix]
|
||||
);
|
||||
} else {
|
||||
// Append directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$this->prefixDirsPsr4[$prefix],
|
||||
$paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix,
|
||||
* replacing any others previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param list<string>|string $paths The PSR-0 base directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr0 = (array) $paths;
|
||||
} else {
|
||||
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace,
|
||||
* replacing any others previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param list<string>|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setPsr4($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr4 = (array) $paths;
|
||||
} else {
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns on searching the include path for class files.
|
||||
*
|
||||
* @param bool $useIncludePath
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUseIncludePath($useIncludePath)
|
||||
{
|
||||
$this->useIncludePath = $useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can be used to check if the autoloader uses the include path to check
|
||||
* for classes.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getUseIncludePath()
|
||||
{
|
||||
return $this->useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns off searching the prefix and fallback directories for classes
|
||||
* that have not been registered with the class map.
|
||||
*
|
||||
* @param bool $classMapAuthoritative
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||
{
|
||||
$this->classMapAuthoritative = $classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should class lookup fail if not found in the current class map?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isClassMapAuthoritative()
|
||||
{
|
||||
return $this->classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||
*
|
||||
* @param string|null $apcuPrefix
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setApcuPrefix($apcuPrefix)
|
||||
{
|
||||
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The APCu prefix in use, or null if APCu caching is not enabled.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getApcuPrefix()
|
||||
{
|
||||
return $this->apcuPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers this instance as an autoloader.
|
||||
*
|
||||
* @param bool $prepend Whether to prepend the autoloader or not
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register($prepend = false)
|
||||
{
|
||||
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||
|
||||
if (null === $this->vendorDir) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($prepend) {
|
||||
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
||||
} else {
|
||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||
self::$registeredLoaders[$this->vendorDir] = $this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters this instance as an autoloader.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unregister()
|
||||
{
|
||||
spl_autoload_unregister(array($this, 'loadClass'));
|
||||
|
||||
if (null !== $this->vendorDir) {
|
||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the given class or interface.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
* @return true|null True if loaded, null otherwise
|
||||
*/
|
||||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
$includeFile = self::$includeFile;
|
||||
$includeFile($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the path to the file where the class is defined.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
*
|
||||
* @return string|false The path if found, false otherwise
|
||||
*/
|
||||
public function findFile($class)
|
||||
{
|
||||
// class map lookup
|
||||
if (isset($this->classMap[$class])) {
|
||||
return $this->classMap[$class];
|
||||
}
|
||||
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
||||
return false;
|
||||
}
|
||||
if (null !== $this->apcuPrefix) {
|
||||
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
||||
if ($hit) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
$file = $this->findFileWithExtension($class, '.php');
|
||||
|
||||
// Search for Hack files if we are running on HHVM
|
||||
if (false === $file && defined('HHVM_VERSION')) {
|
||||
$file = $this->findFileWithExtension($class, '.hh');
|
||||
}
|
||||
|
||||
if (null !== $this->apcuPrefix) {
|
||||
apcu_add($this->apcuPrefix.$class, $file);
|
||||
}
|
||||
|
||||
if (false === $file) {
|
||||
// Remember that this class does not exist.
|
||||
$this->missingClasses[$class] = true;
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently registered loaders keyed by their corresponding vendor directories.
|
||||
*
|
||||
* @return array<string, self>
|
||||
*/
|
||||
public static function getRegisteredLoaders()
|
||||
{
|
||||
return self::$registeredLoaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
* @param string $ext
|
||||
* @return string|false
|
||||
*/
|
||||
private function findFileWithExtension($class, $ext)
|
||||
{
|
||||
// PSR-4 lookup
|
||||
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
||||
|
||||
$first = $class[0];
|
||||
if (isset($this->prefixLengthsPsr4[$first])) {
|
||||
$subPath = $class;
|
||||
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
||||
$subPath = substr($subPath, 0, $lastPos);
|
||||
$search = $subPath . '\\';
|
||||
if (isset($this->prefixDirsPsr4[$search])) {
|
||||
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
||||
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
||||
if (file_exists($file = $dir . $pathEnd)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-4 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr4 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 lookup
|
||||
if (false !== $pos = strrpos($class, '\\')) {
|
||||
// namespaced class name
|
||||
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
||||
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
||||
} else {
|
||||
// PEAR-like class name
|
||||
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
||||
}
|
||||
|
||||
if (isset($this->prefixesPsr0[$first])) {
|
||||
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
||||
if (0 === strpos($class, $prefix)) {
|
||||
foreach ($dirs as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr0 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 include paths.
|
||||
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private static function initializeIncludeClosure()
|
||||
{
|
||||
if (self::$includeFile !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
self::$includeFile = \Closure::bind(static function($file) {
|
||||
include $file;
|
||||
}, null, null);
|
||||
}
|
||||
}
|
||||
@@ -1,359 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Composer\Semver\VersionParser;
|
||||
|
||||
/**
|
||||
* This class is copied in every Composer installed project and available to all
|
||||
*
|
||||
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
||||
*
|
||||
* To require its presence, you can require `composer-runtime-api ^2.0`
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class InstalledVersions
|
||||
{
|
||||
/**
|
||||
* @var mixed[]|null
|
||||
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
|
||||
*/
|
||||
private static $installed;
|
||||
|
||||
/**
|
||||
* @var bool|null
|
||||
*/
|
||||
private static $canGetVendors;
|
||||
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
private static $installedByVendor = array();
|
||||
|
||||
/**
|
||||
* Returns a list of all package names which are present, either by being installed, replaced or provided
|
||||
*
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackages()
|
||||
{
|
||||
$packages = array();
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
$packages[] = array_keys($installed['versions']);
|
||||
}
|
||||
|
||||
if (1 === \count($packages)) {
|
||||
return $packages[0];
|
||||
}
|
||||
|
||||
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all package names with a specific type e.g. 'library'
|
||||
*
|
||||
* @param string $type
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackagesByType($type)
|
||||
{
|
||||
$packagesByType = array();
|
||||
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
foreach ($installed['versions'] as $name => $package) {
|
||||
if (isset($package['type']) && $package['type'] === $type) {
|
||||
$packagesByType[] = $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $packagesByType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package is installed
|
||||
*
|
||||
* This also returns true if the package name is provided or replaced by another package
|
||||
*
|
||||
* @param string $packageName
|
||||
* @param bool $includeDevRequirements
|
||||
* @return bool
|
||||
*/
|
||||
public static function isInstalled($packageName, $includeDevRequirements = true)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package satisfies a version constraint
|
||||
*
|
||||
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
|
||||
*
|
||||
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
|
||||
*
|
||||
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
|
||||
* @param string $packageName
|
||||
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
|
||||
* @return bool
|
||||
*/
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints((string) $constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a version constraint representing all the range(s) which are installed for a given package
|
||||
*
|
||||
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
|
||||
* whether a given version of a package is installed, and not just whether it exists
|
||||
*
|
||||
* @param string $packageName
|
||||
* @return string Version constraint usable with composer/semver
|
||||
*/
|
||||
public static function getVersionRanges($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ranges = array();
|
||||
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
||||
}
|
||||
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
||||
}
|
||||
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
||||
}
|
||||
|
||||
return implode(' || ', $ranges);
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||
*/
|
||||
public static function getVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||
*/
|
||||
public static function getPrettyVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
|
||||
*/
|
||||
public static function getReference($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['reference'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['reference'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
|
||||
*/
|
||||
public static function getInstallPath($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
|
||||
*/
|
||||
public static function getRootPackage()
|
||||
{
|
||||
$installed = self::getInstalled();
|
||||
|
||||
return $installed[0]['root'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw installed.php data for custom implementations
|
||||
*
|
||||
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
||||
* @return array[]
|
||||
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
|
||||
*/
|
||||
public static function getRawData()
|
||||
{
|
||||
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
self::$installed = include __DIR__ . '/installed.php';
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
return self::$installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
||||
*
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
public static function getAllRawData()
|
||||
{
|
||||
return self::getInstalled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lets you reload the static array from another file
|
||||
*
|
||||
* This is only useful for complex integrations in which a project needs to use
|
||||
* this class but then also needs to execute another project's autoloader in process,
|
||||
* and wants to ensure both projects have access to their version of installed.php.
|
||||
*
|
||||
* A typical case would be PHPUnit, where it would need to make sure it reads all
|
||||
* the data it needs from this class, then call reload() with
|
||||
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
|
||||
* the project in which it runs can then also use this class safely, without
|
||||
* interference between PHPUnit's dependencies and the project's dependencies.
|
||||
*
|
||||
* @param array[] $data A vendor/composer/installed.php data set
|
||||
* @return void
|
||||
*
|
||||
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
|
||||
*/
|
||||
public static function reload($data)
|
||||
{
|
||||
self::$installed = $data;
|
||||
self::$installedByVendor = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
private static function getInstalled()
|
||||
{
|
||||
if (null === self::$canGetVendors) {
|
||||
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
||||
}
|
||||
|
||||
$installed = array();
|
||||
|
||||
if (self::$canGetVendors) {
|
||||
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require $vendorDir.'/composer/installed.php';
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = $required;
|
||||
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
||||
self::$installed = $installed[count($installed) - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require __DIR__ . '/installed.php';
|
||||
self::$installed = $required;
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
if (self::$installed !== array()) {
|
||||
$installed[] = self::$installed;
|
||||
}
|
||||
|
||||
return $installed;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
|
||||
Copyright (c) Nils Adermann, Jordi Boggiano
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
// autoload_files.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
|
||||
'44e8414cd27982ecf86403af6e48f123' => $baseDir . '/src/StoreApi/deprecated.php',
|
||||
'9ce98895d0a470c71998c4b530020d26' => $baseDir . '/src/StoreApi/functions.php',
|
||||
'c379ea42c3f5964a973a7106b08c5ef0' => $baseDir . '/src/Blocks/Domain/Services/functions.php',
|
||||
);
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Automattic\\WooCommerce\\Vendor\\' => array($baseDir . '/lib/packages'),
|
||||
);
|
||||
@@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
// autoload_psr4.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
|
||||
'Symfony\\Component\\CssSelector\\' => array($vendorDir . '/symfony/css-selector'),
|
||||
'Sabberworm\\CSS\\' => array($vendorDir . '/sabberworm/php-css-parser/src'),
|
||||
'Pelago\\Emogrifier\\' => array($vendorDir . '/pelago/emogrifier/src'),
|
||||
'MaxMind\\Db\\' => array($vendorDir . '/maxmind-db/reader/src/MaxMind/Db'),
|
||||
'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
|
||||
'Automattic\\WooCommerce\\Vendor\\' => array($baseDir . '/lib/packages'),
|
||||
'Automattic\\WooCommerce\\' => array($baseDir . '/src'),
|
||||
'Automattic\\Jetpack\\Autoloader\\' => array($vendorDir . '/automattic/jetpack-autoloader/src'),
|
||||
);
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit12ea33bcea6a641c43d24712adc9f0b6
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
public static function loadClassLoader($class)
|
||||
{
|
||||
if ('Composer\Autoload\ClassLoader' === $class) {
|
||||
require __DIR__ . '/ClassLoader.php';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Composer\Autoload\ClassLoader
|
||||
*/
|
||||
public static function getLoader()
|
||||
{
|
||||
if (null !== self::$loader) {
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
require __DIR__ . '/platform_check.php';
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit12ea33bcea6a641c43d24712adc9f0b6', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit12ea33bcea6a641c43d24712adc9f0b6', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit12ea33bcea6a641c43d24712adc9f0b6::getInitializer($loader));
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit12ea33bcea6a641c43d24712adc9f0b6::$files;
|
||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
||||
require $file;
|
||||
}
|
||||
}, null, null);
|
||||
foreach ($filesToLoad as $fileIdentifier => $file) {
|
||||
$requireFile($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,179 +0,0 @@
|
||||
<?php return array(
|
||||
'root' => array(
|
||||
'name' => 'woocommerce/woocommerce',
|
||||
'pretty_version' => '8.9.3',
|
||||
'version' => '8.9.3.0',
|
||||
'reference' => null,
|
||||
'type' => 'wordpress-plugin',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
'dev' => false,
|
||||
),
|
||||
'versions' => array(
|
||||
'automattic/jetpack-a8c-mc-stats' => array(
|
||||
'pretty_version' => 'v1.4.22',
|
||||
'version' => '1.4.22.0',
|
||||
'reference' => 'd7fdf2fc7ae33d75e24e82d81269e33ec718446f',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../automattic/jetpack-a8c-mc-stats',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-admin-ui' => array(
|
||||
'pretty_version' => 'v0.2.25',
|
||||
'version' => '0.2.25.0',
|
||||
'reference' => 'd9566f47ab310d675779273eeead6d0ca64fff82',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../automattic/jetpack-admin-ui',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-autoloader' => array(
|
||||
'pretty_version' => 'v2.11.18',
|
||||
'version' => '2.11.18.0',
|
||||
'reference' => '53cbf0528fa6931c4fa6465bccd37514f9eda720',
|
||||
'type' => 'composer-plugin',
|
||||
'install_path' => __DIR__ . '/../automattic/jetpack-autoloader',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-config' => array(
|
||||
'pretty_version' => 'v1.15.2',
|
||||
'version' => '1.15.2.0',
|
||||
'reference' => 'f1fa6e24a89192336a1499968bf8c68e173b6e34',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../automattic/jetpack-config',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-connection' => array(
|
||||
'pretty_version' => 'v1.60.1',
|
||||
'version' => '1.60.1.0',
|
||||
'reference' => 'fc99f0a4d8839b69341a25f9059b872d426f3e9d',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../automattic/jetpack-connection',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-constants' => array(
|
||||
'pretty_version' => 'v1.6.23',
|
||||
'version' => '1.6.23.0',
|
||||
'reference' => '0825fb1fa94956f26adebc01be0d716a0fd3ade0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../automattic/jetpack-constants',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-redirect' => array(
|
||||
'pretty_version' => 'v1.7.27',
|
||||
'version' => '1.7.27.0',
|
||||
'reference' => '43dd3ae2bef71281fe70f62733bfaa44c988f1b1',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../automattic/jetpack-redirect',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-roles' => array(
|
||||
'pretty_version' => 'v1.4.25',
|
||||
'version' => '1.4.25.0',
|
||||
'reference' => '708b33f16a879fc2ab5939a972c968c9aeefbe38',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../automattic/jetpack-roles',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-status' => array(
|
||||
'pretty_version' => 'v1.19.0',
|
||||
'version' => '1.19.0.0',
|
||||
'reference' => '3281c2311752e9df1b2809d8feacb7bf7b9b7b8d',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../automattic/jetpack-status',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'composer/installers' => array(
|
||||
'pretty_version' => 'v1.12.0',
|
||||
'version' => '1.12.0.0',
|
||||
'reference' => 'd20a64ed3c94748397ff5973488761b22f6d3f19',
|
||||
'type' => 'composer-plugin',
|
||||
'install_path' => __DIR__ . '/./installers',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'maxmind-db/reader' => array(
|
||||
'pretty_version' => 'v1.11.1',
|
||||
'version' => '1.11.1.0',
|
||||
'reference' => '1e66f73ffcf25e17c7a910a1317e9720a95497c7',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../maxmind-db/reader',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'pelago/emogrifier' => array(
|
||||
'pretty_version' => 'v6.0.0',
|
||||
'version' => '6.0.0.0',
|
||||
'reference' => 'aa72d5407efac118f3896bcb995a2cba793df0ae',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../pelago/emogrifier',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'roundcube/plugin-installer' => array(
|
||||
'dev_requirement' => false,
|
||||
'replaced' => array(
|
||||
0 => '*',
|
||||
),
|
||||
),
|
||||
'sabberworm/php-css-parser' => array(
|
||||
'pretty_version' => '8.4.0',
|
||||
'version' => '8.4.0.0',
|
||||
'reference' => 'e41d2140031d533348b2192a83f02d8dd8a71d30',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../sabberworm/php-css-parser',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'shama/baton' => array(
|
||||
'dev_requirement' => false,
|
||||
'replaced' => array(
|
||||
0 => '*',
|
||||
),
|
||||
),
|
||||
'symfony/css-selector' => array(
|
||||
'pretty_version' => 'v5.4.26',
|
||||
'version' => '5.4.26.0',
|
||||
'reference' => '0ad3f7e9a1ab492c5b4214cf22a9dc55dcf8600a',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/css-selector',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/polyfill-php80' => array(
|
||||
'pretty_version' => 'v1.28.0',
|
||||
'version' => '1.28.0.0',
|
||||
'reference' => '6caa57379c4aec19c0a12a38b59b26487dcfe4b5',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/polyfill-php80',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'woocommerce/action-scheduler' => array(
|
||||
'pretty_version' => '3.7.4',
|
||||
'version' => '3.7.4.0',
|
||||
'reference' => '5fb655253dc004bb7a6d840da807f0949aea8bcd',
|
||||
'type' => 'wordpress-plugin',
|
||||
'install_path' => __DIR__ . '/../../packages/action-scheduler',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'woocommerce/woocommerce' => array(
|
||||
'pretty_version' => '8.9.3',
|
||||
'version' => '8.9.3.0',
|
||||
'reference' => null,
|
||||
'type' => 'wordpress-plugin',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -1,19 +0,0 @@
|
||||
Copyright (c) 2012 Kyle Robinson Young
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -1,10 +0,0 @@
|
||||
parameters:
|
||||
level: 5
|
||||
paths:
|
||||
- src
|
||||
- tests
|
||||
excludes_analyse:
|
||||
- tests/Composer/Installers/Test/PolyfillTestCase.php
|
||||
|
||||
includes:
|
||||
- vendor/phpstan/phpstan-phpunit/extension.neon
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AglInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'More/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace_callback('/(?:^|_|-)(.?)/', function ($matches) {
|
||||
return strtoupper($matches[1]);
|
||||
}, $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AimeosInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'extension' => 'ext/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AnnotateCmsInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'addons/modules/{$name}/',
|
||||
'component' => 'addons/components/{$name}/',
|
||||
'service' => 'addons/services/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AsgardInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'Modules/{$name}/',
|
||||
'theme' => 'Themes/{$name}/'
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name.
|
||||
*
|
||||
* For package type asgard-module, cut off a trailing '-plugin' if present.
|
||||
*
|
||||
* For package type asgard-theme, cut off a trailing '-theme' if present.
|
||||
*
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
if ($vars['type'] === 'asgard-module') {
|
||||
return $this->inflectPluginVars($vars);
|
||||
}
|
||||
|
||||
if ($vars['type'] === 'asgard-theme') {
|
||||
return $this->inflectThemeVars($vars);
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectPluginVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-module$/', '', $vars['name']);
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectThemeVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AttogramInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\IO\IOInterface;
|
||||
use Composer\Composer;
|
||||
use Composer\Package\PackageInterface;
|
||||
|
||||
abstract class BaseInstaller
|
||||
{
|
||||
protected $locations = array();
|
||||
protected $composer;
|
||||
protected $package;
|
||||
protected $io;
|
||||
|
||||
/**
|
||||
* Initializes base installer.
|
||||
*
|
||||
* @param PackageInterface $package
|
||||
* @param Composer $composer
|
||||
* @param IOInterface $io
|
||||
*/
|
||||
public function __construct(PackageInterface $package = null, Composer $composer = null, IOInterface $io = null)
|
||||
{
|
||||
$this->composer = $composer;
|
||||
$this->package = $package;
|
||||
$this->io = $io;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the install path based on package type.
|
||||
*
|
||||
* @param PackageInterface $package
|
||||
* @param string $frameworkType
|
||||
* @return string
|
||||
*/
|
||||
public function getInstallPath(PackageInterface $package, $frameworkType = '')
|
||||
{
|
||||
$type = $this->package->getType();
|
||||
|
||||
$prettyName = $this->package->getPrettyName();
|
||||
if (strpos($prettyName, '/') !== false) {
|
||||
list($vendor, $name) = explode('/', $prettyName);
|
||||
} else {
|
||||
$vendor = '';
|
||||
$name = $prettyName;
|
||||
}
|
||||
|
||||
$availableVars = $this->inflectPackageVars(compact('name', 'vendor', 'type'));
|
||||
|
||||
$extra = $package->getExtra();
|
||||
if (!empty($extra['installer-name'])) {
|
||||
$availableVars['name'] = $extra['installer-name'];
|
||||
}
|
||||
|
||||
if ($this->composer->getPackage()) {
|
||||
$extra = $this->composer->getPackage()->getExtra();
|
||||
if (!empty($extra['installer-paths'])) {
|
||||
$customPath = $this->mapCustomInstallPaths($extra['installer-paths'], $prettyName, $type, $vendor);
|
||||
if ($customPath !== false) {
|
||||
return $this->templatePath($customPath, $availableVars);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$packageType = substr($type, strlen($frameworkType) + 1);
|
||||
$locations = $this->getLocations();
|
||||
if (!isset($locations[$packageType])) {
|
||||
throw new \InvalidArgumentException(sprintf('Package type "%s" is not supported', $type));
|
||||
}
|
||||
|
||||
return $this->templatePath($locations[$packageType], $availableVars);
|
||||
}
|
||||
|
||||
/**
|
||||
* For an installer to override to modify the vars per installer.
|
||||
*
|
||||
* @param array<string, string> $vars This will normally receive array{name: string, vendor: string, type: string}
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the installer's locations
|
||||
*
|
||||
* @return array<string, string> map of package types => install path
|
||||
*/
|
||||
public function getLocations()
|
||||
{
|
||||
return $this->locations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace vars in a path
|
||||
*
|
||||
* @param string $path
|
||||
* @param array<string, string> $vars
|
||||
* @return string
|
||||
*/
|
||||
protected function templatePath($path, array $vars = array())
|
||||
{
|
||||
if (strpos($path, '{') !== false) {
|
||||
extract($vars);
|
||||
preg_match_all('@\{\$([A-Za-z0-9_]*)\}@i', $path, $matches);
|
||||
if (!empty($matches[1])) {
|
||||
foreach ($matches[1] as $var) {
|
||||
$path = str_replace('{$' . $var . '}', $$var, $path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search through a passed paths array for a custom install path.
|
||||
*
|
||||
* @param array $paths
|
||||
* @param string $name
|
||||
* @param string $type
|
||||
* @param string $vendor = NULL
|
||||
* @return string|false
|
||||
*/
|
||||
protected function mapCustomInstallPaths(array $paths, $name, $type, $vendor = NULL)
|
||||
{
|
||||
foreach ($paths as $path => $names) {
|
||||
$names = (array) $names;
|
||||
if (in_array($name, $names) || in_array('type:' . $type, $names) || in_array('vendor:' . $vendor, $names)) {
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\Util\Filesystem;
|
||||
|
||||
/**
|
||||
* Installer for Bitrix Framework. Supported types of extensions:
|
||||
* - `bitrix-d7-module` — copy the module to directory `bitrix/modules/<vendor>.<name>`.
|
||||
* - `bitrix-d7-component` — copy the component to directory `bitrix/components/<vendor>/<name>`.
|
||||
* - `bitrix-d7-template` — copy the template to directory `bitrix/templates/<vendor>_<name>`.
|
||||
*
|
||||
* You can set custom path to directory with Bitrix kernel in `composer.json`:
|
||||
*
|
||||
* ```json
|
||||
* {
|
||||
* "extra": {
|
||||
* "bitrix-dir": "s1/bitrix"
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @author Nik Samokhvalov <nik@samokhvalov.info>
|
||||
* @author Denis Kulichkin <onexhovia@gmail.com>
|
||||
*/
|
||||
class BitrixInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => '{$bitrix_dir}/modules/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
|
||||
'component' => '{$bitrix_dir}/components/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
|
||||
'theme' => '{$bitrix_dir}/templates/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
|
||||
'd7-module' => '{$bitrix_dir}/modules/{$vendor}.{$name}/',
|
||||
'd7-component' => '{$bitrix_dir}/components/{$vendor}/{$name}/',
|
||||
'd7-template' => '{$bitrix_dir}/templates/{$vendor}_{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* @var array Storage for informations about duplicates at all the time of installation packages.
|
||||
*/
|
||||
private static $checkedDuplicates = array();
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
if ($this->composer->getPackage()) {
|
||||
$extra = $this->composer->getPackage()->getExtra();
|
||||
|
||||
if (isset($extra['bitrix-dir'])) {
|
||||
$vars['bitrix_dir'] = $extra['bitrix-dir'];
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($vars['bitrix_dir'])) {
|
||||
$vars['bitrix_dir'] = 'bitrix';
|
||||
}
|
||||
|
||||
return parent::inflectPackageVars($vars);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function templatePath($path, array $vars = array())
|
||||
{
|
||||
$templatePath = parent::templatePath($path, $vars);
|
||||
$this->checkDuplicates($templatePath, $vars);
|
||||
|
||||
return $templatePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Duplicates search packages.
|
||||
*
|
||||
* @param string $path
|
||||
* @param array $vars
|
||||
*/
|
||||
protected function checkDuplicates($path, array $vars = array())
|
||||
{
|
||||
$packageType = substr($vars['type'], strlen('bitrix') + 1);
|
||||
$localDir = explode('/', $vars['bitrix_dir']);
|
||||
array_pop($localDir);
|
||||
$localDir[] = 'local';
|
||||
$localDir = implode('/', $localDir);
|
||||
|
||||
$oldPath = str_replace(
|
||||
array('{$bitrix_dir}', '{$name}'),
|
||||
array($localDir, $vars['name']),
|
||||
$this->locations[$packageType]
|
||||
);
|
||||
|
||||
if (in_array($oldPath, static::$checkedDuplicates)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($oldPath !== $path && file_exists($oldPath) && $this->io && $this->io->isInteractive()) {
|
||||
|
||||
$this->io->writeError(' <error>Duplication of packages:</error>');
|
||||
$this->io->writeError(' <info>Package ' . $oldPath . ' will be called instead package ' . $path . '</info>');
|
||||
|
||||
while (true) {
|
||||
switch ($this->io->ask(' <info>Delete ' . $oldPath . ' [y,n,?]?</info> ', '?')) {
|
||||
case 'y':
|
||||
$fs = new Filesystem();
|
||||
$fs->removeDirectory($oldPath);
|
||||
break 2;
|
||||
|
||||
case 'n':
|
||||
break 2;
|
||||
|
||||
case '?':
|
||||
default:
|
||||
$this->io->writeError(array(
|
||||
' y - delete package ' . $oldPath . ' and to continue with the installation',
|
||||
' n - don\'t delete and to continue with the installation',
|
||||
));
|
||||
$this->io->writeError(' ? - print help');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static::$checkedDuplicates[] = $oldPath;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class BonefishInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'package' => 'Packages/{$vendor}/{$name}/'
|
||||
);
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\DependencyResolver\Pool;
|
||||
use Composer\Semver\Constraint\Constraint;
|
||||
|
||||
class CakePHPInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'Plugin/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
if ($this->matchesCakeVersion('>=', '3.0.0')) {
|
||||
return $vars;
|
||||
}
|
||||
|
||||
$nameParts = explode('/', $vars['name']);
|
||||
foreach ($nameParts as &$value) {
|
||||
$value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
|
||||
$value = str_replace(array('-', '_'), ' ', $value);
|
||||
$value = str_replace(' ', '', ucwords($value));
|
||||
}
|
||||
$vars['name'] = implode('/', $nameParts);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the default plugin location when cakephp >= 3.0
|
||||
*/
|
||||
public function getLocations()
|
||||
{
|
||||
if ($this->matchesCakeVersion('>=', '3.0.0')) {
|
||||
$this->locations['plugin'] = $this->composer->getConfig()->get('vendor-dir') . '/{$vendor}/{$name}/';
|
||||
}
|
||||
return $this->locations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if CakePHP version matches against a version
|
||||
*
|
||||
* @param string $matcher
|
||||
* @param string $version
|
||||
* @return bool
|
||||
* @phpstan-param Constraint::STR_OP_* $matcher
|
||||
*/
|
||||
protected function matchesCakeVersion($matcher, $version)
|
||||
{
|
||||
$repositoryManager = $this->composer->getRepositoryManager();
|
||||
if (! $repositoryManager) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$repos = $repositoryManager->getLocalRepository();
|
||||
if (!$repos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $repos->findPackage('cakephp/cakephp', new Constraint($matcher, $version)) !== null;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ChefInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'cookbook' => 'Chef/{$vendor}/{$name}/',
|
||||
'role' => 'Chef/roles/{$name}/',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class CiviCrmInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'ext' => 'ext/{$name}/'
|
||||
);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ClanCatsFrameworkInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'ship' => 'CCF/orbit/{$name}/',
|
||||
'theme' => 'CCF/app/themes/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class CockpitInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'cockpit/modules/addons/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format module name.
|
||||
*
|
||||
* Strip `module-` prefix from package name.
|
||||
*
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
if ($vars['type'] == 'cockpit-module') {
|
||||
return $this->inflectModuleVars($vars);
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
public function inflectModuleVars($vars)
|
||||
{
|
||||
$vars['name'] = ucfirst(preg_replace('/cockpit-/i', '', $vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class CodeIgniterInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'library' => 'application/libraries/{$name}/',
|
||||
'third-party' => 'application/third_party/{$name}/',
|
||||
'module' => 'application/modules/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class Concrete5Installer extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'core' => 'concrete/',
|
||||
'block' => 'application/blocks/{$name}/',
|
||||
'package' => 'packages/{$name}/',
|
||||
'theme' => 'application/themes/{$name}/',
|
||||
'update' => 'updates/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* Installer for Craft Plugins
|
||||
*/
|
||||
class CraftInstaller extends BaseInstaller
|
||||
{
|
||||
const NAME_PREFIX = 'craft';
|
||||
const NAME_SUFFIX = 'plugin';
|
||||
|
||||
protected $locations = array(
|
||||
'plugin' => 'craft/plugins/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Strip `craft-` prefix and/or `-plugin` suffix from package names
|
||||
*
|
||||
* @param array $vars
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
final public function inflectPackageVars($vars)
|
||||
{
|
||||
return $this->inflectPluginVars($vars);
|
||||
}
|
||||
|
||||
private function inflectPluginVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-' . self::NAME_SUFFIX . '$/i', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/^' . self::NAME_PREFIX . '-/i', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class CroogoInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'Plugin/{$name}/',
|
||||
'theme' => 'View/Themed/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
$vars['name'] = strtolower(str_replace(array('-', '_'), ' ', $vars['name']));
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class DecibelInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array */
|
||||
protected $locations = array(
|
||||
'app' => 'app/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class DframeInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$vendor}/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class DokuWikiInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'lib/plugins/{$name}/',
|
||||
'template' => 'lib/tpl/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name.
|
||||
*
|
||||
* For package type dokuwiki-plugin, cut off a trailing '-plugin',
|
||||
* or leading dokuwiki_ if present.
|
||||
*
|
||||
* For package type dokuwiki-template, cut off a trailing '-template' if present.
|
||||
*
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
|
||||
if ($vars['type'] === 'dokuwiki-plugin') {
|
||||
return $this->inflectPluginVars($vars);
|
||||
}
|
||||
|
||||
if ($vars['type'] === 'dokuwiki-template') {
|
||||
return $this->inflectTemplateVars($vars);
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectPluginVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-plugin$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectTemplateVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-template$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* Class DolibarrInstaller
|
||||
*
|
||||
* @package Composer\Installers
|
||||
* @author Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*/
|
||||
class DolibarrInstaller extends BaseInstaller
|
||||
{
|
||||
//TODO: Add support for scripts and themes
|
||||
protected $locations = array(
|
||||
'module' => 'htdocs/custom/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class DrupalInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'core' => 'core/',
|
||||
'module' => 'modules/{$name}/',
|
||||
'theme' => 'themes/{$name}/',
|
||||
'library' => 'libraries/{$name}/',
|
||||
'profile' => 'profiles/{$name}/',
|
||||
'database-driver' => 'drivers/lib/Drupal/Driver/Database/{$name}/',
|
||||
'drush' => 'drush/{$name}/',
|
||||
'custom-theme' => 'themes/custom/{$name}/',
|
||||
'custom-module' => 'modules/custom/{$name}/',
|
||||
'custom-profile' => 'profiles/custom/{$name}/',
|
||||
'drupal-multisite' => 'sites/{$name}/',
|
||||
'console' => 'console/{$name}/',
|
||||
'console-language' => 'console/language/{$name}/',
|
||||
'config' => 'config/sync/',
|
||||
);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ElggInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'mod/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class EliasisInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'component' => 'components/{$name}/',
|
||||
'module' => 'modules/{$name}/',
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
'template' => 'templates/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\Package\PackageInterface;
|
||||
|
||||
class ExpressionEngineInstaller extends BaseInstaller
|
||||
{
|
||||
|
||||
protected $locations = array();
|
||||
|
||||
private $ee2Locations = array(
|
||||
'addon' => 'system/expressionengine/third_party/{$name}/',
|
||||
'theme' => 'themes/third_party/{$name}/',
|
||||
);
|
||||
|
||||
private $ee3Locations = array(
|
||||
'addon' => 'system/user/addons/{$name}/',
|
||||
'theme' => 'themes/user/{$name}/',
|
||||
);
|
||||
|
||||
public function getInstallPath(PackageInterface $package, $frameworkType = '')
|
||||
{
|
||||
|
||||
$version = "{$frameworkType}Locations";
|
||||
$this->locations = $this->$version;
|
||||
|
||||
return parent::getInstallPath($package, $frameworkType);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class EzPlatformInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'meta-assets' => 'web/assets/ezplatform/',
|
||||
'assets' => 'web/assets/ezplatform/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class FuelInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'fuel/app/modules/{$name}/',
|
||||
'package' => 'fuel/packages/{$name}/',
|
||||
'theme' => 'fuel/app/themes/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class FuelphpInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'component' => 'components/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class GravInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'user/plugins/{$name}/',
|
||||
'theme' => 'user/themes/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name
|
||||
*
|
||||
* @param array $vars
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
$restrictedWords = implode('|', array_keys($this->locations));
|
||||
|
||||
$vars['name'] = strtolower($vars['name']);
|
||||
$vars['name'] = preg_replace('/^(?:grav-)?(?:(?:'.$restrictedWords.')-)?(.*?)(?:-(?:'.$restrictedWords.'))?$/ui',
|
||||
'$1',
|
||||
$vars['name']
|
||||
);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class HuradInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
'theme' => 'plugins/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
$nameParts = explode('/', $vars['name']);
|
||||
foreach ($nameParts as &$value) {
|
||||
$value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
|
||||
$value = str_replace(array('-', '_'), ' ', $value);
|
||||
$value = str_replace(' ', '', ucwords($value));
|
||||
}
|
||||
$vars['name'] = implode('/', $nameParts);
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ImageCMSInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'template' => 'templates/{$name}/',
|
||||
'module' => 'application/modules/{$name}/',
|
||||
'library' => 'application/libraries/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,298 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\Composer;
|
||||
use Composer\Installer\BinaryInstaller;
|
||||
use Composer\Installer\LibraryInstaller;
|
||||
use Composer\IO\IOInterface;
|
||||
use Composer\Package\PackageInterface;
|
||||
use Composer\Repository\InstalledRepositoryInterface;
|
||||
use Composer\Util\Filesystem;
|
||||
use React\Promise\PromiseInterface;
|
||||
|
||||
class Installer extends LibraryInstaller
|
||||
{
|
||||
|
||||
/**
|
||||
* Package types to installer class map
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $supportedTypes = array(
|
||||
'aimeos' => 'AimeosInstaller',
|
||||
'asgard' => 'AsgardInstaller',
|
||||
'attogram' => 'AttogramInstaller',
|
||||
'agl' => 'AglInstaller',
|
||||
'annotatecms' => 'AnnotateCmsInstaller',
|
||||
'bitrix' => 'BitrixInstaller',
|
||||
'bonefish' => 'BonefishInstaller',
|
||||
'cakephp' => 'CakePHPInstaller',
|
||||
'chef' => 'ChefInstaller',
|
||||
'civicrm' => 'CiviCrmInstaller',
|
||||
'ccframework' => 'ClanCatsFrameworkInstaller',
|
||||
'cockpit' => 'CockpitInstaller',
|
||||
'codeigniter' => 'CodeIgniterInstaller',
|
||||
'concrete5' => 'Concrete5Installer',
|
||||
'craft' => 'CraftInstaller',
|
||||
'croogo' => 'CroogoInstaller',
|
||||
'dframe' => 'DframeInstaller',
|
||||
'dokuwiki' => 'DokuWikiInstaller',
|
||||
'dolibarr' => 'DolibarrInstaller',
|
||||
'decibel' => 'DecibelInstaller',
|
||||
'drupal' => 'DrupalInstaller',
|
||||
'elgg' => 'ElggInstaller',
|
||||
'eliasis' => 'EliasisInstaller',
|
||||
'ee3' => 'ExpressionEngineInstaller',
|
||||
'ee2' => 'ExpressionEngineInstaller',
|
||||
'ezplatform' => 'EzPlatformInstaller',
|
||||
'fuel' => 'FuelInstaller',
|
||||
'fuelphp' => 'FuelphpInstaller',
|
||||
'grav' => 'GravInstaller',
|
||||
'hurad' => 'HuradInstaller',
|
||||
'tastyigniter' => 'TastyIgniterInstaller',
|
||||
'imagecms' => 'ImageCMSInstaller',
|
||||
'itop' => 'ItopInstaller',
|
||||
'joomla' => 'JoomlaInstaller',
|
||||
'kanboard' => 'KanboardInstaller',
|
||||
'kirby' => 'KirbyInstaller',
|
||||
'known' => 'KnownInstaller',
|
||||
'kodicms' => 'KodiCMSInstaller',
|
||||
'kohana' => 'KohanaInstaller',
|
||||
'lms' => 'LanManagementSystemInstaller',
|
||||
'laravel' => 'LaravelInstaller',
|
||||
'lavalite' => 'LavaLiteInstaller',
|
||||
'lithium' => 'LithiumInstaller',
|
||||
'magento' => 'MagentoInstaller',
|
||||
'majima' => 'MajimaInstaller',
|
||||
'mantisbt' => 'MantisBTInstaller',
|
||||
'mako' => 'MakoInstaller',
|
||||
'maya' => 'MayaInstaller',
|
||||
'mautic' => 'MauticInstaller',
|
||||
'mediawiki' => 'MediaWikiInstaller',
|
||||
'miaoxing' => 'MiaoxingInstaller',
|
||||
'microweber' => 'MicroweberInstaller',
|
||||
'modulework' => 'MODULEWorkInstaller',
|
||||
'modx' => 'ModxInstaller',
|
||||
'modxevo' => 'MODXEvoInstaller',
|
||||
'moodle' => 'MoodleInstaller',
|
||||
'october' => 'OctoberInstaller',
|
||||
'ontowiki' => 'OntoWikiInstaller',
|
||||
'oxid' => 'OxidInstaller',
|
||||
'osclass' => 'OsclassInstaller',
|
||||
'pxcms' => 'PxcmsInstaller',
|
||||
'phpbb' => 'PhpBBInstaller',
|
||||
'pimcore' => 'PimcoreInstaller',
|
||||
'piwik' => 'PiwikInstaller',
|
||||
'plentymarkets'=> 'PlentymarketsInstaller',
|
||||
'ppi' => 'PPIInstaller',
|
||||
'puppet' => 'PuppetInstaller',
|
||||
'radphp' => 'RadPHPInstaller',
|
||||
'phifty' => 'PhiftyInstaller',
|
||||
'porto' => 'PortoInstaller',
|
||||
'processwire' => 'ProcessWireInstaller',
|
||||
'quicksilver' => 'PantheonInstaller',
|
||||
'redaxo' => 'RedaxoInstaller',
|
||||
'redaxo5' => 'Redaxo5Installer',
|
||||
'reindex' => 'ReIndexInstaller',
|
||||
'roundcube' => 'RoundcubeInstaller',
|
||||
'shopware' => 'ShopwareInstaller',
|
||||
'sitedirect' => 'SiteDirectInstaller',
|
||||
'silverstripe' => 'SilverStripeInstaller',
|
||||
'smf' => 'SMFInstaller',
|
||||
'starbug' => 'StarbugInstaller',
|
||||
'sydes' => 'SyDESInstaller',
|
||||
'sylius' => 'SyliusInstaller',
|
||||
'symfony1' => 'Symfony1Installer',
|
||||
'tao' => 'TaoInstaller',
|
||||
'thelia' => 'TheliaInstaller',
|
||||
'tusk' => 'TuskInstaller',
|
||||
'typo3-cms' => 'TYPO3CmsInstaller',
|
||||
'typo3-flow' => 'TYPO3FlowInstaller',
|
||||
'userfrosting' => 'UserFrostingInstaller',
|
||||
'vanilla' => 'VanillaInstaller',
|
||||
'whmcs' => 'WHMCSInstaller',
|
||||
'winter' => 'WinterInstaller',
|
||||
'wolfcms' => 'WolfCMSInstaller',
|
||||
'wordpress' => 'WordPressInstaller',
|
||||
'yawik' => 'YawikInstaller',
|
||||
'zend' => 'ZendInstaller',
|
||||
'zikula' => 'ZikulaInstaller',
|
||||
'prestashop' => 'PrestashopInstaller'
|
||||
);
|
||||
|
||||
/**
|
||||
* Installer constructor.
|
||||
*
|
||||
* Disables installers specified in main composer extra installer-disable
|
||||
* list
|
||||
*
|
||||
* @param IOInterface $io
|
||||
* @param Composer $composer
|
||||
* @param string $type
|
||||
* @param Filesystem|null $filesystem
|
||||
* @param BinaryInstaller|null $binaryInstaller
|
||||
*/
|
||||
public function __construct(
|
||||
IOInterface $io,
|
||||
Composer $composer,
|
||||
$type = 'library',
|
||||
Filesystem $filesystem = null,
|
||||
BinaryInstaller $binaryInstaller = null
|
||||
) {
|
||||
parent::__construct($io, $composer, $type, $filesystem,
|
||||
$binaryInstaller);
|
||||
$this->removeDisabledInstallers();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getInstallPath(PackageInterface $package)
|
||||
{
|
||||
$type = $package->getType();
|
||||
$frameworkType = $this->findFrameworkType($type);
|
||||
|
||||
if ($frameworkType === false) {
|
||||
throw new \InvalidArgumentException(
|
||||
'Sorry the package type of this package is not yet supported.'
|
||||
);
|
||||
}
|
||||
|
||||
$class = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
|
||||
$installer = new $class($package, $this->composer, $this->getIO());
|
||||
|
||||
return $installer->getInstallPath($package, $frameworkType);
|
||||
}
|
||||
|
||||
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
|
||||
{
|
||||
$installPath = $this->getPackageBasePath($package);
|
||||
$io = $this->io;
|
||||
$outputStatus = function () use ($io, $installPath) {
|
||||
$io->write(sprintf('Deleting %s - %s', $installPath, !file_exists($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
|
||||
};
|
||||
|
||||
$promise = parent::uninstall($repo, $package);
|
||||
|
||||
// Composer v2 might return a promise here
|
||||
if ($promise instanceof PromiseInterface) {
|
||||
return $promise->then($outputStatus);
|
||||
}
|
||||
|
||||
// If not, execute the code right away as parent::uninstall executed synchronously (composer v1, or v2 without async)
|
||||
$outputStatus();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function supports($packageType)
|
||||
{
|
||||
$frameworkType = $this->findFrameworkType($packageType);
|
||||
|
||||
if ($frameworkType === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$locationPattern = $this->getLocationPattern($frameworkType);
|
||||
|
||||
return preg_match('#' . $frameworkType . '-' . $locationPattern . '#', $packageType, $matches) === 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds a supported framework type if it exists and returns it
|
||||
*
|
||||
* @param string $type
|
||||
* @return string|false
|
||||
*/
|
||||
protected function findFrameworkType($type)
|
||||
{
|
||||
krsort($this->supportedTypes);
|
||||
|
||||
foreach ($this->supportedTypes as $key => $val) {
|
||||
if ($key === substr($type, 0, strlen($key))) {
|
||||
return substr($type, 0, strlen($key));
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the second part of the regular expression to check for support of a
|
||||
* package type
|
||||
*
|
||||
* @param string $frameworkType
|
||||
* @return string
|
||||
*/
|
||||
protected function getLocationPattern($frameworkType)
|
||||
{
|
||||
$pattern = false;
|
||||
if (!empty($this->supportedTypes[$frameworkType])) {
|
||||
$frameworkClass = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
|
||||
/** @var BaseInstaller $framework */
|
||||
$framework = new $frameworkClass(null, $this->composer, $this->getIO());
|
||||
$locations = array_keys($framework->getLocations());
|
||||
$pattern = $locations ? '(' . implode('|', $locations) . ')' : false;
|
||||
}
|
||||
|
||||
return $pattern ? : '(\w+)';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get I/O object
|
||||
*
|
||||
* @return IOInterface
|
||||
*/
|
||||
private function getIO()
|
||||
{
|
||||
return $this->io;
|
||||
}
|
||||
|
||||
/**
|
||||
* Look for installers set to be disabled in composer's extra config and
|
||||
* remove them from the list of supported installers.
|
||||
*
|
||||
* Globals:
|
||||
* - true, "all", and "*" - disable all installers.
|
||||
* - false - enable all installers (useful with
|
||||
* wikimedia/composer-merge-plugin or similar)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function removeDisabledInstallers()
|
||||
{
|
||||
$extra = $this->composer->getPackage()->getExtra();
|
||||
|
||||
if (!isset($extra['installer-disable']) || $extra['installer-disable'] === false) {
|
||||
// No installers are disabled
|
||||
return;
|
||||
}
|
||||
|
||||
// Get installers to disable
|
||||
$disable = $extra['installer-disable'];
|
||||
|
||||
// Ensure $disabled is an array
|
||||
if (!is_array($disable)) {
|
||||
$disable = array($disable);
|
||||
}
|
||||
|
||||
// Check which installers should be disabled
|
||||
$all = array(true, "all", "*");
|
||||
$intersect = array_intersect($all, $disable);
|
||||
if (!empty($intersect)) {
|
||||
// Disable all installers
|
||||
$this->supportedTypes = array();
|
||||
} else {
|
||||
// Disable specified installers
|
||||
foreach ($disable as $key => $installer) {
|
||||
if (is_string($installer) && key_exists($installer, $this->supportedTypes)) {
|
||||
unset($this->supportedTypes[$installer]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ItopInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'extension' => 'extensions/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class JoomlaInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'component' => 'components/{$name}/',
|
||||
'module' => 'modules/{$name}/',
|
||||
'template' => 'templates/{$name}/',
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
'library' => 'libraries/{$name}/',
|
||||
);
|
||||
|
||||
// TODO: Add inflector for mod_ and com_ names
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
*
|
||||
* Installer for kanboard plugins
|
||||
*
|
||||
* kanboard.net
|
||||
*
|
||||
* Class KanboardInstaller
|
||||
* @package Composer\Installers
|
||||
*/
|
||||
class KanboardInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class KirbyInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'site/plugins/{$name}/',
|
||||
'field' => 'site/fields/{$name}/',
|
||||
'tag' => 'site/tags/{$name}/'
|
||||
);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class KnownInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'IdnoPlugins/{$name}/',
|
||||
'theme' => 'Themes/{$name}/',
|
||||
'console' => 'ConsolePlugins/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class KodiCMSInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'cms/plugins/{$name}/',
|
||||
'media' => 'cms/media/vendor/{$name}/'
|
||||
);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class KohanaInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class LanManagementSystemInstaller extends BaseInstaller
|
||||
{
|
||||
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
'template' => 'templates/{$name}/',
|
||||
'document-template' => 'documents/templates/{$name}/',
|
||||
'userpanel-module' => 'userpanel/modules/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
$vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class LaravelInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'library' => 'libraries/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class LavaLiteInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'package' => 'packages/{$vendor}/{$name}/',
|
||||
'theme' => 'public/themes/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class LithiumInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'library' => 'libraries/{$name}/',
|
||||
'source' => 'libraries/_source/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MODULEWorkInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* An installer to handle MODX Evolution specifics when installing packages.
|
||||
*/
|
||||
class MODXEvoInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'snippet' => 'assets/snippets/{$name}/',
|
||||
'plugin' => 'assets/plugins/{$name}/',
|
||||
'module' => 'assets/modules/{$name}/',
|
||||
'template' => 'assets/templates/{$name}/',
|
||||
'lib' => 'assets/lib/{$name}/'
|
||||
);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MagentoInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'theme' => 'app/design/frontend/{$name}/',
|
||||
'skin' => 'skin/frontend/default/{$name}/',
|
||||
'library' => 'lib/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* Plugin/theme installer for majima
|
||||
* @author David Neustadt
|
||||
*/
|
||||
class MajimaInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Transforms the names
|
||||
* @param array $vars
|
||||
* @return array
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
return $this->correctPluginName($vars);
|
||||
}
|
||||
|
||||
/**
|
||||
* Change hyphenated names to camelcase
|
||||
* @param array $vars
|
||||
* @return array
|
||||
*/
|
||||
private function correctPluginName($vars)
|
||||
{
|
||||
$camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
|
||||
return strtoupper($matches[0][1]);
|
||||
}, $vars['name']);
|
||||
$vars['name'] = ucfirst($camelCasedName);
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MakoInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'package' => 'app/packages/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\DependencyResolver\Pool;
|
||||
|
||||
class MantisBTInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
$vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\Package\PackageInterface;
|
||||
|
||||
class MauticInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
'theme' => 'themes/{$name}/',
|
||||
'core' => 'app/',
|
||||
);
|
||||
|
||||
private function getDirectoryName()
|
||||
{
|
||||
$extra = $this->package->getExtra();
|
||||
if (!empty($extra['install-directory-name'])) {
|
||||
return $extra['install-directory-name'];
|
||||
}
|
||||
|
||||
return $this->toCamelCase($this->package->getPrettyName());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function toCamelCase($packageName)
|
||||
{
|
||||
return str_replace(' ', '', ucwords(str_replace('-', ' ', basename($packageName))));
|
||||
}
|
||||
|
||||
/**
|
||||
* Format package name of mautic-plugins to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
|
||||
if ($vars['type'] == 'mautic-plugin' || $vars['type'] == 'mautic-theme') {
|
||||
$directoryName = $this->getDirectoryName();
|
||||
$vars['name'] = $directoryName;
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MayaInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name.
|
||||
*
|
||||
* For package type maya-module, cut off a trailing '-module' if present.
|
||||
*
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
if ($vars['type'] === 'maya-module') {
|
||||
return $this->inflectModuleVars($vars);
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectModuleVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-module$/', '', $vars['name']);
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MediaWikiInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'core' => 'core/',
|
||||
'extension' => 'extensions/{$name}/',
|
||||
'skin' => 'skins/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name.
|
||||
*
|
||||
* For package type mediawiki-extension, cut off a trailing '-extension' if present and transform
|
||||
* to CamelCase keeping existing uppercase chars.
|
||||
*
|
||||
* For package type mediawiki-skin, cut off a trailing '-skin' if present.
|
||||
*
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
|
||||
if ($vars['type'] === 'mediawiki-extension') {
|
||||
return $this->inflectExtensionVars($vars);
|
||||
}
|
||||
|
||||
if ($vars['type'] === 'mediawiki-skin') {
|
||||
return $this->inflectSkinVars($vars);
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectExtensionVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-extension$/', '', $vars['name']);
|
||||
$vars['name'] = str_replace('-', ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectSkinVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-skin$/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MiaoxingInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MicroweberInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'userfiles/modules/{$install_item_dir}/',
|
||||
'module-skin' => 'userfiles/modules/{$install_item_dir}/templates/',
|
||||
'template' => 'userfiles/templates/{$install_item_dir}/',
|
||||
'element' => 'userfiles/elements/{$install_item_dir}/',
|
||||
'vendor' => 'vendor/{$install_item_dir}/',
|
||||
'components' => 'components/{$install_item_dir}/'
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name.
|
||||
*
|
||||
* For package type microweber-module, cut off a trailing '-module' if present
|
||||
*
|
||||
* For package type microweber-template, cut off a trailing '-template' if present.
|
||||
*
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
|
||||
|
||||
if ($this->package->getTargetDir()) {
|
||||
$vars['install_item_dir'] = $this->package->getTargetDir();
|
||||
} else {
|
||||
$vars['install_item_dir'] = $vars['name'];
|
||||
if ($vars['type'] === 'microweber-template') {
|
||||
return $this->inflectTemplateVars($vars);
|
||||
}
|
||||
if ($vars['type'] === 'microweber-templates') {
|
||||
return $this->inflectTemplatesVars($vars);
|
||||
}
|
||||
if ($vars['type'] === 'microweber-core') {
|
||||
return $this->inflectCoreVars($vars);
|
||||
}
|
||||
if ($vars['type'] === 'microweber-adapter') {
|
||||
return $this->inflectCoreVars($vars);
|
||||
}
|
||||
if ($vars['type'] === 'microweber-module') {
|
||||
return $this->inflectModuleVars($vars);
|
||||
}
|
||||
if ($vars['type'] === 'microweber-modules') {
|
||||
return $this->inflectModulesVars($vars);
|
||||
}
|
||||
if ($vars['type'] === 'microweber-skin') {
|
||||
return $this->inflectSkinVars($vars);
|
||||
}
|
||||
if ($vars['type'] === 'microweber-element' or $vars['type'] === 'microweber-elements') {
|
||||
return $this->inflectElementVars($vars);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectTemplateVars($vars)
|
||||
{
|
||||
$vars['install_item_dir'] = preg_replace('/-template$/', '', $vars['install_item_dir']);
|
||||
$vars['install_item_dir'] = preg_replace('/template-$/', '', $vars['install_item_dir']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectTemplatesVars($vars)
|
||||
{
|
||||
$vars['install_item_dir'] = preg_replace('/-templates$/', '', $vars['install_item_dir']);
|
||||
$vars['install_item_dir'] = preg_replace('/templates-$/', '', $vars['install_item_dir']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectCoreVars($vars)
|
||||
{
|
||||
$vars['install_item_dir'] = preg_replace('/-providers$/', '', $vars['install_item_dir']);
|
||||
$vars['install_item_dir'] = preg_replace('/-provider$/', '', $vars['install_item_dir']);
|
||||
$vars['install_item_dir'] = preg_replace('/-adapter$/', '', $vars['install_item_dir']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectModuleVars($vars)
|
||||
{
|
||||
$vars['install_item_dir'] = preg_replace('/-module$/', '', $vars['install_item_dir']);
|
||||
$vars['install_item_dir'] = preg_replace('/module-$/', '', $vars['install_item_dir']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectModulesVars($vars)
|
||||
{
|
||||
$vars['install_item_dir'] = preg_replace('/-modules$/', '', $vars['install_item_dir']);
|
||||
$vars['install_item_dir'] = preg_replace('/modules-$/', '', $vars['install_item_dir']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectSkinVars($vars)
|
||||
{
|
||||
$vars['install_item_dir'] = preg_replace('/-skin$/', '', $vars['install_item_dir']);
|
||||
$vars['install_item_dir'] = preg_replace('/skin-$/', '', $vars['install_item_dir']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectElementVars($vars)
|
||||
{
|
||||
$vars['install_item_dir'] = preg_replace('/-elements$/', '', $vars['install_item_dir']);
|
||||
$vars['install_item_dir'] = preg_replace('/elements-$/', '', $vars['install_item_dir']);
|
||||
$vars['install_item_dir'] = preg_replace('/-element$/', '', $vars['install_item_dir']);
|
||||
$vars['install_item_dir'] = preg_replace('/element-$/', '', $vars['install_item_dir']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* An installer to handle MODX specifics when installing packages.
|
||||
*/
|
||||
class ModxInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'extra' => 'core/packages/{$name}/'
|
||||
);
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MoodleInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'mod' => 'mod/{$name}/',
|
||||
'admin_report' => 'admin/report/{$name}/',
|
||||
'atto' => 'lib/editor/atto/plugins/{$name}/',
|
||||
'tool' => 'admin/tool/{$name}/',
|
||||
'assignment' => 'mod/assignment/type/{$name}/',
|
||||
'assignsubmission' => 'mod/assign/submission/{$name}/',
|
||||
'assignfeedback' => 'mod/assign/feedback/{$name}/',
|
||||
'auth' => 'auth/{$name}/',
|
||||
'availability' => 'availability/condition/{$name}/',
|
||||
'block' => 'blocks/{$name}/',
|
||||
'booktool' => 'mod/book/tool/{$name}/',
|
||||
'cachestore' => 'cache/stores/{$name}/',
|
||||
'cachelock' => 'cache/locks/{$name}/',
|
||||
'calendartype' => 'calendar/type/{$name}/',
|
||||
'fileconverter' => 'files/converter/{$name}/',
|
||||
'format' => 'course/format/{$name}/',
|
||||
'coursereport' => 'course/report/{$name}/',
|
||||
'customcertelement' => 'mod/customcert/element/{$name}/',
|
||||
'datafield' => 'mod/data/field/{$name}/',
|
||||
'datapreset' => 'mod/data/preset/{$name}/',
|
||||
'editor' => 'lib/editor/{$name}/',
|
||||
'enrol' => 'enrol/{$name}/',
|
||||
'filter' => 'filter/{$name}/',
|
||||
'gradeexport' => 'grade/export/{$name}/',
|
||||
'gradeimport' => 'grade/import/{$name}/',
|
||||
'gradereport' => 'grade/report/{$name}/',
|
||||
'gradingform' => 'grade/grading/form/{$name}/',
|
||||
'local' => 'local/{$name}/',
|
||||
'logstore' => 'admin/tool/log/store/{$name}/',
|
||||
'ltisource' => 'mod/lti/source/{$name}/',
|
||||
'ltiservice' => 'mod/lti/service/{$name}/',
|
||||
'message' => 'message/output/{$name}/',
|
||||
'mnetservice' => 'mnet/service/{$name}/',
|
||||
'plagiarism' => 'plagiarism/{$name}/',
|
||||
'portfolio' => 'portfolio/{$name}/',
|
||||
'qbehaviour' => 'question/behaviour/{$name}/',
|
||||
'qformat' => 'question/format/{$name}/',
|
||||
'qtype' => 'question/type/{$name}/',
|
||||
'quizaccess' => 'mod/quiz/accessrule/{$name}/',
|
||||
'quiz' => 'mod/quiz/report/{$name}/',
|
||||
'report' => 'report/{$name}/',
|
||||
'repository' => 'repository/{$name}/',
|
||||
'scormreport' => 'mod/scorm/report/{$name}/',
|
||||
'search' => 'search/engine/{$name}/',
|
||||
'theme' => 'theme/{$name}/',
|
||||
'tinymce' => 'lib/editor/tinymce/plugins/{$name}/',
|
||||
'profilefield' => 'user/profile/field/{$name}/',
|
||||
'webservice' => 'webservice/{$name}/',
|
||||
'workshopallocation' => 'mod/workshop/allocation/{$name}/',
|
||||
'workshopeval' => 'mod/workshop/eval/{$name}/',
|
||||
'workshopform' => 'mod/workshop/form/{$name}/'
|
||||
);
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class OctoberInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
'plugin' => 'plugins/{$vendor}/{$name}/',
|
||||
'theme' => 'themes/{$vendor}-{$name}/'
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name.
|
||||
*
|
||||
* For package type october-plugin, cut off a trailing '-plugin' if present.
|
||||
*
|
||||
* For package type october-theme, cut off a trailing '-theme' if present.
|
||||
*
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
if ($vars['type'] === 'october-plugin') {
|
||||
return $this->inflectPluginVars($vars);
|
||||
}
|
||||
|
||||
if ($vars['type'] === 'october-theme') {
|
||||
return $this->inflectThemeVars($vars);
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectPluginVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/^oc-|-plugin$/', '', $vars['name']);
|
||||
$vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectThemeVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/^oc-|-theme$/', '', $vars['name']);
|
||||
$vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class OntoWikiInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'extension' => 'extensions/{$name}/',
|
||||
'theme' => 'extensions/themes/{$name}/',
|
||||
'translation' => 'extensions/translations/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to lower case and remove ".ontowiki" suffix
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
$vars['name'] = strtolower($vars['name']);
|
||||
$vars['name'] = preg_replace('/.ontowiki$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/-translation$/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
|
||||
class OsclassInstaller extends BaseInstaller
|
||||
{
|
||||
|
||||
protected $locations = array(
|
||||
'plugin' => 'oc-content/plugins/{$name}/',
|
||||
'theme' => 'oc-content/themes/{$name}/',
|
||||
'language' => 'oc-content/languages/{$name}/',
|
||||
);
|
||||
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PPIInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PantheonInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'script' => 'web/private/scripts/quicksilver/{$name}',
|
||||
'module' => 'web/private/scripts/quicksilver/{$name}',
|
||||
);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PhiftyInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'bundle' => 'bundles/{$name}/',
|
||||
'library' => 'libraries/{$name}/',
|
||||
'framework' => 'frameworks/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PhpBBInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'extension' => 'ext/{$vendor}/{$name}/',
|
||||
'language' => 'language/{$name}/',
|
||||
'style' => 'styles/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PimcoreInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
$vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* Class PiwikInstaller
|
||||
*
|
||||
* @package Composer\Installers
|
||||
*/
|
||||
class PiwikInstaller extends BaseInstaller
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
* @param array $vars
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
$vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PlentymarketsInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => '{$name}/'
|
||||
);
|
||||
|
||||
/**
|
||||
* Remove hyphen, "plugin" and format to camelcase
|
||||
* @param array $vars
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
$vars['name'] = explode("-", $vars['name']);
|
||||
foreach ($vars['name'] as $key => $name) {
|
||||
$vars['name'][$key] = ucfirst($vars['name'][$key]);
|
||||
if (strcasecmp($name, "Plugin") == 0) {
|
||||
unset($vars['name'][$key]);
|
||||
}
|
||||
}
|
||||
$vars['name'] = implode("",$vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\Composer;
|
||||
use Composer\IO\IOInterface;
|
||||
use Composer\Plugin\PluginInterface;
|
||||
|
||||
class Plugin implements PluginInterface
|
||||
{
|
||||
private $installer;
|
||||
|
||||
public function activate(Composer $composer, IOInterface $io)
|
||||
{
|
||||
$this->installer = new Installer($io, $composer);
|
||||
$composer->getInstallationManager()->addInstaller($this->installer);
|
||||
}
|
||||
|
||||
public function deactivate(Composer $composer, IOInterface $io)
|
||||
{
|
||||
$composer->getInstallationManager()->removeInstaller($this->installer);
|
||||
}
|
||||
|
||||
public function uninstall(Composer $composer, IOInterface $io)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PortoInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'container' => 'app/Containers/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PrestashopInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
'theme' => 'themes/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ProcessWireInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'site/modules/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
$vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PuppetInstaller extends BaseInstaller
|
||||
{
|
||||
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PxcmsInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'app/Modules/{$name}/',
|
||||
'theme' => 'themes/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name.
|
||||
*
|
||||
* @param array $vars
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
if ($vars['type'] === 'pxcms-module') {
|
||||
return $this->inflectModuleVars($vars);
|
||||
}
|
||||
|
||||
if ($vars['type'] === 'pxcms-theme') {
|
||||
return $this->inflectThemeVars($vars);
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* For package type pxcms-module, cut off a trailing '-plugin' if present.
|
||||
*
|
||||
* return string
|
||||
*/
|
||||
protected function inflectModuleVars($vars)
|
||||
{
|
||||
$vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy)
|
||||
$vars['name'] = str_replace('module-', '', $vars['name']); // strip out module-
|
||||
$vars['name'] = preg_replace('/-module$/', '', $vars['name']); // strip out -module
|
||||
$vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s
|
||||
$vars['name'] = ucwords($vars['name']); // make module name camelcased
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For package type pxcms-module, cut off a trailing '-plugin' if present.
|
||||
*
|
||||
* return string
|
||||
*/
|
||||
protected function inflectThemeVars($vars)
|
||||
{
|
||||
$vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy)
|
||||
$vars['name'] = str_replace('theme-', '', $vars['name']); // strip out theme-
|
||||
$vars['name'] = preg_replace('/-theme$/', '', $vars['name']); // strip out -theme
|
||||
$vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s
|
||||
$vars['name'] = ucwords($vars['name']); // make module name camelcased
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class RadPHPInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'bundle' => 'src/{$name}/'
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
$nameParts = explode('/', $vars['name']);
|
||||
foreach ($nameParts as &$value) {
|
||||
$value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
|
||||
$value = str_replace(array('-', '_'), ' ', $value);
|
||||
$value = str_replace(' ', '', ucwords($value));
|
||||
}
|
||||
$vars['name'] = implode('/', $nameParts);
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ReIndexInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'theme' => 'themes/{$name}/',
|
||||
'plugin' => 'plugins/{$name}/'
|
||||
);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class Redaxo5Installer extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'addon' => 'redaxo/src/addons/{$name}/',
|
||||
'bestyle-plugin' => 'redaxo/src/addons/be_style/plugins/{$name}/'
|
||||
);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class RedaxoInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'addon' => 'redaxo/include/addons/{$name}/',
|
||||
'bestyle-plugin' => 'redaxo/include/addons/be_style/plugins/{$name}/'
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class RoundcubeInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Lowercase name and changes the name to a underscores
|
||||
*
|
||||
* @param array $vars
|
||||
* @return array
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
$vars['name'] = strtolower(str_replace('-', '_', $vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class SMFInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'Sources/{$name}/',
|
||||
'theme' => 'Themes/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* Plugin/theme installer for shopware
|
||||
* @author Benjamin Boit
|
||||
*/
|
||||
class ShopwareInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'backend-plugin' => 'engine/Shopware/Plugins/Local/Backend/{$name}/',
|
||||
'core-plugin' => 'engine/Shopware/Plugins/Local/Core/{$name}/',
|
||||
'frontend-plugin' => 'engine/Shopware/Plugins/Local/Frontend/{$name}/',
|
||||
'theme' => 'templates/{$name}/',
|
||||
'plugin' => 'custom/plugins/{$name}/',
|
||||
'frontend-theme' => 'themes/Frontend/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Transforms the names
|
||||
* @param array $vars
|
||||
* @return array
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
if ($vars['type'] === 'shopware-theme') {
|
||||
return $this->correctThemeName($vars);
|
||||
}
|
||||
|
||||
return $this->correctPluginName($vars);
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the name to a camelcased combination of vendor and name
|
||||
* @param array $vars
|
||||
* @return array
|
||||
*/
|
||||
private function correctPluginName($vars)
|
||||
{
|
||||
$camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
|
||||
return strtoupper($matches[0][1]);
|
||||
}, $vars['name']);
|
||||
|
||||
$vars['name'] = ucfirst($vars['vendor']) . ucfirst($camelCasedName);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the name to a underscore separated name
|
||||
* @param array $vars
|
||||
* @return array
|
||||
*/
|
||||
private function correctThemeName($vars)
|
||||
{
|
||||
$vars['name'] = str_replace('-', '_', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\Package\PackageInterface;
|
||||
|
||||
class SilverStripeInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => '{$name}/',
|
||||
'theme' => 'themes/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Return the install path based on package type.
|
||||
*
|
||||
* Relies on built-in BaseInstaller behaviour with one exception: silverstripe/framework
|
||||
* must be installed to 'sapphire' and not 'framework' if the version is <3.0.0
|
||||
*
|
||||
* @param PackageInterface $package
|
||||
* @param string $frameworkType
|
||||
* @return string
|
||||
*/
|
||||
public function getInstallPath(PackageInterface $package, $frameworkType = '')
|
||||
{
|
||||
if (
|
||||
$package->getName() == 'silverstripe/framework'
|
||||
&& preg_match('/^\d+\.\d+\.\d+/', $package->getVersion())
|
||||
&& version_compare($package->getVersion(), '2.999.999') < 0
|
||||
) {
|
||||
return $this->templatePath($this->locations['module'], array('name' => 'sapphire'));
|
||||
}
|
||||
|
||||
return parent::getInstallPath($package, $frameworkType);
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class SiteDirectInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$vendor}/{$name}/',
|
||||
'plugin' => 'plugins/{$vendor}/{$name}/'
|
||||
);
|
||||
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
return $this->parseVars($vars);
|
||||
}
|
||||
|
||||
protected function parseVars($vars)
|
||||
{
|
||||
$vars['vendor'] = strtolower($vars['vendor']) == 'sitedirect' ? 'SiteDirect' : $vars['vendor'];
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class StarbugInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
'theme' => 'themes/{$name}/',
|
||||
'custom-module' => 'app/modules/{$name}/',
|
||||
'custom-theme' => 'app/themes/{$name}/'
|
||||
);
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class SyDESInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'app/modules/{$name}/',
|
||||
'theme' => 'themes/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format module name.
|
||||
*
|
||||
* Strip `sydes-` prefix and a trailing '-theme' or '-module' from package name if present.
|
||||
*
|
||||
* {@inerhitDoc}
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
if ($vars['type'] == 'sydes-module') {
|
||||
return $this->inflectModuleVars($vars);
|
||||
}
|
||||
|
||||
if ($vars['type'] === 'sydes-theme') {
|
||||
return $this->inflectThemeVars($vars);
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
public function inflectModuleVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/(^sydes-|-module$)/i', '', $vars['name']);
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectThemeVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/(^sydes-|-theme$)/', '', $vars['name']);
|
||||
$vars['name'] = strtolower($vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class SyliusInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'theme' => 'themes/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* Plugin installer for symfony 1.x
|
||||
*
|
||||
* @author Jérôme Tamarelle <jerome@tamarelle.net>
|
||||
*/
|
||||
class Symfony1Installer extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) {
|
||||
return strtoupper($matches[0][1]);
|
||||
}, $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* Extension installer for TYPO3 CMS
|
||||
*
|
||||
* @deprecated since 1.0.25, use https://packagist.org/packages/typo3/cms-composer-installers instead
|
||||
*
|
||||
* @author Sascha Egerer <sascha.egerer@dkd.de>
|
||||
*/
|
||||
class TYPO3CmsInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'extension' => 'typo3conf/ext/{$name}/',
|
||||
);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user