From 9868d5c64f6fb349a5c4995cf524006c43dc2523 Mon Sep 17 00:00:00 2001 From: Leonardo Marino-Ramirez Date: Thu, 1 Feb 2018 08:42:56 -0500 Subject: [PATCH] composer.json update --- composer.lock | 132 ----- vendor/autoload.php | 7 - vendor/bin/rcubeinitdb.sh | 1 - vendor/composer/ClassLoader.php | 445 -------------- vendor/composer/LICENSE | 21 - vendor/composer/autoload_classmap.php | 9 - vendor/composer/autoload_namespaces.php | 10 - vendor/composer/autoload_psr4.php | 10 - vendor/composer/autoload_real.php | 52 -- vendor/composer/autoload_static.php | 42 -- vendor/composer/installed.json | 118 ---- vendor/composer/semver/CHANGELOG.md | 66 --- vendor/composer/semver/LICENSE | 19 - vendor/composer/semver/README.md | 70 --- vendor/composer/semver/composer.json | 58 -- vendor/composer/semver/src/Comparator.php | 111 ---- .../src/Constraint/AbstractConstraint.php | 63 -- .../semver/src/Constraint/Constraint.php | 219 ------- .../src/Constraint/ConstraintInterface.php | 32 - .../semver/src/Constraint/EmptyConstraint.php | 59 -- .../semver/src/Constraint/MultiConstraint.php | 120 ---- vendor/composer/semver/src/Semver.php | 127 ---- vendor/composer/semver/src/VersionParser.php | 548 ------------------ vendor/roundcube/plugin-installer/.gitignore | 2 - vendor/roundcube/plugin-installer/README.md | 46 -- .../roundcube/plugin-installer/composer.json | 34 -- .../Roundcube/Composer/PluginInstaller.php | 280 --------- .../plugin-installer/src/bin/rcubeinitdb.sh | 130 ----- 28 files changed, 2831 deletions(-) delete mode 100644 composer.lock delete mode 100644 vendor/autoload.php delete mode 120000 vendor/bin/rcubeinitdb.sh delete mode 100644 vendor/composer/ClassLoader.php delete mode 100644 vendor/composer/LICENSE delete mode 100644 vendor/composer/autoload_classmap.php delete mode 100644 vendor/composer/autoload_namespaces.php delete mode 100644 vendor/composer/autoload_psr4.php delete mode 100644 vendor/composer/autoload_real.php delete mode 100644 vendor/composer/autoload_static.php delete mode 100644 vendor/composer/installed.json delete mode 100644 vendor/composer/semver/CHANGELOG.md delete mode 100644 vendor/composer/semver/LICENSE delete mode 100644 vendor/composer/semver/README.md delete mode 100644 vendor/composer/semver/composer.json delete mode 100644 vendor/composer/semver/src/Comparator.php delete mode 100644 vendor/composer/semver/src/Constraint/AbstractConstraint.php delete mode 100644 vendor/composer/semver/src/Constraint/Constraint.php delete mode 100644 vendor/composer/semver/src/Constraint/ConstraintInterface.php delete mode 100644 vendor/composer/semver/src/Constraint/EmptyConstraint.php delete mode 100644 vendor/composer/semver/src/Constraint/MultiConstraint.php delete mode 100644 vendor/composer/semver/src/Semver.php delete mode 100644 vendor/composer/semver/src/VersionParser.php delete mode 100644 vendor/roundcube/plugin-installer/.gitignore delete mode 100644 vendor/roundcube/plugin-installer/README.md delete mode 100644 vendor/roundcube/plugin-installer/composer.json delete mode 100644 vendor/roundcube/plugin-installer/src/Roundcube/Composer/PluginInstaller.php delete mode 100755 vendor/roundcube/plugin-installer/src/bin/rcubeinitdb.sh diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 578bced..0000000 --- a/composer.lock +++ /dev/null @@ -1,132 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "content-hash": "2098128ed67f0fb4067eb3647cbf7c92", - "packages": [ - { - "name": "composer/semver", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5", - "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "time": "2016-08-30T16:08:34+00:00" - }, - { - "name": "roundcube/plugin-installer", - "version": "0.1.9", - "source": { - "type": "git", - "url": "https://github.com/roundcube/plugin-installer.git", - "reference": "782420af7fb3f24295a61101d7e9296110c894e4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/roundcube/plugin-installer/zipball/782420af7fb3f24295a61101d7e9296110c894e4", - "reference": "782420af7fb3f24295a61101d7e9296110c894e4", - "shasum": "" - }, - "require": { - "composer/semver": "^1.4.2", - "php": ">=5.3.0" - }, - "require-dev": { - "composer/composer": "*" - }, - "bin": [ - "src/bin/rcubeinitdb.sh" - ], - "type": "composer-installer", - "extra": { - "class": "Roundcube\\Composer\\PluginInstaller" - }, - "autoload": { - "psr-0": { - "Roundcube\\Composer": "src/" - } - }, - "notification-url": "https://plugins.roundcube.net/downloads/", - "license": [ - "GPL-3.0+" - ], - "authors": [ - { - "name": "Till Klampaeckel", - "email": "till@php.net" - }, - { - "name": "Thomas Bruederli", - "email": "thomas@roundcube.net" - } - ], - "description": "A composer-installer for Roundcube plugins.", - "time": "2017-10-29T16:13:28+00:00" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=5.3.0" - }, - "platform-dev": [] -} diff --git a/vendor/autoload.php b/vendor/autoload.php deleted file mode 100644 index 5667704..0000000 --- a/vendor/autoload.php +++ /dev/null @@ -1,7 +0,0 @@ - - * Jordi Boggiano - * - * 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 - * @author Jordi Boggiano - * @see http://www.php-fig.org/psr/psr-0/ - * @see http://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - // PSR-4 - private $prefixLengthsPsr4 = array(); - private $prefixDirsPsr4 = array(); - private $fallbackDirsPsr4 = array(); - - // PSR-0 - private $prefixesPsr0 = array(); - private $fallbackDirsPsr0 = array(); - - private $useIncludePath = false; - private $classMap = array(); - private $classMapAuthoritative = false; - private $missingClasses = array(); - private $apcuPrefix; - - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', $this->prefixesPsr0); - } - - return array(); - } - - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - */ - 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 array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - */ - public function add($prefix, $paths, $prepend = false) - { - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - (array) $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - (array) $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - (array) $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 array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - (array) $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - (array) $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] = (array) $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - (array) $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 array|string $paths The PSR-0 base directories - */ - 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 array|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - */ - 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 - */ - 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 - */ - 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 - */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $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 - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - includeFile($file); - - return true; - } - } - - /** - * 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; - } - - 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])) { - foreach ($this->prefixDirsPsr4[$search] as $dir) { - $length = $this->prefixLengthsPsr4[$first][$search]; - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { - 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; - } -} - -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -function includeFile($file) -{ - include $file; -} diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE deleted file mode 100644 index f27399a..0000000 --- a/vendor/composer/LICENSE +++ /dev/null @@ -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. - diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php deleted file mode 100644 index 7a91153..0000000 --- a/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,9 +0,0 @@ - array($vendorDir . '/roundcube/plugin-installer/src'), -); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php deleted file mode 100644 index aaa5f2a..0000000 --- a/vendor/composer/autoload_psr4.php +++ /dev/null @@ -1,10 +0,0 @@ - array($vendorDir . '/composer/semver/src'), -); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php deleted file mode 100644 index 0840b56..0000000 --- a/vendor/composer/autoload_real.php +++ /dev/null @@ -1,52 +0,0 @@ -= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require_once __DIR__ . '/autoload_static.php'; - - call_user_func(\Composer\Autoload\ComposerStaticInite87495ff3fdfc67b7c5bda474a9d8986::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } - - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } - - $loader->register(true); - - return $loader; - } -} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php deleted file mode 100644 index 04667ee..0000000 --- a/vendor/composer/autoload_static.php +++ /dev/null @@ -1,42 +0,0 @@ - - array ( - 'Composer\\Semver\\' => 16, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'Composer\\Semver\\' => - array ( - 0 => __DIR__ . '/..' . '/composer/semver/src', - ), - ); - - public static $prefixesPsr0 = array ( - 'R' => - array ( - 'Roundcube\\Composer' => - array ( - 0 => __DIR__ . '/..' . '/roundcube/plugin-installer/src', - ), - ), - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInite87495ff3fdfc67b7c5bda474a9d8986::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInite87495ff3fdfc67b7c5bda474a9d8986::$prefixDirsPsr4; - $loader->prefixesPsr0 = ComposerStaticInite87495ff3fdfc67b7c5bda474a9d8986::$prefixesPsr0; - - }, null, ClassLoader::class); - } -} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json deleted file mode 100644 index 0fa55f1..0000000 --- a/vendor/composer/installed.json +++ /dev/null @@ -1,118 +0,0 @@ -[ - { - "name": "composer/semver", - "version": "1.4.2", - "version_normalized": "1.4.2.0", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5", - "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" - }, - "time": "2016-08-30T16:08:34+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ] - }, - { - "name": "roundcube/plugin-installer", - "version": "0.1.9", - "version_normalized": "0.1.9.0", - "source": { - "type": "git", - "url": "https://github.com/roundcube/plugin-installer.git", - "reference": "782420af7fb3f24295a61101d7e9296110c894e4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/roundcube/plugin-installer/zipball/782420af7fb3f24295a61101d7e9296110c894e4", - "reference": "782420af7fb3f24295a61101d7e9296110c894e4", - "shasum": "" - }, - "require": { - "composer/semver": "^1.4.2", - "php": ">=5.3.0" - }, - "require-dev": { - "composer/composer": "*" - }, - "time": "2017-10-29T16:13:28+00:00", - "bin": [ - "src/bin/rcubeinitdb.sh" - ], - "type": "composer-installer", - "extra": { - "class": "Roundcube\\Composer\\PluginInstaller" - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Roundcube\\Composer": "src/" - } - }, - "notification-url": "https://plugins.roundcube.net/downloads/", - "license": [ - "GPL-3.0+" - ], - "authors": [ - { - "name": "Till Klampaeckel", - "email": "till@php.net" - }, - { - "name": "Thomas Bruederli", - "email": "thomas@roundcube.net" - } - ], - "description": "A composer-installer for Roundcube plugins." - } -] diff --git a/vendor/composer/semver/CHANGELOG.md b/vendor/composer/semver/CHANGELOG.md deleted file mode 100644 index febedc9..0000000 --- a/vendor/composer/semver/CHANGELOG.md +++ /dev/null @@ -1,66 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -This project adheres to [Semantic Versioning](http://semver.org/). - -### [1.4.2] 2016-08-30 - - * Fixed: collapsing of complex constraints lead to buggy constraints - -### [1.4.1] 2016-06-02 - - * Changed: branch-like requirements no longer strip build metadata - [composer/semver#38](https://github.com/composer/semver/pull/38). - -### [1.4.0] 2016-03-30 - - * Added: getters on MultiConstraint - [composer/semver#35](https://github.com/composer/semver/pull/35). - -### [1.3.0] 2016-02-25 - - * Fixed: stability parsing - [composer/composer#1234](https://github.com/composer/composer/issues/4889). - * Changed: collapse contiguous constraints when possible. - -### [1.2.0] 2015-11-10 - - * Changed: allow multiple numerical identifiers in 'pre-release' version part. - * Changed: add more 'v' prefix support. - -### [1.1.0] 2015-11-03 - - * Changed: dropped redundant `test` namespace. - * Changed: minor adjustment in datetime parsing normalization. - * Changed: `ConstraintInterface` relaxed, setPrettyString is not required anymore. - * Changed: `AbstractConstraint` marked deprecated, will be removed in 2.0. - * Changed: `Constraint` is now extensible. - -### [1.0.0] 2015-09-21 - - * Break: `VersionConstraint` renamed to `Constraint`. - * Break: `SpecificConstraint` renamed to `AbstractConstraint`. - * Break: `LinkConstraintInterface` renamed to `ConstraintInterface`. - * Break: `VersionParser::parseNameVersionPairs` was removed. - * Changed: `VersionParser::parseConstraints` allows (but ignores) build metadata now. - * Changed: `VersionParser::parseConstraints` allows (but ignores) prefixing numeric versions with a 'v' now. - * Changed: Fixed namespace(s) of test files. - * Changed: `Comparator::compare` no longer throws `InvalidArgumentException`. - * Changed: `Constraint` now throws `InvalidArgumentException`. - -### [0.1.0] 2015-07-23 - - * Added: `Composer\Semver\Comparator`, various methods to compare versions. - * Added: various documents such as README.md, LICENSE, etc. - * Added: configuration files for Git, Travis, php-cs-fixer, phpunit. - * Break: the following namespaces were renamed: - - Namespace: `Composer\Package\Version` -> `Composer\Semver` - - Namespace: `Composer\Package\LinkConstraint` -> `Composer\Semver\Constraint` - - Namespace: `Composer\Test\Package\Version` -> `Composer\Test\Semver` - - Namespace: `Composer\Test\Package\LinkConstraint` -> `Composer\Test\Semver\Constraint` - * Changed: code style using php-cs-fixer. - -[1.4.1]: https://github.com/composer/semver/compare/1.4.0...1.4.1 -[1.4.0]: https://github.com/composer/semver/compare/1.3.0...1.4.0 -[1.3.0]: https://github.com/composer/semver/compare/1.2.0...1.3.0 -[1.2.0]: https://github.com/composer/semver/compare/1.1.0...1.2.0 -[1.1.0]: https://github.com/composer/semver/compare/1.0.0...1.1.0 -[1.0.0]: https://github.com/composer/semver/compare/0.1.0...1.0.0 -[0.1.0]: https://github.com/composer/semver/compare/5e0b9a4da...0.1.0 diff --git a/vendor/composer/semver/LICENSE b/vendor/composer/semver/LICENSE deleted file mode 100644 index 4669758..0000000 --- a/vendor/composer/semver/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2015 Composer - -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. diff --git a/vendor/composer/semver/README.md b/vendor/composer/semver/README.md deleted file mode 100644 index 143daa0..0000000 --- a/vendor/composer/semver/README.md +++ /dev/null @@ -1,70 +0,0 @@ -composer/semver -=============== - -Semver library that offers utilities, version constraint parsing and validation. - -Originally written as part of [composer/composer](https://github.com/composer/composer), -now extracted and made available as a stand-alone library. - -[![Build Status](https://travis-ci.org/composer/semver.svg?branch=master)](https://travis-ci.org/composer/semver) - - -Installation ------------- - -Install the latest version with: - -```bash -$ composer require composer/semver -``` - - -Requirements ------------- - -* PHP 5.3.2 is required but using the latest version of PHP is highly recommended. - - -Version Comparison ------------------- - -For details on how versions are compared, refer to the [Versions](https://getcomposer.org/doc/articles/versions.md) -article in the documentation section of the [getcomposer.org](https://getcomposer.org) website. - - -Basic usage ------------ - -### Comparator - -The `Composer\Semver\Comparator` class provides the following methods for comparing versions: - -* greaterThan($v1, $v2) -* greaterThanOrEqualTo($v1, $v2) -* lessThan($v1, $v2) -* lessThanOrEqualTo($v1, $v2) -* equalTo($v1, $v2) -* notEqualTo($v1, $v2) - -Each function takes two version strings as arguments. For example: - -```php -use Composer\Semver\Comparator; - -Comparator::greaterThan('1.25.0', '1.24.0'); // 1.25.0 > 1.24.0 -``` - -### Semver - -The `Composer\Semver\Semver` class provides the following methods: - -* satisfies($version, $constraints) -* satisfiedBy(array $versions, $constraint) -* sort($versions) -* rsort($versions) - - -License -------- - -composer/semver is licensed under the MIT License, see the LICENSE file for details. diff --git a/vendor/composer/semver/composer.json b/vendor/composer/semver/composer.json deleted file mode 100644 index b0400cd..0000000 --- a/vendor/composer/semver/composer.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "composer/semver", - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "type": "library", - "license": "MIT", - "keywords": [ - "semver", - "semantic", - "versioning", - "validation" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/semver/issues" - }, - "require": { - "php": "^5.3.2 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5", - "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Composer\\Semver\\": "tests" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "scripts": { - "test": "phpunit" - } -} diff --git a/vendor/composer/semver/src/Comparator.php b/vendor/composer/semver/src/Comparator.php deleted file mode 100644 index a9d758f..0000000 --- a/vendor/composer/semver/src/Comparator.php +++ /dev/null @@ -1,111 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Semver; - -use Composer\Semver\Constraint\Constraint; - -class Comparator -{ - /** - * Evaluates the expression: $version1 > $version2. - * - * @param string $version1 - * @param string $version2 - * - * @return bool - */ - public static function greaterThan($version1, $version2) - { - return self::compare($version1, '>', $version2); - } - - /** - * Evaluates the expression: $version1 >= $version2. - * - * @param string $version1 - * @param string $version2 - * - * @return bool - */ - public static function greaterThanOrEqualTo($version1, $version2) - { - return self::compare($version1, '>=', $version2); - } - - /** - * Evaluates the expression: $version1 < $version2. - * - * @param string $version1 - * @param string $version2 - * - * @return bool - */ - public static function lessThan($version1, $version2) - { - return self::compare($version1, '<', $version2); - } - - /** - * Evaluates the expression: $version1 <= $version2. - * - * @param string $version1 - * @param string $version2 - * - * @return bool - */ - public static function lessThanOrEqualTo($version1, $version2) - { - return self::compare($version1, '<=', $version2); - } - - /** - * Evaluates the expression: $version1 == $version2. - * - * @param string $version1 - * @param string $version2 - * - * @return bool - */ - public static function equalTo($version1, $version2) - { - return self::compare($version1, '==', $version2); - } - - /** - * Evaluates the expression: $version1 != $version2. - * - * @param string $version1 - * @param string $version2 - * - * @return bool - */ - public static function notEqualTo($version1, $version2) - { - return self::compare($version1, '!=', $version2); - } - - /** - * Evaluates the expression: $version1 $operator $version2. - * - * @param string $version1 - * @param string $operator - * @param string $version2 - * - * @return bool - */ - public static function compare($version1, $operator, $version2) - { - $constraint = new Constraint($operator, $version2); - - return $constraint->matches(new Constraint('==', $version1)); - } -} diff --git a/vendor/composer/semver/src/Constraint/AbstractConstraint.php b/vendor/composer/semver/src/Constraint/AbstractConstraint.php deleted file mode 100644 index be83f75..0000000 --- a/vendor/composer/semver/src/Constraint/AbstractConstraint.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Semver\Constraint; - -trigger_error('The ' . __CLASS__ . ' abstract class is deprecated, there is no replacement for it, it will be removed in the next major version.', E_USER_DEPRECATED); - -/** - * Base constraint class. - */ -abstract class AbstractConstraint implements ConstraintInterface -{ - /** @var string */ - protected $prettyString; - - /** - * @param ConstraintInterface $provider - * - * @return bool - */ - public function matches(ConstraintInterface $provider) - { - if ($provider instanceof $this) { - // see note at bottom of this class declaration - return $this->matchSpecific($provider); - } - - // turn matching around to find a match - return $provider->matches($this); - } - - /** - * @param string $prettyString - */ - public function setPrettyString($prettyString) - { - $this->prettyString = $prettyString; - } - - /** - * @return string - */ - public function getPrettyString() - { - if ($this->prettyString) { - return $this->prettyString; - } - - return $this->__toString(); - } - - // implementations must implement a method of this format: - // not declared abstract here because type hinting violates parameter coherence (TODO right word?) - // public function matchSpecific( $provider); -} diff --git a/vendor/composer/semver/src/Constraint/Constraint.php b/vendor/composer/semver/src/Constraint/Constraint.php deleted file mode 100644 index 7a21eb4..0000000 --- a/vendor/composer/semver/src/Constraint/Constraint.php +++ /dev/null @@ -1,219 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Semver\Constraint; - -/** - * Defines a constraint. - */ -class Constraint implements ConstraintInterface -{ - /* operator integer values */ - const OP_EQ = 0; - const OP_LT = 1; - const OP_LE = 2; - const OP_GT = 3; - const OP_GE = 4; - const OP_NE = 5; - - /** - * Operator to integer translation table. - * - * @var array - */ - private static $transOpStr = array( - '=' => self::OP_EQ, - '==' => self::OP_EQ, - '<' => self::OP_LT, - '<=' => self::OP_LE, - '>' => self::OP_GT, - '>=' => self::OP_GE, - '<>' => self::OP_NE, - '!=' => self::OP_NE, - ); - - /** - * Integer to operator translation table. - * - * @var array - */ - private static $transOpInt = array( - self::OP_EQ => '==', - self::OP_LT => '<', - self::OP_LE => '<=', - self::OP_GT => '>', - self::OP_GE => '>=', - self::OP_NE => '!=', - ); - - /** @var string */ - protected $operator; - - /** @var string */ - protected $version; - - /** @var string */ - protected $prettyString; - - /** - * @param ConstraintInterface $provider - * - * @return bool - */ - public function matches(ConstraintInterface $provider) - { - if ($provider instanceof $this) { - return $this->matchSpecific($provider); - } - - // turn matching around to find a match - return $provider->matches($this); - } - - /** - * @param string $prettyString - */ - public function setPrettyString($prettyString) - { - $this->prettyString = $prettyString; - } - - /** - * @return string - */ - public function getPrettyString() - { - if ($this->prettyString) { - return $this->prettyString; - } - - return $this->__toString(); - } - - /** - * Get all supported comparison operators. - * - * @return array - */ - public static function getSupportedOperators() - { - return array_keys(self::$transOpStr); - } - - /** - * Sets operator and version to compare with. - * - * @param string $operator - * @param string $version - * - * @throws \InvalidArgumentException if invalid operator is given. - */ - public function __construct($operator, $version) - { - if (!isset(self::$transOpStr[$operator])) { - throw new \InvalidArgumentException(sprintf( - 'Invalid operator "%s" given, expected one of: %s', - $operator, - implode(', ', self::getSupportedOperators()) - )); - } - - $this->operator = self::$transOpStr[$operator]; - $this->version = $version; - } - - /** - * @param string $a - * @param string $b - * @param string $operator - * @param bool $compareBranches - * - * @throws \InvalidArgumentException if invalid operator is given. - * - * @return bool - */ - public function versionCompare($a, $b, $operator, $compareBranches = false) - { - if (!isset(self::$transOpStr[$operator])) { - throw new \InvalidArgumentException(sprintf( - 'Invalid operator "%s" given, expected one of: %s', - $operator, - implode(', ', self::getSupportedOperators()) - )); - } - - $aIsBranch = 'dev-' === substr($a, 0, 4); - $bIsBranch = 'dev-' === substr($b, 0, 4); - - if ($aIsBranch && $bIsBranch) { - return $operator === '==' && $a === $b; - } - - // when branches are not comparable, we make sure dev branches never match anything - if (!$compareBranches && ($aIsBranch || $bIsBranch)) { - return false; - } - - return version_compare($a, $b, $operator); - } - - /** - * @param Constraint $provider - * @param bool $compareBranches - * - * @return bool - */ - public function matchSpecific(Constraint $provider, $compareBranches = false) - { - $noEqualOp = str_replace('=', '', self::$transOpInt[$this->operator]); - $providerNoEqualOp = str_replace('=', '', self::$transOpInt[$provider->operator]); - - $isEqualOp = self::OP_EQ === $this->operator; - $isNonEqualOp = self::OP_NE === $this->operator; - $isProviderEqualOp = self::OP_EQ === $provider->operator; - $isProviderNonEqualOp = self::OP_NE === $provider->operator; - - // '!=' operator is match when other operator is not '==' operator or version is not match - // these kinds of comparisons always have a solution - if ($isNonEqualOp || $isProviderNonEqualOp) { - return !$isEqualOp && !$isProviderEqualOp - || $this->versionCompare($provider->version, $this->version, '!=', $compareBranches); - } - - // an example for the condition is <= 2.0 & < 1.0 - // these kinds of comparisons always have a solution - if ($this->operator !== self::OP_EQ && $noEqualOp === $providerNoEqualOp) { - return true; - } - - if ($this->versionCompare($provider->version, $this->version, self::$transOpInt[$this->operator], $compareBranches)) { - // special case, e.g. require >= 1.0 and provide < 1.0 - // 1.0 >= 1.0 but 1.0 is outside of the provided interval - if ($provider->version === $this->version - && self::$transOpInt[$provider->operator] === $providerNoEqualOp - && self::$transOpInt[$this->operator] !== $noEqualOp) { - return false; - } - - return true; - } - - return false; - } - - /** - * @return string - */ - public function __toString() - { - return self::$transOpInt[$this->operator] . ' ' . $this->version; - } -} diff --git a/vendor/composer/semver/src/Constraint/ConstraintInterface.php b/vendor/composer/semver/src/Constraint/ConstraintInterface.php deleted file mode 100644 index 7cb13b6..0000000 --- a/vendor/composer/semver/src/Constraint/ConstraintInterface.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Semver\Constraint; - -interface ConstraintInterface -{ - /** - * @param ConstraintInterface $provider - * - * @return bool - */ - public function matches(ConstraintInterface $provider); - - /** - * @return string - */ - public function getPrettyString(); - - /** - * @return string - */ - public function __toString(); -} diff --git a/vendor/composer/semver/src/Constraint/EmptyConstraint.php b/vendor/composer/semver/src/Constraint/EmptyConstraint.php deleted file mode 100644 index faba56b..0000000 --- a/vendor/composer/semver/src/Constraint/EmptyConstraint.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Semver\Constraint; - -/** - * Defines the absence of a constraint. - */ -class EmptyConstraint implements ConstraintInterface -{ - /** @var string */ - protected $prettyString; - - /** - * @param ConstraintInterface $provider - * - * @return bool - */ - public function matches(ConstraintInterface $provider) - { - return true; - } - - /** - * @param $prettyString - */ - public function setPrettyString($prettyString) - { - $this->prettyString = $prettyString; - } - - /** - * @return string - */ - public function getPrettyString() - { - if ($this->prettyString) { - return $this->prettyString; - } - - return $this->__toString(); - } - - /** - * @return string - */ - public function __toString() - { - return '[]'; - } -} diff --git a/vendor/composer/semver/src/Constraint/MultiConstraint.php b/vendor/composer/semver/src/Constraint/MultiConstraint.php deleted file mode 100644 index 0c547af..0000000 --- a/vendor/composer/semver/src/Constraint/MultiConstraint.php +++ /dev/null @@ -1,120 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Semver\Constraint; - -/** - * Defines a conjunctive or disjunctive set of constraints. - */ -class MultiConstraint implements ConstraintInterface -{ - /** @var ConstraintInterface[] */ - protected $constraints; - - /** @var string */ - protected $prettyString; - - /** @var bool */ - protected $conjunctive; - - /** - * @param ConstraintInterface[] $constraints A set of constraints - * @param bool $conjunctive Whether the constraints should be treated as conjunctive or disjunctive - */ - public function __construct(array $constraints, $conjunctive = true) - { - $this->constraints = $constraints; - $this->conjunctive = $conjunctive; - } - - /** - * @return ConstraintInterface[] - */ - public function getConstraints() - { - return $this->constraints; - } - - /** - * @return bool - */ - public function isConjunctive() - { - return $this->conjunctive; - } - - /** - * @return bool - */ - public function isDisjunctive() - { - return !$this->conjunctive; - } - - /** - * @param ConstraintInterface $provider - * - * @return bool - */ - public function matches(ConstraintInterface $provider) - { - if (false === $this->conjunctive) { - foreach ($this->constraints as $constraint) { - if ($constraint->matches($provider)) { - return true; - } - } - - return false; - } - - foreach ($this->constraints as $constraint) { - if (!$constraint->matches($provider)) { - return false; - } - } - - return true; - } - - /** - * @param string $prettyString - */ - public function setPrettyString($prettyString) - { - $this->prettyString = $prettyString; - } - - /** - * @return string - */ - public function getPrettyString() - { - if ($this->prettyString) { - return $this->prettyString; - } - - return $this->__toString(); - } - - /** - * @return string - */ - public function __toString() - { - $constraints = array(); - foreach ($this->constraints as $constraint) { - $constraints[] = (string) $constraint; - } - - return '[' . implode($this->conjunctive ? ' ' : ' || ', $constraints) . ']'; - } -} diff --git a/vendor/composer/semver/src/Semver.php b/vendor/composer/semver/src/Semver.php deleted file mode 100644 index 0225bb5..0000000 --- a/vendor/composer/semver/src/Semver.php +++ /dev/null @@ -1,127 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Semver; - -use Composer\Semver\Constraint\Constraint; - -class Semver -{ - const SORT_ASC = 1; - const SORT_DESC = -1; - - /** @var VersionParser */ - private static $versionParser; - - /** - * Determine if given version satisfies given constraints. - * - * @param string $version - * @param string $constraints - * - * @return bool - */ - public static function satisfies($version, $constraints) - { - if (null === self::$versionParser) { - self::$versionParser = new VersionParser(); - } - - $versionParser = self::$versionParser; - $provider = new Constraint('==', $versionParser->normalize($version)); - $constraints = $versionParser->parseConstraints($constraints); - - return $constraints->matches($provider); - } - - /** - * Return all versions that satisfy given constraints. - * - * @param array $versions - * @param string $constraints - * - * @return array - */ - public static function satisfiedBy(array $versions, $constraints) - { - $versions = array_filter($versions, function ($version) use ($constraints) { - return Semver::satisfies($version, $constraints); - }); - - return array_values($versions); - } - - /** - * Sort given array of versions. - * - * @param array $versions - * - * @return array - */ - public static function sort(array $versions) - { - return self::usort($versions, self::SORT_ASC); - } - - /** - * Sort given array of versions in reverse. - * - * @param array $versions - * - * @return array - */ - public static function rsort(array $versions) - { - return self::usort($versions, self::SORT_DESC); - } - - /** - * @param array $versions - * @param int $direction - * - * @return array - */ - private static function usort(array $versions, $direction) - { - if (null === self::$versionParser) { - self::$versionParser = new VersionParser(); - } - - $versionParser = self::$versionParser; - $normalized = array(); - - // Normalize outside of usort() scope for minor performance increase. - // Creates an array of arrays: [[normalized, key], ...] - foreach ($versions as $key => $version) { - $normalized[] = array($versionParser->normalize($version), $key); - } - - usort($normalized, function (array $left, array $right) use ($direction) { - if ($left[0] === $right[0]) { - return 0; - } - - if (Comparator::lessThan($left[0], $right[0])) { - return -$direction; - } - - return $direction; - }); - - // Recreate input array, using the original indexes which are now in sorted order. - $sorted = array(); - foreach ($normalized as $item) { - $sorted[] = $versions[$item[1]]; - } - - return $sorted; - } -} diff --git a/vendor/composer/semver/src/VersionParser.php b/vendor/composer/semver/src/VersionParser.php deleted file mode 100644 index 359c18c..0000000 --- a/vendor/composer/semver/src/VersionParser.php +++ /dev/null @@ -1,548 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Semver; - -use Composer\Semver\Constraint\ConstraintInterface; -use Composer\Semver\Constraint\EmptyConstraint; -use Composer\Semver\Constraint\MultiConstraint; -use Composer\Semver\Constraint\Constraint; - -/** - * Version parser. - * - * @author Jordi Boggiano - */ -class VersionParser -{ - /** - * Regex to match pre-release data (sort of). - * - * Due to backwards compatibility: - * - Instead of enforcing hyphen, an underscore, dot or nothing at all are also accepted. - * - Only stabilities as recognized by Composer are allowed to precede a numerical identifier. - * - Numerical-only pre-release identifiers are not supported, see tests. - * - * |--------------| - * [major].[minor].[patch] -[pre-release] +[build-metadata] - * - * @var string - */ - private static $modifierRegex = '[._-]?(?:(stable|beta|b|RC|alpha|a|patch|pl|p)((?:[.-]?\d+)*+)?)?([.-]?dev)?'; - - /** @var array */ - private static $stabilities = array('stable', 'RC', 'beta', 'alpha', 'dev'); - - /** - * Returns the stability of a version. - * - * @param string $version - * - * @return string - */ - public static function parseStability($version) - { - $version = preg_replace('{#.+$}i', '', $version); - - if ('dev-' === substr($version, 0, 4) || '-dev' === substr($version, -4)) { - return 'dev'; - } - - preg_match('{' . self::$modifierRegex . '(?:\+.*)?$}i', strtolower($version), $match); - if (!empty($match[3])) { - return 'dev'; - } - - if (!empty($match[1])) { - if ('beta' === $match[1] || 'b' === $match[1]) { - return 'beta'; - } - if ('alpha' === $match[1] || 'a' === $match[1]) { - return 'alpha'; - } - if ('rc' === $match[1]) { - return 'RC'; - } - } - - return 'stable'; - } - - /** - * @param string $stability - * - * @return string - */ - public static function normalizeStability($stability) - { - $stability = strtolower($stability); - - return $stability === 'rc' ? 'RC' : $stability; - } - - /** - * Normalizes a version string to be able to perform comparisons on it. - * - * @param string $version - * @param string $fullVersion optional complete version string to give more context - * - * @throws \UnexpectedValueException - * - * @return string - */ - public function normalize($version, $fullVersion = null) - { - $version = trim($version); - if (null === $fullVersion) { - $fullVersion = $version; - } - - // strip off aliasing - if (preg_match('{^([^,\s]++) ++as ++([^,\s]++)$}', $version, $match)) { - $version = $match[1]; - } - - // match master-like branches - if (preg_match('{^(?:dev-)?(?:master|trunk|default)$}i', $version)) { - return '9999999-dev'; - } - - // if requirement is branch-like, use full name - if ('dev-' === strtolower(substr($version, 0, 4))) { - return 'dev-' . substr($version, 4); - } - - // strip off build metadata - if (preg_match('{^([^,\s+]++)\+[^\s]++$}', $version, $match)) { - $version = $match[1]; - } - - // match classical versioning - if (preg_match('{^v?(\d{1,5})(\.\d++)?(\.\d++)?(\.\d++)?' . self::$modifierRegex . '$}i', $version, $matches)) { - $version = $matches[1] - . (!empty($matches[2]) ? $matches[2] : '.0') - . (!empty($matches[3]) ? $matches[3] : '.0') - . (!empty($matches[4]) ? $matches[4] : '.0'); - $index = 5; - // match date(time) based versioning - } elseif (preg_match('{^v?(\d{4}(?:[.:-]?\d{2}){1,6}(?:[.:-]?\d{1,3})?)' . self::$modifierRegex . '$}i', $version, $matches)) { - $version = preg_replace('{\D}', '.', $matches[1]); - $index = 2; - } - - // add version modifiers if a version was matched - if (isset($index)) { - if (!empty($matches[$index])) { - if ('stable' === $matches[$index]) { - return $version; - } - $version .= '-' . $this->expandStability($matches[$index]) . (!empty($matches[$index + 1]) ? ltrim($matches[$index + 1], '.-') : ''); - } - - if (!empty($matches[$index + 2])) { - $version .= '-dev'; - } - - return $version; - } - - // match dev branches - if (preg_match('{(.*?)[.-]?dev$}i', $version, $match)) { - try { - return $this->normalizeBranch($match[1]); - } catch (\Exception $e) { - } - } - - $extraMessage = ''; - if (preg_match('{ +as +' . preg_quote($version) . '$}', $fullVersion)) { - $extraMessage = ' in "' . $fullVersion . '", the alias must be an exact version'; - } elseif (preg_match('{^' . preg_quote($version) . ' +as +}', $fullVersion)) { - $extraMessage = ' in "' . $fullVersion . '", the alias source must be an exact version, if it is a branch name you should prefix it with dev-'; - } - - throw new \UnexpectedValueException('Invalid version string "' . $version . '"' . $extraMessage); - } - - /** - * Extract numeric prefix from alias, if it is in numeric format, suitable for version comparison. - * - * @param string $branch Branch name (e.g. 2.1.x-dev) - * - * @return string|false Numeric prefix if present (e.g. 2.1.) or false - */ - public function parseNumericAliasPrefix($branch) - { - if (preg_match('{^(?P(\d++\\.)*\d++)(?:\.x)?-dev$}i', $branch, $matches)) { - return $matches['version'] . '.'; - } - - return false; - } - - /** - * Normalizes a branch name to be able to perform comparisons on it. - * - * @param string $name - * - * @return string - */ - public function normalizeBranch($name) - { - $name = trim($name); - - if (in_array($name, array('master', 'trunk', 'default'))) { - return $this->normalize($name); - } - - if (preg_match('{^v?(\d++)(\.(?:\d++|[xX*]))?(\.(?:\d++|[xX*]))?(\.(?:\d++|[xX*]))?$}i', $name, $matches)) { - $version = ''; - for ($i = 1; $i < 5; ++$i) { - $version .= isset($matches[$i]) ? str_replace(array('*', 'X'), 'x', $matches[$i]) : '.x'; - } - - return str_replace('x', '9999999', $version) . '-dev'; - } - - return 'dev-' . $name; - } - - /** - * Parses a constraint string into MultiConstraint and/or Constraint objects. - * - * @param string $constraints - * - * @return ConstraintInterface - */ - public function parseConstraints($constraints) - { - $prettyConstraint = $constraints; - - if (preg_match('{^([^,\s]*?)@(' . implode('|', self::$stabilities) . ')$}i', $constraints, $match)) { - $constraints = empty($match[1]) ? '*' : $match[1]; - } - - if (preg_match('{^(dev-[^,\s@]+?|[^,\s@]+?\.x-dev)#.+$}i', $constraints, $match)) { - $constraints = $match[1]; - } - - $orConstraints = preg_split('{\s*\|\|?\s*}', trim($constraints)); - $orGroups = array(); - foreach ($orConstraints as $constraints) { - $andConstraints = preg_split('{(?< ,]) *(? 1) { - $constraintObjects = array(); - foreach ($andConstraints as $constraint) { - foreach ($this->parseConstraint($constraint) as $parsedConstraint) { - $constraintObjects[] = $parsedConstraint; - } - } - } else { - $constraintObjects = $this->parseConstraint($andConstraints[0]); - } - - if (1 === count($constraintObjects)) { - $constraint = $constraintObjects[0]; - } else { - $constraint = new MultiConstraint($constraintObjects); - } - - $orGroups[] = $constraint; - } - - if (1 === count($orGroups)) { - $constraint = $orGroups[0]; - } elseif (2 === count($orGroups) - // parse the two OR groups and if they are contiguous we collapse - // them into one constraint - && $orGroups[0] instanceof MultiConstraint - && $orGroups[1] instanceof MultiConstraint - && 2 === count($orGroups[0]->getConstraints()) - && 2 === count($orGroups[1]->getConstraints()) - && ($a = (string) $orGroups[0]) - && substr($a, 0, 3) === '[>=' && (false !== ($posA = strpos($a, '<', 4))) - && ($b = (string) $orGroups[1]) - && substr($b, 0, 3) === '[>=' && (false !== ($posB = strpos($b, '<', 4))) - && substr($a, $posA + 2, -1) === substr($b, 4, $posB - 5) - ) { - $constraint = new MultiConstraint(array( - new Constraint('>=', substr($a, 4, $posA - 5)), - new Constraint('<', substr($b, $posB + 2, -1)), - )); - } else { - $constraint = new MultiConstraint($orGroups, false); - } - - $constraint->setPrettyString($prettyConstraint); - - return $constraint; - } - - /** - * @param string $constraint - * - * @throws \UnexpectedValueException - * - * @return array - */ - private function parseConstraint($constraint) - { - if (preg_match('{^([^,\s]+?)@(' . implode('|', self::$stabilities) . ')$}i', $constraint, $match)) { - $constraint = $match[1]; - if ($match[2] !== 'stable') { - $stabilityModifier = $match[2]; - } - } - - if (preg_match('{^v?[xX*](\.[xX*])*$}i', $constraint)) { - return array(new EmptyConstraint()); - } - - $versionRegex = 'v?(\d++)(?:\.(\d++))?(?:\.(\d++))?(?:\.(\d++))?' . self::$modifierRegex . '(?:\+[^\s]+)?'; - - // Tilde Range - // - // Like wildcard constraints, unsuffixed tilde constraints say that they must be greater than the previous - // version, to ensure that unstable instances of the current version are allowed. However, if a stability - // suffix is added to the constraint, then a >= match on the current version is used instead. - if (preg_match('{^~>?' . $versionRegex . '$}i', $constraint, $matches)) { - if (substr($constraint, 0, 2) === '~>') { - throw new \UnexpectedValueException( - 'Could not parse version constraint ' . $constraint . ': ' . - 'Invalid operator "~>", you probably meant to use the "~" operator' - ); - } - - // Work out which position in the version we are operating at - if (isset($matches[4]) && '' !== $matches[4]) { - $position = 4; - } elseif (isset($matches[3]) && '' !== $matches[3]) { - $position = 3; - } elseif (isset($matches[2]) && '' !== $matches[2]) { - $position = 2; - } else { - $position = 1; - } - - // Calculate the stability suffix - $stabilitySuffix = ''; - if (!empty($matches[5])) { - $stabilitySuffix .= '-' . $this->expandStability($matches[5]) . (!empty($matches[6]) ? $matches[6] : ''); - } - - if (!empty($matches[7])) { - $stabilitySuffix .= '-dev'; - } - - if (!$stabilitySuffix) { - $stabilitySuffix = '-dev'; - } - - $lowVersion = $this->manipulateVersionString($matches, $position, 0) . $stabilitySuffix; - $lowerBound = new Constraint('>=', $lowVersion); - - // For upper bound, we increment the position of one more significance, - // but highPosition = 0 would be illegal - $highPosition = max(1, $position - 1); - $highVersion = $this->manipulateVersionString($matches, $highPosition, 1) . '-dev'; - $upperBound = new Constraint('<', $highVersion); - - return array( - $lowerBound, - $upperBound, - ); - } - - // Caret Range - // - // Allows changes that do not modify the left-most non-zero digit in the [major, minor, patch] tuple. - // In other words, this allows patch and minor updates for versions 1.0.0 and above, patch updates for - // versions 0.X >=0.1.0, and no updates for versions 0.0.X - if (preg_match('{^\^' . $versionRegex . '($)}i', $constraint, $matches)) { - // Work out which position in the version we are operating at - if ('0' !== $matches[1] || '' === $matches[2]) { - $position = 1; - } elseif ('0' !== $matches[2] || '' === $matches[3]) { - $position = 2; - } else { - $position = 3; - } - - // Calculate the stability suffix - $stabilitySuffix = ''; - if (empty($matches[5]) && empty($matches[7])) { - $stabilitySuffix .= '-dev'; - } - - $lowVersion = $this->normalize(substr($constraint . $stabilitySuffix, 1)); - $lowerBound = new Constraint('>=', $lowVersion); - - // For upper bound, we increment the position of one more significance, - // but highPosition = 0 would be illegal - $highVersion = $this->manipulateVersionString($matches, $position, 1) . '-dev'; - $upperBound = new Constraint('<', $highVersion); - - return array( - $lowerBound, - $upperBound, - ); - } - - // X Range - // - // Any of X, x, or * may be used to "stand in" for one of the numeric values in the [major, minor, patch] tuple. - // A partial version range is treated as an X-Range, so the special character is in fact optional. - if (preg_match('{^v?(\d++)(?:\.(\d++))?(?:\.(\d++))?(?:\.[xX*])++$}', $constraint, $matches)) { - if (isset($matches[3]) && '' !== $matches[3]) { - $position = 3; - } elseif (isset($matches[2]) && '' !== $matches[2]) { - $position = 2; - } else { - $position = 1; - } - - $lowVersion = $this->manipulateVersionString($matches, $position) . '-dev'; - $highVersion = $this->manipulateVersionString($matches, $position, 1) . '-dev'; - - if ($lowVersion === '0.0.0.0-dev') { - return array(new Constraint('<', $highVersion)); - } - - return array( - new Constraint('>=', $lowVersion), - new Constraint('<', $highVersion), - ); - } - - // Hyphen Range - // - // Specifies an inclusive set. If a partial version is provided as the first version in the inclusive range, - // then the missing pieces are replaced with zeroes. If a partial version is provided as the second version in - // the inclusive range, then all versions that start with the supplied parts of the tuple are accepted, but - // nothing that would be greater than the provided tuple parts. - if (preg_match('{^(?P' . $versionRegex . ') +- +(?P' . $versionRegex . ')($)}i', $constraint, $matches)) { - // Calculate the stability suffix - $lowStabilitySuffix = ''; - if (empty($matches[6]) && empty($matches[8])) { - $lowStabilitySuffix = '-dev'; - } - - $lowVersion = $this->normalize($matches['from']); - $lowerBound = new Constraint('>=', $lowVersion . $lowStabilitySuffix); - - $empty = function ($x) { - return ($x === 0 || $x === '0') ? false : empty($x); - }; - - if ((!$empty($matches[11]) && !$empty($matches[12])) || !empty($matches[14]) || !empty($matches[16])) { - $highVersion = $this->normalize($matches['to']); - $upperBound = new Constraint('<=', $highVersion); - } else { - $highMatch = array('', $matches[10], $matches[11], $matches[12], $matches[13]); - $highVersion = $this->manipulateVersionString($highMatch, $empty($matches[11]) ? 1 : 2, 1) . '-dev'; - $upperBound = new Constraint('<', $highVersion); - } - - return array( - $lowerBound, - $upperBound, - ); - } - - // Basic Comparators - if (preg_match('{^(<>|!=|>=?|<=?|==?)?\s*(.*)}', $constraint, $matches)) { - try { - $version = $this->normalize($matches[2]); - - if (!empty($stabilityModifier) && $this->parseStability($version) === 'stable') { - $version .= '-' . $stabilityModifier; - } elseif ('<' === $matches[1] || '>=' === $matches[1]) { - if (!preg_match('/-' . self::$modifierRegex . '$/', strtolower($matches[2]))) { - if (substr($matches[2], 0, 4) !== 'dev-') { - $version .= '-dev'; - } - } - } - - return array(new Constraint($matches[1] ?: '=', $version)); - } catch (\Exception $e) { - } - } - - $message = 'Could not parse version constraint ' . $constraint; - if (isset($e)) { - $message .= ': ' . $e->getMessage(); - } - - throw new \UnexpectedValueException($message); - } - - /** - * Increment, decrement, or simply pad a version number. - * - * Support function for {@link parseConstraint()} - * - * @param array $matches Array with version parts in array indexes 1,2,3,4 - * @param int $position 1,2,3,4 - which segment of the version to increment/decrement - * @param int $increment - * @param string $pad The string to pad version parts after $position - * - * @return string The new version - */ - private function manipulateVersionString($matches, $position, $increment = 0, $pad = '0') - { - for ($i = 4; $i > 0; --$i) { - if ($i > $position) { - $matches[$i] = $pad; - } elseif ($i === $position && $increment) { - $matches[$i] += $increment; - // If $matches[$i] was 0, carry the decrement - if ($matches[$i] < 0) { - $matches[$i] = $pad; - --$position; - - // Return null on a carry overflow - if ($i === 1) { - return; - } - } - } - } - - return $matches[1] . '.' . $matches[2] . '.' . $matches[3] . '.' . $matches[4]; - } - - /** - * Expand shorthand stability string to long version. - * - * @param string $stability - * - * @return string - */ - private function expandStability($stability) - { - $stability = strtolower($stability); - - switch ($stability) { - case 'a': - return 'alpha'; - case 'b': - return 'beta'; - case 'p': - case 'pl': - return 'patch'; - case 'rc': - return 'RC'; - default: - return $stability; - } - } -} diff --git a/vendor/roundcube/plugin-installer/.gitignore b/vendor/roundcube/plugin-installer/.gitignore deleted file mode 100644 index 50a0b90..0000000 --- a/vendor/roundcube/plugin-installer/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -composer.lock -composer.phar diff --git a/vendor/roundcube/plugin-installer/README.md b/vendor/roundcube/plugin-installer/README.md deleted file mode 100644 index f7713d8..0000000 --- a/vendor/roundcube/plugin-installer/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# Plugin Installer for Roundcube - -This installer ensures that plugins end up in the correct directory: - - * `/plugins/plugin-name` - -## Minimum setup - - * create a `composer.json` file in your plugin's repository - * add the following contents - -### sample composer.json for plugins - - { - "name": "yourvendor/plugin-name", - "license": "the license", - "description": "tell the world what your plugin is good at", - "type": "roundcube-plugin", - "authors": [ - { - "name": "", - "email": "" - } - ], - "repositories": [ - { - "type": "composer", - "url": "http://plugins.roundcube.net" - } - ] - "require": { - "roundcube/plugin-installer": "*" - }, - "minimum-stability": "dev-master" - } - - * Submit your plugin to [plugins.roundcube.net](http://plugins.roundcube.net). - -## Installation - - * clone Roundcube - * `cp composer.json-dist composer.json` - * add your plugin in the `require` section of composer.json - * `composer.phar install` - -Read the whole story at [plugins.roundcube.net](http://plugins.roundcube.net/about). diff --git a/vendor/roundcube/plugin-installer/composer.json b/vendor/roundcube/plugin-installer/composer.json deleted file mode 100644 index 8da64e8..0000000 --- a/vendor/roundcube/plugin-installer/composer.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "roundcube/plugin-installer", - "description": "A composer-installer for Roundcube plugins.", - "type": "composer-installer", - "license": "GPL-3.0+", - "authors": [ - { - "name": "Thomas Bruederli", - "email": "thomas@roundcube.net" - }, - { - "name": "Till Klampaeckel", - "email": "till@php.net" - } - ], - "autoload": { - "psr-0": { - "Roundcube\\Composer": "src/" - } - }, - "extra": { - "class": "Roundcube\\Composer\\PluginInstaller" - }, - "bin": [ - "src/bin/rcubeinitdb.sh" - ], - "require": { - "php": ">=5.3.0", - "composer/semver": "^1.4.2" - }, - "require-dev": { - "composer/composer": "*" - } -} diff --git a/vendor/roundcube/plugin-installer/src/Roundcube/Composer/PluginInstaller.php b/vendor/roundcube/plugin-installer/src/Roundcube/Composer/PluginInstaller.php deleted file mode 100644 index 4cfe5aa..0000000 --- a/vendor/roundcube/plugin-installer/src/Roundcube/Composer/PluginInstaller.php +++ /dev/null @@ -1,280 +0,0 @@ - - * @author Thomas Bruederli - * @license GPL-3.0+ - * @version GIT: - * @link http://github.com/roundcube/plugin-installer - */ -class PluginInstaller extends LibraryInstaller -{ - const INSTALLER_TYPE = 'roundcube-plugin'; - - /** - * {@inheritDoc} - */ - public function getInstallPath(PackageInterface $package) - { - static $vendorDir; - if ($vendorDir === null) { - $vendorDir = $this->getVendorDir(); - } - - return sprintf('%s/%s', $vendorDir, $this->getPluginName($package)); - } - - /** - * {@inheritDoc} - */ - public function install(InstalledRepositoryInterface $repo, PackageInterface $package) - { - $this->rcubeVersionCheck($package); - parent::install($repo, $package); - - // post-install: activate plugin in Roundcube config - $config_file = $this->rcubeConfigFile(); - $plugin_name = $this->getPluginName($package); - $plugin_dir = $this->getVendorDir() . DIRECTORY_SEPARATOR . $plugin_name; - $extra = $package->getExtra(); - $plugin_name = $this->getPluginName($package); - - if (is_writeable($config_file) && php_sapi_name() == 'cli') { - $answer = $this->io->askConfirmation("Do you want to activate the plugin $plugin_name? [N|y] ", false); - if (true === $answer) { - $this->rcubeAlterConfig($plugin_name, true); - } - } - - // copy config.inc.php.dist -> config.inc.php - if (is_file($plugin_dir . DIRECTORY_SEPARATOR . 'config.inc.php.dist') && !is_file($plugin_dir . DIRECTORY_SEPARATOR . 'config.inc.php') && is_writeable($plugin_dir)) { - $this->io->write("Creating plugin config file"); - copy($plugin_dir . DIRECTORY_SEPARATOR . 'config.inc.php.dist', $plugin_dir . DIRECTORY_SEPARATOR . 'config.inc.php'); - } - - // initialize database schema - if (!empty($extra['roundcube']['sql-dir'])) { - if ($sqldir = realpath($plugin_dir . DIRECTORY_SEPARATOR . $extra['roundcube']['sql-dir'])) { - $this->io->write("Running database initialization script for $plugin_name"); - system(getcwd() . "/vendor/bin/rcubeinitdb.sh --package=$plugin_name --dir=$sqldir"); - } - } - - // run post-install script - if (!empty($extra['roundcube']['post-install-script'])) { - $this->rcubeRunScript($extra['roundcube']['post-install-script'], $package); - } - } - - /** - * {@inheritDoc} - */ - public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) - { - $this->rcubeVersionCheck($target); - parent::update($repo, $initial, $target); - - $extra = $target->getExtra(); - - // trigger updatedb.sh - if (!empty($extra['roundcube']['sql-dir'])) { - $plugin_name = $this->getPluginName($target); - $plugin_dir = $this->getVendorDir() . DIRECTORY_SEPARATOR . $plugin_name; - - if ($sqldir = realpath($plugin_dir . DIRECTORY_SEPARATOR . $extra['roundcube']['sql-dir'])) { - $this->io->write("Updating database schema for $plugin_name"); - system(getcwd() . "/bin/updatedb.sh --package=$plugin_name --dir=$sqldir", $res); - } - } - - // run post-update script - if (!empty($extra['roundcube']['post-update-script'])) { - $this->rcubeRunScript($extra['roundcube']['post-update-script'], $target); - } - } - - /** - * {@inheritDoc} - */ - public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) - { - parent::uninstall($repo, $package); - - // post-uninstall: deactivate plugin - $plugin_name = $this->getPluginName($package); - $this->rcubeAlterConfig($plugin_name, false); - - // run post-uninstall script - $extra = $package->getExtra(); - if (!empty($extra['roundcube']['post-uninstall-script'])) { - $this->rcubeRunScript($extra['roundcube']['post-uninstall-script'], $package); - } - } - - /** - * {@inheritDoc} - */ - public function supports($packageType) - { - return $packageType === self::INSTALLER_TYPE; - } - - /** - * Setup vendor directory to one of these two: - * ./plugins - * - * @return string - */ - public function getVendorDir() - { - $pluginDir = getcwd(); - $pluginDir .= '/plugins'; - - return $pluginDir; - } - - /** - * Extract the (valid) plugin name from the package object - */ - private function getPluginName(PackageInterface $package) - { - @list($vendor, $pluginName) = explode('/', $package->getPrettyName()); - - return strtr($pluginName, '-', '_'); - } - - /** - * Check version requirements from the "extra" block of a package - * against the local Roundcube version - */ - private function rcubeVersionCheck($package) - { - $parser = new VersionParser; - - // read rcube version from iniset - $rootdir = getcwd(); - $iniset = @file_get_contents($rootdir . '/program/include/iniset.php'); - if (preg_match('/define\(.RCMAIL_VERSION.,\s*.([0-9.]+[a-z-]*)?/', $iniset, $m)) { - $rcubeVersion = $parser->normalize(str_replace('-git', '.999', $m[1])); - } else { - throw new \Exception("Unable to find a Roundcube installation in $rootdir"); - } - - $extra = $package->getExtra(); - - if (!empty($extra['roundcube'])) { - foreach (array('min-version' => '>=', 'max-version' => '<=') as $key => $operator) { - if (!empty($extra['roundcube'][$key])) { - $version = $parser->normalize(str_replace('-git', '.999', $extra['roundcube'][$key])); - $constraint = new Constraint($operator, $version); - if (!$constraint->versionCompare($rcubeVersion, $version, $operator)) { - throw new \Exception("Version check failed! " . $package->getName() . " requires Roundcube version $operator $version, $rcubeVersion was detected."); - } - } - } - } - } - - /** - * Add or remove the given plugin to the list of active plugins in the Roundcube config. - */ - private function rcubeAlterConfig($plugin_name, $add) - { - $config_file = $this->rcubeConfigFile(); - @include($config_file); - $success = false; - $varname = '$config'; - - if (empty($config) && !empty($rcmail_config)) { - $config = $rcmail_config; - $varname = '$rcmail_config'; - } - - if (is_array($config) && is_writeable($config_file)) { - $config_templ = @file_get_contents($config_file) ?: ''; - $config_plugins = !empty($config['plugins']) ? ((array) $config['plugins']) : array(); - $active_plugins = $config_plugins; - - if ($add && !in_array($plugin_name, $active_plugins)) { - $active_plugins[] = $plugin_name; - } elseif (!$add && ($i = array_search($plugin_name, $active_plugins)) !== false) { - unset($active_plugins[$i]); - } - - if ($active_plugins != $config_plugins) { - $count = 0; - $var_export = "array(\n\t'" . join("',\n\t'", $active_plugins) . "',\n);"; - $new_config = preg_replace( - "/(\\$varname\['plugins'\])\s+=\s+(.+);/Uims", - "\\1 = " . $var_export, - $config_templ, -1, $count); - - // 'plugins' option does not exist yet, add it... - if (!$count) { - $var_txt = "\n{$varname}['plugins'] = $var_export;\n"; - $new_config = str_replace('?>', $var_txt . '?>', $config_templ, $count); - - if (!$count) { - $new_config = $config_templ . $var_txt; - } - } - - $success = file_put_contents($config_file, $new_config); - } - } - - if ($success && php_sapi_name() == 'cli') { - $this->io->write("Updated local config at $config_file"); - } - - return $success; - } - - /** - * Helper method to get an absolute path to the local Roundcube config file - */ - private function rcubeConfigFile() - { - return realpath(getcwd() . '/config/config.inc.php'); - } - - /** - * Run the given script file - */ - private function rcubeRunScript($script, PackageInterface $package) - { - $plugin_name = $this->getPluginName($package); - $plugin_dir = $this->getVendorDir() . DIRECTORY_SEPARATOR . $plugin_name; - - // check for executable shell script - if (($scriptfile = realpath($plugin_dir . DIRECTORY_SEPARATOR . $script)) && is_executable($scriptfile)) { - $script = $scriptfile; - } - - // run PHP script in Roundcube context - if ($scriptfile && preg_match('/\.php$/', $scriptfile)) { - $incdir = realpath(getcwd() . '/program/include'); - include_once($incdir . '/iniset.php'); - include($scriptfile); - } - // attempt to execute the given string as shell commands - else { - $process = new ProcessExecutor($this->io); - $exitCode = $process->execute($script, null, $plugin_dir); - if ($exitCode !== 0) { - throw new \RuntimeException('Error executing script: '. $process->getErrorOutput(), $exitCode); - } - } - } -} diff --git a/vendor/roundcube/plugin-installer/src/bin/rcubeinitdb.sh b/vendor/roundcube/plugin-installer/src/bin/rcubeinitdb.sh deleted file mode 100755 index 10862ea..0000000 --- a/vendor/roundcube/plugin-installer/src/bin/rcubeinitdb.sh +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env php - 'dir', - 'p' => 'package', -)); - -if (empty($opts['dir'])) { - rcube::raise_error("Database schema directory not specified (--dir).", false, true); -} -if (empty($opts['package'])) { - rcube::raise_error("Database schema package name not specified (--package).", false, true); -} - -// Check if directory exists -if (!file_exists($opts['dir'])) { - rcube::raise_error("Specified database schema directory doesn't exist.", false, true); -} - -$RC = rcube::get_instance(); -$DB = rcube_db::factory($RC->config->get('db_dsnw')); - -// Connect to database -$DB->db_connect('w'); -if (!$DB->is_connected()) { - rcube::raise_error("Error connecting to database: " . $DB->is_error(), false, true); -} - -$opts['dir'] = rtrim($opts['dir'], DIRECTORY_SEPARATOR); -$file = $opts['dir'] . DIRECTORY_SEPARATOR . $DB->db_provider . '.initial.sql'; -if (!file_exists($file)) { - rcube::raise_error("No DDL file found for " . $DB->db_provider . " driver.", false, true); -} - -$package = $opts['package']; -$error = false; - -// read DDL file -if ($lines = file($file)) { - $sql = ''; - foreach ($lines as $line) { - if (preg_match('/^--/', $line) || trim($line) == '') - continue; - - $sql .= $line . "\n"; - if (preg_match('/(;|^GO)$/', trim($line))) { - @$DB->query(fix_table_names($sql)); - $sql = ''; - if ($error = $DB->is_error()) { - break; - } - } - } -} - -if (!$error) { - $version = date('Ymd00'); - $system_table = $DB->quote_identifier($DB->table_name('system')); - $name_col = $DB->quote_identifier('name'); - $value_col = $DB->quote_identifier('value'); - $package_version = $package . '-version'; - - $DB->query("SELECT * FROM $system_table WHERE $name_col=?", - $package_version); - - if ($DB->fetch_assoc()) { - $DB->query("UPDATE $system_table SET $value_col=? WHERE $name_col=?", - $version, $package_version); - } - else { - $DB->query("INSERT INTO $system_table ($name_col, $value_col) VALUES (?, ?)", - $package_version, $version); - } - - $error = $DB->is_error(); -} - -if ($error) { - echo "[FAILED]\n"; - rcube::raise_error("Error in DDL schema $file: $error", false, true); -} -echo "[OK]\n"; - - -function fix_table_names($sql) -{ - global $DB, $RC; - - $prefix = $RC->config->get('db_prefix'); - $engine = $DB->db_provider; - - if (empty($prefix)) { - return $sql; - } - - $tables = array(); - $sequences = array(); - - // find table names - if (preg_match_all('/CREATE TABLE (\[dbo\]\.|IF NOT EXISTS )?[`"\[\]]*([^`"\[\] \r\n]+)/i', $sql, $matches)) { - foreach ($matches[2] as $table) { - $tables[$table] = $prefix . $table; - } - } - // find sequence names - if ($engine == 'postgres' && preg_match_all('/CREATE SEQUENCE (IF NOT EXISTS )?"?([^" \n\r]+)/i', $sql, $matches)) { - foreach ($matches[2] as $sequence) { - $sequences[$sequence] = $prefix . $sequence; - } - } - - // replace table names - foreach ($tables as $table => $real_table) { - $sql = preg_replace("/([^a-zA-Z0-9_])$table([^a-zA-Z0-9_])/", "\\1$real_table\\2", $sql); - } - // replace sequence names - foreach ($sequences as $sequence => $real_sequence) { - $sql = preg_replace("/([^a-zA-Z0-9_])$sequence([^a-zA-Z0-9_])/", "\\1$real_sequence\\2", $sql); - } - - return $sql; -} - -?>