mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-10 18:38:49 +00:00
[twitter] Update abraham/twitteroauth dependency
This commit is contained in:
parent
30445b3c85
commit
569e3f4831
167 changed files with 11848 additions and 2157 deletions
4
twitter/vendor/composer/ClassLoader.php
vendored
4
twitter/vendor/composer/ClassLoader.php
vendored
|
@ -60,7 +60,7 @@ class ClassLoader
|
|||
public function getPrefixes()
|
||||
{
|
||||
if (!empty($this->prefixesPsr0)) {
|
||||
return call_user_func_array('array_merge', $this->prefixesPsr0);
|
||||
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
||||
}
|
||||
|
||||
return array();
|
||||
|
@ -279,7 +279,7 @@ class ClassLoader
|
|||
*/
|
||||
public function setApcuPrefix($apcuPrefix)
|
||||
{
|
||||
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
|
||||
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
1
twitter/vendor/composer/autoload_psr4.php
vendored
1
twitter/vendor/composer/autoload_psr4.php
vendored
|
@ -7,5 +7,6 @@ $baseDir = dirname($vendorDir);
|
|||
|
||||
return array(
|
||||
'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
|
||||
'Composer\\CaBundle\\' => array($vendorDir . '/composer/ca-bundle/src'),
|
||||
'Abraham\\TwitterOAuth\\' => array($vendorDir . '/abraham/twitteroauth/src'),
|
||||
);
|
||||
|
|
3
twitter/vendor/composer/autoload_real.php
vendored
3
twitter/vendor/composer/autoload_real.php
vendored
|
@ -13,6 +13,9 @@ class ComposerAutoloaderInitTwitterAddon
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Composer\Autoload\ClassLoader
|
||||
*/
|
||||
public static function getLoader()
|
||||
{
|
||||
if (null !== self::$loader) {
|
||||
|
|
5
twitter/vendor/composer/autoload_static.php
vendored
5
twitter/vendor/composer/autoload_static.php
vendored
|
@ -10,6 +10,7 @@ class ComposerStaticInitTwitterAddon
|
|||
'C' =>
|
||||
array (
|
||||
'Composer\\Installers\\' => 20,
|
||||
'Composer\\CaBundle\\' => 18,
|
||||
),
|
||||
'A' =>
|
||||
array (
|
||||
|
@ -22,6 +23,10 @@ class ComposerStaticInitTwitterAddon
|
|||
array (
|
||||
0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers',
|
||||
),
|
||||
'Composer\\CaBundle\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/composer/ca-bundle/src',
|
||||
),
|
||||
'Abraham\\TwitterOAuth\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/abraham/twitteroauth/src',
|
||||
|
|
19
twitter/vendor/composer/ca-bundle/LICENSE
vendored
Normal file
19
twitter/vendor/composer/ca-bundle/LICENSE
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
Copyright (C) 2016 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.
|
85
twitter/vendor/composer/ca-bundle/README.md
vendored
Normal file
85
twitter/vendor/composer/ca-bundle/README.md
vendored
Normal file
|
@ -0,0 +1,85 @@
|
|||
composer/ca-bundle
|
||||
==================
|
||||
|
||||
Small utility library that lets you find a path to the system CA bundle,
|
||||
and includes a fallback to the Mozilla CA bundle.
|
||||
|
||||
Originally written as part of [composer/composer](https://github.com/composer/composer),
|
||||
now extracted and made available as a stand-alone library.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Install the latest version with:
|
||||
|
||||
```bash
|
||||
$ composer require composer/ca-bundle
|
||||
```
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
* PHP 5.3.2 is required but using the latest version of PHP is highly recommended.
|
||||
|
||||
|
||||
Basic usage
|
||||
-----------
|
||||
|
||||
### `Composer\CaBundle\CaBundle`
|
||||
|
||||
- `CaBundle::getSystemCaRootBundlePath()`: Returns the system CA bundle path, or a path to the bundled one as fallback
|
||||
- `CaBundle::getBundledCaBundlePath()`: Returns the path to the bundled CA file
|
||||
- `CaBundle::validateCaFile($filename)`: Validates a CA file using openssl_x509_parse only if it is safe to use
|
||||
- `CaBundle::isOpensslParseSafe()`: Test if it is safe to use the PHP function openssl_x509_parse()
|
||||
- `CaBundle::reset()`: Resets the static caches
|
||||
|
||||
|
||||
#### To use with curl
|
||||
|
||||
```php
|
||||
$curl = curl_init("https://example.org/");
|
||||
|
||||
$caPathOrFile = \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath();
|
||||
if (is_dir($caPathOrFile)) {
|
||||
curl_setopt($curl, CURLOPT_CAPATH, $caPathOrFile);
|
||||
} else {
|
||||
curl_setopt($curl, CURLOPT_CAINFO, $caPathOrFile);
|
||||
}
|
||||
|
||||
$result = curl_exec($curl);
|
||||
```
|
||||
|
||||
#### To use with php streams
|
||||
|
||||
```php
|
||||
$opts = array(
|
||||
'http' => array(
|
||||
'method' => "GET"
|
||||
)
|
||||
);
|
||||
|
||||
$caPathOrFile = \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath();
|
||||
if (is_dir($caPathOrFile)) {
|
||||
$opts['ssl']['capath'] = $caPathOrFile;
|
||||
} else {
|
||||
$opts['ssl']['cafile'] = $caPathOrFile;
|
||||
}
|
||||
|
||||
$context = stream_context_create($opts);
|
||||
$result = file_get_contents('https://example.com', false, $context);
|
||||
```
|
||||
|
||||
#### To use with Guzzle
|
||||
|
||||
```php
|
||||
$client = new \GuzzleHttp\Client([
|
||||
\GuzzleHttp\RequestOptions::VERIFY => \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath()
|
||||
]);
|
||||
```
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
composer/ca-bundle is licensed under the MIT License, see the LICENSE file for details.
|
54
twitter/vendor/composer/ca-bundle/composer.json
vendored
Normal file
54
twitter/vendor/composer/ca-bundle/composer.json
vendored
Normal file
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
"name": "composer/ca-bundle",
|
||||
"description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.",
|
||||
"type": "library",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"cabundle",
|
||||
"cacert",
|
||||
"certificate",
|
||||
"ssl",
|
||||
"tls"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jordi Boggiano",
|
||||
"email": "j.boggiano@seld.be",
|
||||
"homepage": "http://seld.be"
|
||||
}
|
||||
],
|
||||
"support": {
|
||||
"irc": "irc://irc.freenode.org/composer",
|
||||
"issues": "https://github.com/composer/ca-bundle/issues"
|
||||
},
|
||||
"require": {
|
||||
"ext-openssl": "*",
|
||||
"ext-pcre": "*",
|
||||
"php": "^5.3.2 || ^7.0 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/phpunit-bridge": "^4.2 || ^5",
|
||||
"phpstan/phpstan": "^0.12.55",
|
||||
"psr/log": "^1.0",
|
||||
"symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Composer\\CaBundle\\": "src"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Composer\\CaBundle\\": "tests"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.x-dev"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"test": "SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 vendor/bin/simple-phpunit",
|
||||
"phpstan": "vendor/bin/phpstan analyse"
|
||||
}
|
||||
}
|
3138
twitter/vendor/composer/ca-bundle/res/cacert.pem
vendored
Normal file
3138
twitter/vendor/composer/ca-bundle/res/cacert.pem
vendored
Normal file
File diff suppressed because it is too large
Load diff
353
twitter/vendor/composer/ca-bundle/src/CaBundle.php
vendored
Normal file
353
twitter/vendor/composer/ca-bundle/src/CaBundle.php
vendored
Normal file
|
@ -0,0 +1,353 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of composer/ca-bundle.
|
||||
*
|
||||
* (c) Composer <https://github.com/composer>
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\CaBundle;
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Process\PhpProcess;
|
||||
|
||||
/**
|
||||
* @author Chris Smith <chris@cs278.org>
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
*/
|
||||
class CaBundle
|
||||
{
|
||||
/** @var string|null */
|
||||
private static $caPath;
|
||||
/** @var array<string, bool> */
|
||||
private static $caFileValidity = array();
|
||||
/** @var bool|null */
|
||||
private static $useOpensslParse;
|
||||
|
||||
/**
|
||||
* Returns the system CA bundle path, or a path to the bundled one
|
||||
*
|
||||
* This method was adapted from Sslurp.
|
||||
* https://github.com/EvanDotPro/Sslurp
|
||||
*
|
||||
* (c) Evan Coury <me@evancoury.com>
|
||||
*
|
||||
* For the full copyright and license information, please see below:
|
||||
*
|
||||
* Copyright (c) 2013, Evan Coury
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* @param LoggerInterface $logger optional logger for information about which CA files were loaded
|
||||
* @return string path to a CA bundle file or directory
|
||||
*/
|
||||
public static function getSystemCaRootBundlePath(LoggerInterface $logger = null)
|
||||
{
|
||||
if (self::$caPath !== null) {
|
||||
return self::$caPath;
|
||||
}
|
||||
$caBundlePaths = array();
|
||||
|
||||
// If SSL_CERT_FILE env variable points to a valid certificate/bundle, use that.
|
||||
// This mimics how OpenSSL uses the SSL_CERT_FILE env variable.
|
||||
$caBundlePaths[] = self::getEnvVariable('SSL_CERT_FILE');
|
||||
|
||||
// If SSL_CERT_DIR env variable points to a valid certificate/bundle, use that.
|
||||
// This mimics how OpenSSL uses the SSL_CERT_FILE env variable.
|
||||
$caBundlePaths[] = self::getEnvVariable('SSL_CERT_DIR');
|
||||
|
||||
$caBundlePaths[] = ini_get('openssl.cafile');
|
||||
$caBundlePaths[] = ini_get('openssl.capath');
|
||||
|
||||
$otherLocations = array(
|
||||
'/etc/pki/tls/certs/ca-bundle.crt', // Fedora, RHEL, CentOS (ca-certificates package)
|
||||
'/etc/ssl/certs/ca-certificates.crt', // Debian, Ubuntu, Gentoo, Arch Linux (ca-certificates package)
|
||||
'/etc/ssl/ca-bundle.pem', // SUSE, openSUSE (ca-certificates package)
|
||||
'/usr/local/share/certs/ca-root-nss.crt', // FreeBSD (ca_root_nss_package)
|
||||
'/usr/ssl/certs/ca-bundle.crt', // Cygwin
|
||||
'/opt/local/share/curl/curl-ca-bundle.crt', // OS X macports, curl-ca-bundle package
|
||||
'/usr/local/share/curl/curl-ca-bundle.crt', // Default cURL CA bunde path (without --with-ca-bundle option)
|
||||
'/usr/share/ssl/certs/ca-bundle.crt', // Really old RedHat?
|
||||
'/etc/ssl/cert.pem', // OpenBSD
|
||||
'/usr/local/etc/ssl/cert.pem', // FreeBSD 10.x
|
||||
'/usr/local/etc/openssl/cert.pem', // OS X homebrew, openssl package
|
||||
'/usr/local/etc/openssl@1.1/cert.pem', // OS X homebrew, openssl@1.1 package
|
||||
);
|
||||
|
||||
foreach($otherLocations as $location) {
|
||||
$otherLocations[] = dirname($location);
|
||||
}
|
||||
|
||||
$caBundlePaths = array_merge($caBundlePaths, $otherLocations);
|
||||
|
||||
foreach ($caBundlePaths as $caBundle) {
|
||||
if ($caBundle && self::caFileUsable($caBundle, $logger)) {
|
||||
return self::$caPath = $caBundle;
|
||||
}
|
||||
|
||||
if ($caBundle && self::caDirUsable($caBundle)) {
|
||||
return self::$caPath = $caBundle;
|
||||
}
|
||||
}
|
||||
|
||||
return self::$caPath = static::getBundledCaBundlePath(); // Bundled CA file, last resort
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the path to the bundled CA file
|
||||
*
|
||||
* In case you don't want to trust the user or the system, you can use this directly
|
||||
*
|
||||
* @return string path to a CA bundle file
|
||||
*/
|
||||
public static function getBundledCaBundlePath()
|
||||
{
|
||||
$caBundleFile = __DIR__.'/../res/cacert.pem';
|
||||
|
||||
// cURL does not understand 'phar://' paths
|
||||
// see https://github.com/composer/ca-bundle/issues/10
|
||||
if (0 === strpos($caBundleFile, 'phar://')) {
|
||||
$tempCaBundleFile = tempnam(sys_get_temp_dir(), 'openssl-ca-bundle-');
|
||||
if (false === $tempCaBundleFile) {
|
||||
throw new \RuntimeException('Could not create a temporary file to store the bundled CA file');
|
||||
}
|
||||
|
||||
file_put_contents(
|
||||
$tempCaBundleFile,
|
||||
file_get_contents($caBundleFile)
|
||||
);
|
||||
|
||||
register_shutdown_function(function() use ($tempCaBundleFile) {
|
||||
@unlink($tempCaBundleFile);
|
||||
});
|
||||
|
||||
$caBundleFile = $tempCaBundleFile;
|
||||
}
|
||||
|
||||
return $caBundleFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates a CA file using opensl_x509_parse only if it is safe to use
|
||||
*
|
||||
* @param string $filename
|
||||
* @param LoggerInterface $logger optional logger for information about which CA files were loaded
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function validateCaFile($filename, LoggerInterface $logger = null)
|
||||
{
|
||||
static $warned = false;
|
||||
|
||||
if (isset(self::$caFileValidity[$filename])) {
|
||||
return self::$caFileValidity[$filename];
|
||||
}
|
||||
|
||||
$contents = file_get_contents($filename);
|
||||
|
||||
// assume the CA is valid if php is vulnerable to
|
||||
// https://www.sektioneins.de/advisories/advisory-012013-php-openssl_x509_parse-memory-corruption-vulnerability.html
|
||||
if (!static::isOpensslParseSafe()) {
|
||||
if (!$warned && $logger) {
|
||||
$logger->warning(sprintf(
|
||||
'Your version of PHP, %s, is affected by CVE-2013-6420 and cannot safely perform certificate validation, we strongly suggest you upgrade.',
|
||||
PHP_VERSION
|
||||
));
|
||||
$warned = true;
|
||||
}
|
||||
|
||||
$isValid = !empty($contents);
|
||||
} elseif (is_string($contents) && strlen($contents) > 0) {
|
||||
$contents = preg_replace("/^(\\-+(?:BEGIN|END))\\s+TRUSTED\\s+(CERTIFICATE\\-+)\$/m", '$1 $2', $contents);
|
||||
if (null === $contents) {
|
||||
// regex extraction failed
|
||||
$isValid = false;
|
||||
} else {
|
||||
$isValid = (bool) openssl_x509_parse($contents);
|
||||
}
|
||||
} else {
|
||||
$isValid = false;
|
||||
}
|
||||
|
||||
if ($logger) {
|
||||
$logger->debug('Checked CA file '.realpath($filename).': '.($isValid ? 'valid' : 'invalid'));
|
||||
}
|
||||
|
||||
return self::$caFileValidity[$filename] = $isValid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if it is safe to use the PHP function openssl_x509_parse().
|
||||
*
|
||||
* This checks if OpenSSL extensions is vulnerable to remote code execution
|
||||
* via the exploit documented as CVE-2013-6420.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isOpensslParseSafe()
|
||||
{
|
||||
if (null !== self::$useOpensslParse) {
|
||||
return self::$useOpensslParse;
|
||||
}
|
||||
|
||||
if (PHP_VERSION_ID >= 50600) {
|
||||
return self::$useOpensslParse = true;
|
||||
}
|
||||
|
||||
// Vulnerable:
|
||||
// PHP 5.3.0 - PHP 5.3.27
|
||||
// PHP 5.4.0 - PHP 5.4.22
|
||||
// PHP 5.5.0 - PHP 5.5.6
|
||||
if (
|
||||
(PHP_VERSION_ID < 50400 && PHP_VERSION_ID >= 50328)
|
||||
|| (PHP_VERSION_ID < 50500 && PHP_VERSION_ID >= 50423)
|
||||
|| PHP_VERSION_ID >= 50507
|
||||
) {
|
||||
// This version of PHP has the fix for CVE-2013-6420 applied.
|
||||
return self::$useOpensslParse = true;
|
||||
}
|
||||
|
||||
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
|
||||
// Windows is probably insecure in this case.
|
||||
return self::$useOpensslParse = false;
|
||||
}
|
||||
|
||||
$compareDistroVersionPrefix = function ($prefix, $fixedVersion) {
|
||||
$regex = '{^'.preg_quote($prefix).'([0-9]+)$}';
|
||||
|
||||
if (preg_match($regex, PHP_VERSION, $m)) {
|
||||
return ((int) $m[1]) >= $fixedVersion;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
// Hard coded list of PHP distributions with the fix backported.
|
||||
if (
|
||||
$compareDistroVersionPrefix('5.3.3-7+squeeze', 18) // Debian 6 (Squeeze)
|
||||
|| $compareDistroVersionPrefix('5.4.4-14+deb7u', 7) // Debian 7 (Wheezy)
|
||||
|| $compareDistroVersionPrefix('5.3.10-1ubuntu3.', 9) // Ubuntu 12.04 (Precise)
|
||||
) {
|
||||
return self::$useOpensslParse = true;
|
||||
}
|
||||
|
||||
// Symfony Process component is missing so we assume it is unsafe at this point
|
||||
if (!class_exists('Symfony\Component\Process\PhpProcess')) {
|
||||
return self::$useOpensslParse = false;
|
||||
}
|
||||
|
||||
// This is where things get crazy, because distros backport security
|
||||
// fixes the chances are on NIX systems the fix has been applied but
|
||||
// it's not possible to verify that from the PHP version.
|
||||
//
|
||||
// To verify exec a new PHP process and run the issue testcase with
|
||||
// known safe input that replicates the bug.
|
||||
|
||||
// Based on testcase in https://github.com/php/php-src/commit/c1224573c773b6845e83505f717fbf820fc18415
|
||||
// changes in https://github.com/php/php-src/commit/76a7fd893b7d6101300cc656058704a73254d593
|
||||
$cert = 'LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVwRENDQTR5Z0F3SUJBZ0lKQUp6dThyNnU2ZUJjTUEwR0NTcUdTSWIzRFFFQkJRVUFNSUhETVFzd0NRWUQKVlFRR0V3SkVSVEVjTUJvR0ExVUVDQXdUVG05eVpISm9aV2x1TFZkbGMzUm1ZV3hsYmpFUU1BNEdBMVVFQnd3SApTOE9Ed3Jac2JqRVVNQklHQTFVRUNnd0xVMlZyZEdsdmJrVnBibk14SHpBZEJnTlZCQXNNRmsxaGJHbGphVzkxCmN5QkRaWEowSUZObFkzUnBiMjR4SVRBZkJnTlZCQU1NR0cxaGJHbGphVzkxY3k1elpXdDBhVzl1WldsdWN5NWsKWlRFcU1DZ0dDU3FHU0liM0RRRUpBUlliYzNSbFptRnVMbVZ6YzJWeVFITmxhM1JwYjI1bGFXNXpMbVJsTUhVWQpaREU1TnpBd01UQXhNREF3TURBd1dnQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBCkFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUEKQUFBQUFBQVhEVEUwTVRFeU9ERXhNemt6TlZvd2djTXhDekFKQmdOVkJBWVRBa1JGTVJ3d0dnWURWUVFJREJOTwpiM0prY21obGFXNHRWMlZ6ZEdaaGJHVnVNUkF3RGdZRFZRUUhEQWRMdzRQQ3RteHVNUlF3RWdZRFZRUUtEQXRUClpXdDBhVzl1UldsdWN6RWZNQjBHQTFVRUN3d1dUV0ZzYVdOcGIzVnpJRU5sY25RZ1UyVmpkR2x2YmpFaE1COEcKQTFVRUF3d1liV0ZzYVdOcGIzVnpMbk5sYTNScGIyNWxhVzV6TG1SbE1Tb3dLQVlKS29aSWh2Y05BUWtCRmh0egpkR1ZtWVc0dVpYTnpaWEpBYzJWcmRHbHZibVZwYm5NdVpHVXdnZ0VpTUEwR0NTcUdTSWIzRFFFQkFRVUFBNElCCkR3QXdnZ0VLQW9JQkFRRERBZjNobDdKWTBYY0ZuaXlFSnBTU0RxbjBPcUJyNlFQNjV1c0pQUnQvOFBhRG9xQnUKd0VZVC9OYSs2ZnNnUGpDMHVLOURaZ1dnMnRIV1dvYW5TYmxBTW96NVBINlorUzRTSFJaN2UyZERJalBqZGhqaAowbUxnMlVNTzV5cDBWNzk3R2dzOWxOdDZKUmZIODFNTjJvYlhXczROdHp0TE11RDZlZ3FwcjhkRGJyMzRhT3M4CnBrZHVpNVVhd1Raa3N5NXBMUEhxNWNNaEZHbTA2djY1Q0xvMFYyUGQ5K0tBb2tQclBjTjVLTEtlYno3bUxwazYKU01lRVhPS1A0aWRFcXh5UTdPN2ZCdUhNZWRzUWh1K3ByWTNzaTNCVXlLZlF0UDVDWm5YMmJwMHdLSHhYMTJEWAoxbmZGSXQ5RGJHdkhUY3lPdU4rblpMUEJtM3ZXeG50eUlJdlZBZ01CQUFHalFqQkFNQWtHQTFVZEV3UUNNQUF3CkVRWUpZSVpJQVliNFFnRUJCQVFEQWdlQU1Bc0dBMVVkRHdRRUF3SUZvREFUQmdOVkhTVUVEREFLQmdnckJnRUYKQlFjREFqQU5CZ2txaGtpRzl3MEJBUVVGQUFPQ0FRRUFHMGZaWVlDVGJkajFYWWMrMVNub2FQUit2SThDOENhRAo4KzBVWWhkbnlVNGdnYTBCQWNEclk5ZTk0ZUVBdTZacXljRjZGakxxWFhkQWJvcHBXb2NyNlQ2R0QxeDMzQ2tsClZBcnpHL0t4UW9oR0QySmVxa2hJTWxEb214SE83a2EzOStPYThpMnZXTFZ5alU4QVp2V01BcnVIYTRFRU55RzcKbFcyQWFnYUZLRkNyOVRuWFRmcmR4R1ZFYnY3S1ZRNmJkaGc1cDVTanBXSDErTXEwM3VSM1pYUEJZZHlWODMxOQpvMGxWajFLRkkyRENML2xpV2lzSlJvb2YrMWNSMzVDdGQwd1lCY3BCNlRac2xNY09QbDc2ZHdLd0pnZUpvMlFnClpzZm1jMnZDMS9xT2xOdU5xLzBUenprVkd2OEVUVDNDZ2FVK1VYZTRYT1Z2a2NjZWJKbjJkZz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K';
|
||||
$script = <<<'EOT'
|
||||
|
||||
error_reporting(-1);
|
||||
$info = openssl_x509_parse(base64_decode('%s'));
|
||||
var_dump(PHP_VERSION, $info['issuer']['emailAddress'], $info['validFrom_time_t']);
|
||||
|
||||
EOT;
|
||||
$script = '<'."?php\n".sprintf($script, $cert);
|
||||
|
||||
try {
|
||||
$process = new PhpProcess($script);
|
||||
$process->mustRun();
|
||||
} catch (\Exception $e) {
|
||||
// In the case of any exceptions just accept it is not possible to
|
||||
// determine the safety of openssl_x509_parse and bail out.
|
||||
return self::$useOpensslParse = false;
|
||||
}
|
||||
|
||||
$output = preg_split('{\r?\n}', trim($process->getOutput()));
|
||||
$errorOutput = trim($process->getErrorOutput());
|
||||
|
||||
if (
|
||||
is_array($output)
|
||||
&& count($output) === 3
|
||||
&& $output[0] === sprintf('string(%d) "%s"', strlen(PHP_VERSION), PHP_VERSION)
|
||||
&& $output[1] === 'string(27) "stefan.esser@sektioneins.de"'
|
||||
&& $output[2] === 'int(-1)'
|
||||
&& preg_match('{openssl_x509_parse\(\): illegal (?:ASN1 data type for|length in) timestamp in - on line \d+}', $errorOutput)
|
||||
) {
|
||||
// This PHP has the fix backported probably by a distro security team.
|
||||
return self::$useOpensslParse = true;
|
||||
}
|
||||
|
||||
return self::$useOpensslParse = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the static caches
|
||||
* @return void
|
||||
*/
|
||||
public static function reset()
|
||||
{
|
||||
self::$caFileValidity = array();
|
||||
self::$caPath = null;
|
||||
self::$useOpensslParse = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @return string|false
|
||||
*/
|
||||
private static function getEnvVariable($name)
|
||||
{
|
||||
if (isset($_SERVER[$name])) {
|
||||
return (string) $_SERVER[$name];
|
||||
}
|
||||
|
||||
if (PHP_SAPI === 'cli' && ($value = getenv($name)) !== false && $value !== null) {
|
||||
return (string) $value;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|false $certFile
|
||||
* @return bool
|
||||
*/
|
||||
private static function caFileUsable($certFile, LoggerInterface $logger = null)
|
||||
{
|
||||
return $certFile && @is_file($certFile) && @is_readable($certFile) && static::validateCaFile($certFile, $logger);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|false $certDir
|
||||
* @return bool
|
||||
*/
|
||||
private static function caDirUsable($certDir)
|
||||
{
|
||||
return $certDir && @is_dir($certDir) && @is_readable($certDir) && glob($certDir . '/*');
|
||||
}
|
||||
}
|
100
twitter/vendor/composer/installed.json
vendored
100
twitter/vendor/composer/installed.json
vendored
|
@ -1,29 +1,32 @@
|
|||
[
|
||||
{
|
||||
"name": "abraham/twitteroauth",
|
||||
"version": "0.7.4",
|
||||
"version_normalized": "0.7.4.0",
|
||||
"version": "2.0.0",
|
||||
"version_normalized": "2.0.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/abraham/twitteroauth.git",
|
||||
"reference": "c6f9e692552dd037b2324ed0dfa28a4e60875acf"
|
||||
"reference": "96f49e67baec10f5e5cb703d87be16ba01a798a5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/abraham/twitteroauth/zipball/c6f9e692552dd037b2324ed0dfa28a4e60875acf",
|
||||
"reference": "c6f9e692552dd037b2324ed0dfa28a4e60875acf",
|
||||
"url": "https://api.github.com/repos/abraham/twitteroauth/zipball/96f49e67baec10f5e5cb703d87be16ba01a798a5",
|
||||
"reference": "96f49e67baec10f5e5cb703d87be16ba01a798a5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"composer/ca-bundle": "^1.2",
|
||||
"ext-curl": "*",
|
||||
"php": "^5.6 || ^7.0"
|
||||
"php": "^7.2 || ^7.3 || ^7.4 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpmd/phpmd": "~2.6",
|
||||
"phpunit/phpunit": "~5.7",
|
||||
"squizlabs/php_codesniffer": "~3.0"
|
||||
"php-vcr/php-vcr": "^1",
|
||||
"php-vcr/phpunit-testlistener-vcr": "dev-php-8",
|
||||
"phpmd/phpmd": "^2",
|
||||
"phpunit/phpunit": "^8",
|
||||
"squizlabs/php_codesniffer": "^3"
|
||||
},
|
||||
"time": "2017-06-30T22:02:01+00:00",
|
||||
"time": "2020-12-02T01:27:06+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
|
@ -55,6 +58,79 @@
|
|||
"twitter"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "composer/ca-bundle",
|
||||
"version": "1.2.10",
|
||||
"version_normalized": "1.2.10.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/composer/ca-bundle.git",
|
||||
"reference": "9fdb22c2e97a614657716178093cd1da90a64aa8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/composer/ca-bundle/zipball/9fdb22c2e97a614657716178093cd1da90a64aa8",
|
||||
"reference": "9fdb22c2e97a614657716178093cd1da90a64aa8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-openssl": "*",
|
||||
"ext-pcre": "*",
|
||||
"php": "^5.3.2 || ^7.0 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^0.12.55",
|
||||
"psr/log": "^1.0",
|
||||
"symfony/phpunit-bridge": "^4.2 || ^5",
|
||||
"symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0"
|
||||
},
|
||||
"time": "2021-06-07T13:58:28+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.x-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Composer\\CaBundle\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jordi Boggiano",
|
||||
"email": "j.boggiano@seld.be",
|
||||
"homepage": "http://seld.be"
|
||||
}
|
||||
],
|
||||
"description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.",
|
||||
"keywords": [
|
||||
"cabundle",
|
||||
"cacert",
|
||||
"certificate",
|
||||
"ssl",
|
||||
"tls"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://packagist.com",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/composer",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/composer/composer",
|
||||
"type": "tidelift"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "composer/installers",
|
||||
"version": "v1.6.0",
|
||||
|
@ -183,12 +259,12 @@
|
|||
"version_normalized": "9999999-dev",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jublonet/codebird-php.git",
|
||||
"url": "https://github.com/jublo/codebird-php.git",
|
||||
"reference": "df362d8ad629aad6c4c7dbf36a440e569ec41368"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/jublonet/codebird-php/zipball/df362d8ad629aad6c4c7dbf36a440e569ec41368",
|
||||
"url": "https://api.github.com/repos/jublo/codebird-php/zipball/df362d8ad629aad6c4c7dbf36a440e569ec41368",
|
||||
"reference": "df362d8ad629aad6c4c7dbf36a440e569ec41368",
|
||||
"shasum": ""
|
||||
},
|
||||
|
|
19
twitter/vendor/composer/installers/LICENSE
vendored
Normal file
19
twitter/vendor/composer/installers/LICENSE
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
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.
|
105
twitter/vendor/composer/installers/composer.json
vendored
Normal file
105
twitter/vendor/composer/installers/composer.json
vendored
Normal file
|
@ -0,0 +1,105 @@
|
|||
{
|
||||
"name": "composer/installers",
|
||||
"type": "composer-plugin",
|
||||
"license": "MIT",
|
||||
"description": "A multi-framework Composer library installer",
|
||||
"keywords": [
|
||||
"installer",
|
||||
"Aimeos",
|
||||
"AGL",
|
||||
"AnnotateCms",
|
||||
"Attogram",
|
||||
"Bitrix",
|
||||
"CakePHP",
|
||||
"Chef",
|
||||
"Cockpit",
|
||||
"CodeIgniter",
|
||||
"concrete5",
|
||||
"Craft",
|
||||
"Croogo",
|
||||
"DokuWiki",
|
||||
"Dolibarr",
|
||||
"Drupal",
|
||||
"Elgg",
|
||||
"Eliasis",
|
||||
"ExpressionEngine",
|
||||
"eZ Platform",
|
||||
"FuelPHP",
|
||||
"Grav",
|
||||
"Hurad",
|
||||
"ImageCMS",
|
||||
"iTop",
|
||||
"Joomla",
|
||||
"Kanboard",
|
||||
"Kohana",
|
||||
"Lan Management System",
|
||||
"Laravel",
|
||||
"Lavalite",
|
||||
"Lithium",
|
||||
"Magento",
|
||||
"majima",
|
||||
"Mako",
|
||||
"Mautic",
|
||||
"Maya",
|
||||
"MODX",
|
||||
"MODX Evo",
|
||||
"MediaWiki",
|
||||
"OXID",
|
||||
"osclass",
|
||||
"MODULEWork",
|
||||
"Moodle",
|
||||
"Piwik",
|
||||
"pxcms",
|
||||
"phpBB",
|
||||
"Plentymarkets",
|
||||
"PPI",
|
||||
"Puppet",
|
||||
"Porto",
|
||||
"RadPHP",
|
||||
"ReIndex",
|
||||
"Roundcube",
|
||||
"shopware",
|
||||
"SilverStripe",
|
||||
"SMF",
|
||||
"SyDES",
|
||||
"symfony",
|
||||
"Thelia",
|
||||
"TYPO3",
|
||||
"WolfCMS",
|
||||
"WordPress",
|
||||
"YAWIK",
|
||||
"Zend",
|
||||
"Zikula"
|
||||
],
|
||||
"homepage": "https://composer.github.io/installers/",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Kyle Robinson Young",
|
||||
"email": "kyle@dontkry.com",
|
||||
"homepage": "https://github.com/shama"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"psr-4": { "Composer\\Installers\\": "src/Composer/Installers" }
|
||||
},
|
||||
"extra": {
|
||||
"class": "Composer\\Installers\\Plugin",
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0-dev"
|
||||
}
|
||||
},
|
||||
"replace": {
|
||||
"shama/baton": "*",
|
||||
"roundcube/plugin-installer": "*"
|
||||
},
|
||||
"require": {
|
||||
"composer-plugin-api": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"composer/composer": "1.0.*@dev",
|
||||
"phpunit/phpunit": "^4.8.36"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "phpunit"
|
||||
}
|
||||
}
|
21
twitter/vendor/composer/installers/src/Composer/Installers/AglInstaller.php
vendored
Normal file
21
twitter/vendor/composer/installers/src/Composer/Installers/AglInstaller.php
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
9
twitter/vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php
vendored
Normal file
9
twitter/vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AimeosInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'extension' => 'ext/{$name}/',
|
||||
);
|
||||
}
|
11
twitter/vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php
vendored
Normal file
11
twitter/vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AnnotateCmsInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'addons/modules/{$name}/',
|
||||
'component' => 'addons/components/{$name}/',
|
||||
'service' => 'addons/services/{$name}/',
|
||||
);
|
||||
}
|
49
twitter/vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php
vendored
Normal file
49
twitter/vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
9
twitter/vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php
vendored
Normal file
9
twitter/vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AttogramInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
}
|
136
twitter/vendor/composer/installers/src/Composer/Installers/BaseInstaller.php
vendored
Normal file
136
twitter/vendor/composer/installers/src/Composer/Installers/BaseInstaller.php
vendored
Normal file
|
@ -0,0 +1,136 @@
|
|||
<?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 $vars
|
||||
* @return array
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the installer's locations
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getLocations()
|
||||
{
|
||||
return $this->locations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace vars in a path
|
||||
*
|
||||
* @param string $path
|
||||
* @param array $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
|
||||
*/
|
||||
protected function mapCustomInstallPaths(array $paths, $name, $type, $vendor = NULL)
|
||||
{
|
||||
foreach ($paths as $path => $names) {
|
||||
if (in_array($name, $names) || in_array('type:' . $type, $names) || in_array('vendor:' . $vendor, $names)) {
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
126
twitter/vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php
vendored
Normal file
126
twitter/vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php
vendored
Normal file
|
@ -0,0 +1,126 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
9
twitter/vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php
vendored
Normal file
9
twitter/vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class BonefishInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'package' => 'Packages/{$vendor}/{$name}/'
|
||||
);
|
||||
}
|
82
twitter/vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php
vendored
Normal file
82
twitter/vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php
vendored
Normal file
|
@ -0,0 +1,82 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\DependencyResolver\Pool;
|
||||
|
||||
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
|
||||
*/
|
||||
protected function matchesCakeVersion($matcher, $version)
|
||||
{
|
||||
if (class_exists('Composer\Semver\Constraint\MultiConstraint')) {
|
||||
$multiClass = 'Composer\Semver\Constraint\MultiConstraint';
|
||||
$constraintClass = 'Composer\Semver\Constraint\Constraint';
|
||||
} else {
|
||||
$multiClass = 'Composer\Package\LinkConstraint\MultiConstraint';
|
||||
$constraintClass = 'Composer\Package\LinkConstraint\VersionConstraint';
|
||||
}
|
||||
|
||||
$repositoryManager = $this->composer->getRepositoryManager();
|
||||
if ($repositoryManager) {
|
||||
$repos = $repositoryManager->getLocalRepository();
|
||||
if (!$repos) {
|
||||
return false;
|
||||
}
|
||||
$cake3 = new $multiClass(array(
|
||||
new $constraintClass($matcher, $version),
|
||||
new $constraintClass('!=', '9999999-dev'),
|
||||
));
|
||||
$pool = new Pool('dev');
|
||||
$pool->addRepository($repos);
|
||||
$packages = $pool->whatProvides('cakephp/cakephp');
|
||||
foreach ($packages as $package) {
|
||||
$installed = new $constraintClass('=', $package->getVersion());
|
||||
if ($cake3->matches($installed)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
11
twitter/vendor/composer/installers/src/Composer/Installers/ChefInstaller.php
vendored
Normal file
11
twitter/vendor/composer/installers/src/Composer/Installers/ChefInstaller.php
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ChefInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'cookbook' => 'Chef/{$vendor}/{$name}/',
|
||||
'role' => 'Chef/roles/{$name}/',
|
||||
);
|
||||
}
|
||||
|
9
twitter/vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php
vendored
Normal file
9
twitter/vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class CiviCrmInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'ext' => 'ext/{$name}/'
|
||||
);
|
||||
}
|
10
twitter/vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php
vendored
Normal file
10
twitter/vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ClanCatsFrameworkInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'ship' => 'CCF/orbit/{$name}/',
|
||||
'theme' => 'CCF/app/themes/{$name}/',
|
||||
);
|
||||
}
|
34
twitter/vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php
vendored
Normal file
34
twitter/vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?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.
|
||||
*
|
||||
* @param array @vars
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
11
twitter/vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php
vendored
Normal file
11
twitter/vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?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}/',
|
||||
);
|
||||
}
|
13
twitter/vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php
vendored
Normal file
13
twitter/vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?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}/',
|
||||
);
|
||||
}
|
35
twitter/vendor/composer/installers/src/Composer/Installers/CraftInstaller.php
vendored
Normal file
35
twitter/vendor/composer/installers/src/Composer/Installers/CraftInstaller.php
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
21
twitter/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php
vendored
Normal file
21
twitter/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
10
twitter/vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php
vendored
Normal file
10
twitter/vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class DecibelInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array */
|
||||
protected $locations = array(
|
||||
'app' => 'app/{$name}/',
|
||||
);
|
||||
}
|
50
twitter/vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php
vendored
Normal file
50
twitter/vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php
vendored
Normal file
|
@ -0,0 +1,50 @@
|
|||
<?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;
|
||||
}
|
||||
|
||||
}
|
16
twitter/vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php
vendored
Normal file
16
twitter/vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?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}/',
|
||||
);
|
||||
}
|
16
twitter/vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php
vendored
Normal file
16
twitter/vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?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}/',
|
||||
'drush' => 'drush/{$name}/',
|
||||
'custom-theme' => 'themes/custom/{$name}/',
|
||||
'custom-module' => 'modules/custom/{$name}/',
|
||||
);
|
||||
}
|
9
twitter/vendor/composer/installers/src/Composer/Installers/ElggInstaller.php
vendored
Normal file
9
twitter/vendor/composer/installers/src/Composer/Installers/ElggInstaller.php
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ElggInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'mod/{$name}/',
|
||||
);
|
||||
}
|
12
twitter/vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php
vendored
Normal file
12
twitter/vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class EliasisInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'component' => 'components/{$name}/',
|
||||
'module' => 'modules/{$name}/',
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
'template' => 'templates/{$name}/',
|
||||
);
|
||||
}
|
29
twitter/vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php
vendored
Normal file
29
twitter/vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?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);
|
||||
}
|
||||
}
|
10
twitter/vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php
vendored
Normal file
10
twitter/vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class EzPlatformInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'meta-assets' => 'web/assets/ezplatform/',
|
||||
'assets' => 'web/assets/ezplatform/{$name}/',
|
||||
);
|
||||
}
|
11
twitter/vendor/composer/installers/src/Composer/Installers/FuelInstaller.php
vendored
Normal file
11
twitter/vendor/composer/installers/src/Composer/Installers/FuelInstaller.php
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?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}/',
|
||||
);
|
||||
}
|
9
twitter/vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php
vendored
Normal file
9
twitter/vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class FuelphpInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'component' => 'components/{$name}/',
|
||||
);
|
||||
}
|
30
twitter/vendor/composer/installers/src/Composer/Installers/GravInstaller.php
vendored
Normal file
30
twitter/vendor/composer/installers/src/Composer/Installers/GravInstaller.php
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
25
twitter/vendor/composer/installers/src/Composer/Installers/HuradInstaller.php
vendored
Normal file
25
twitter/vendor/composer/installers/src/Composer/Installers/HuradInstaller.php
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
11
twitter/vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php
vendored
Normal file
11
twitter/vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ImageCMSInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'template' => 'templates/{$name}/',
|
||||
'module' => 'application/modules/{$name}/',
|
||||
'library' => 'application/libraries/{$name}/',
|
||||
);
|
||||
}
|
274
twitter/vendor/composer/installers/src/Composer/Installers/Installer.php
vendored
Normal file
274
twitter/vendor/composer/installers/src/Composer/Installers/Installer.php
vendored
Normal file
|
@ -0,0 +1,274 @@
|
|||
<?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;
|
||||
|
||||
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',
|
||||
'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',
|
||||
'imagecms' => 'ImageCMSInstaller',
|
||||
'itop' => 'ItopInstaller',
|
||||
'joomla' => 'JoomlaInstaller',
|
||||
'kanboard' => 'KanboardInstaller',
|
||||
'kirby' => 'KirbyInstaller',
|
||||
'kodicms' => 'KodiCMSInstaller',
|
||||
'kohana' => 'KohanaInstaller',
|
||||
'lms' => 'LanManagementSystemInstaller',
|
||||
'laravel' => 'LaravelInstaller',
|
||||
'lavalite' => 'LavaLiteInstaller',
|
||||
'lithium' => 'LithiumInstaller',
|
||||
'magento' => 'MagentoInstaller',
|
||||
'majima' => 'MajimaInstaller',
|
||||
'mako' => 'MakoInstaller',
|
||||
'maya' => 'MayaInstaller',
|
||||
'mautic' => 'MauticInstaller',
|
||||
'mediawiki' => 'MediaWikiInstaller',
|
||||
'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',
|
||||
'redaxo' => 'RedaxoInstaller',
|
||||
'reindex' => 'ReIndexInstaller',
|
||||
'roundcube' => 'RoundcubeInstaller',
|
||||
'shopware' => 'ShopwareInstaller',
|
||||
'sitedirect' => 'SiteDirectInstaller',
|
||||
'silverstripe' => 'SilverStripeInstaller',
|
||||
'smf' => 'SMFInstaller',
|
||||
'sydes' => 'SyDESInstaller',
|
||||
'symfony1' => 'Symfony1Installer',
|
||||
'thelia' => 'TheliaInstaller',
|
||||
'tusk' => 'TuskInstaller',
|
||||
'typo3-cms' => 'TYPO3CmsInstaller',
|
||||
'typo3-flow' => 'TYPO3FlowInstaller',
|
||||
'userfrosting' => 'UserFrostingInstaller',
|
||||
'vanilla' => 'VanillaInstaller',
|
||||
'whmcs' => 'WHMCSInstaller',
|
||||
'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)
|
||||
{
|
||||
parent::uninstall($repo, $package);
|
||||
$installPath = $this->getPackageBasePath($package);
|
||||
$this->io->write(sprintf('Deleting %s - %s', $installPath, !file_exists($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@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
|
||||
*/
|
||||
protected function findFrameworkType($type)
|
||||
{
|
||||
$frameworkType = false;
|
||||
|
||||
krsort($this->supportedTypes);
|
||||
|
||||
foreach ($this->supportedTypes as $key => $val) {
|
||||
if ($key === substr($type, 0, strlen($key))) {
|
||||
$frameworkType = substr($type, 0, strlen($key));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $frameworkType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
9
twitter/vendor/composer/installers/src/Composer/Installers/ItopInstaller.php
vendored
Normal file
9
twitter/vendor/composer/installers/src/Composer/Installers/ItopInstaller.php
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ItopInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'extension' => 'extensions/{$name}/',
|
||||
);
|
||||
}
|
15
twitter/vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php
vendored
Normal file
15
twitter/vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?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
|
||||
}
|
18
twitter/vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php
vendored
Normal file
18
twitter/vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?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}/',
|
||||
);
|
||||
}
|
11
twitter/vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php
vendored
Normal file
11
twitter/vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class KirbyInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'site/plugins/{$name}/',
|
||||
'field' => 'site/fields/{$name}/',
|
||||
'tag' => 'site/tags/{$name}/'
|
||||
);
|
||||
}
|
10
twitter/vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php
vendored
Normal file
10
twitter/vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class KodiCMSInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'cms/plugins/{$name}/',
|
||||
'media' => 'cms/media/vendor/{$name}/'
|
||||
);
|
||||
}
|
9
twitter/vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php
vendored
Normal file
9
twitter/vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class KohanaInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
}
|
27
twitter/vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php
vendored
Normal file
27
twitter/vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?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;
|
||||
}
|
||||
|
||||
}
|
9
twitter/vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php
vendored
Normal file
9
twitter/vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class LaravelInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'library' => 'libraries/{$name}/',
|
||||
);
|
||||
}
|
10
twitter/vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php
vendored
Normal file
10
twitter/vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class LavaLiteInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'package' => 'packages/{$vendor}/{$name}/',
|
||||
'theme' => 'public/themes/{$name}/',
|
||||
);
|
||||
}
|
10
twitter/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php
vendored
Normal file
10
twitter/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class LithiumInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'library' => 'libraries/{$name}/',
|
||||
'source' => 'libraries/_source/{$name}/',
|
||||
);
|
||||
}
|
9
twitter/vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php
vendored
Normal file
9
twitter/vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MODULEWorkInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
}
|
16
twitter/vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php
vendored
Normal file
16
twitter/vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?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}/'
|
||||
);
|
||||
}
|
11
twitter/vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php
vendored
Normal file
11
twitter/vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MagentoInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'theme' => 'app/design/frontend/{$name}/',
|
||||
'skin' => 'skin/frontend/default/{$name}/',
|
||||
'library' => 'lib/{$name}/',
|
||||
);
|
||||
}
|
37
twitter/vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php
vendored
Normal file
37
twitter/vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
9
twitter/vendor/composer/installers/src/Composer/Installers/MakoInstaller.php
vendored
Normal file
9
twitter/vendor/composer/installers/src/Composer/Installers/MakoInstaller.php
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MakoInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'package' => 'app/packages/{$name}/',
|
||||
);
|
||||
}
|
25
twitter/vendor/composer/installers/src/Composer/Installers/MauticInstaller.php
vendored
Normal file
25
twitter/vendor/composer/installers/src/Composer/Installers/MauticInstaller.php
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MauticInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
'theme' => 'themes/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name of mautic-plugins to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
if ($vars['type'] == 'mautic-plugin') {
|
||||
$vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) {
|
||||
return strtoupper($matches[0][1]);
|
||||
}, ucfirst($vars['name']));
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
}
|
33
twitter/vendor/composer/installers/src/Composer/Installers/MayaInstaller.php
vendored
Normal file
33
twitter/vendor/composer/installers/src/Composer/Installers/MayaInstaller.php
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
51
twitter/vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php
vendored
Normal file
51
twitter/vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
<?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;
|
||||
}
|
||||
|
||||
}
|
111
twitter/vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php
vendored
Normal file
111
twitter/vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php
vendored
Normal file
|
@ -0,0 +1,111 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MicroweberInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'userfiles/modules/{$name}/',
|
||||
'module-skin' => 'userfiles/modules/{$name}/templates/',
|
||||
'template' => 'userfiles/templates/{$name}/',
|
||||
'element' => 'userfiles/elements/{$name}/',
|
||||
'vendor' => 'vendor/{$name}/',
|
||||
'components' => 'components/{$name}/'
|
||||
);
|
||||
|
||||
/**
|
||||
* 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 ($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['name'] = preg_replace('/-template$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/template-$/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectTemplatesVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-templates$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/templates-$/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectCoreVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-providers$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/-provider$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/-adapter$/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectModuleVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-module$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/module-$/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectModulesVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-modules$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/modules-$/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectSkinVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-skin$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/skin-$/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectElementVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-elements$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/elements-$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/-element$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/element-$/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
12
twitter/vendor/composer/installers/src/Composer/Installers/ModxInstaller.php
vendored
Normal file
12
twitter/vendor/composer/installers/src/Composer/Installers/ModxInstaller.php
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* An installer to handle MODX specifics when installing packages.
|
||||
*/
|
||||
class ModxInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'extra' => 'core/packages/{$name}/'
|
||||
);
|
||||
}
|
57
twitter/vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php
vendored
Normal file
57
twitter/vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php
vendored
Normal file
|
@ -0,0 +1,57 @@
|
|||
<?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}/',
|
||||
'format' => 'course/format/{$name}/',
|
||||
'coursereport' => 'course/report/{$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}/'
|
||||
);
|
||||
}
|
47
twitter/vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php
vendored
Normal file
47
twitter/vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php
vendored
Normal file
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class OctoberInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
'plugin' => 'plugins/{$vendor}/{$name}/',
|
||||
'theme' => 'themes/{$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']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
24
twitter/vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php
vendored
Normal file
24
twitter/vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
14
twitter/vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php
vendored
Normal file
14
twitter/vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?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}/',
|
||||
);
|
||||
|
||||
}
|
59
twitter/vendor/composer/installers/src/Composer/Installers/OxidInstaller.php
vendored
Normal file
59
twitter/vendor/composer/installers/src/Composer/Installers/OxidInstaller.php
vendored
Normal file
|
@ -0,0 +1,59 @@
|
|||
<?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 void
|
||||
*/
|
||||
public function getInstallPath(PackageInterface $package, $frameworkType = '')
|
||||
{
|
||||
$installPath = parent::getInstallPath($package, $frameworkType);
|
||||
$type = $this->package->getType();
|
||||
if ($type === 'oxid-module') {
|
||||
$this->prepareVendorDirectory($installPath);
|
||||
}
|
||||
return $installPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* prepareVendorDirectory
|
||||
*
|
||||
* Makes sure there is a vendormetadata.php file inside
|
||||
* the vendor folder if there is a vendor folder.
|
||||
*
|
||||
* @param string $installPath
|
||||
* @return void
|
||||
*/
|
||||
protected function prepareVendorDirectory($installPath)
|
||||
{
|
||||
$matches = '';
|
||||
$hasVendorDirectory = preg_match(self::VENDOR_PATTERN, $installPath, $matches);
|
||||
if (!$hasVendorDirectory) {
|
||||
return;
|
||||
}
|
||||
|
||||
$vendorDirectory = $matches['vendor'];
|
||||
$vendorPath = getcwd() . '/modules/' . $vendorDirectory;
|
||||
if (!file_exists($vendorPath)) {
|
||||
mkdir($vendorPath, 0755, true);
|
||||
}
|
||||
|
||||
$vendorMetaDataPath = $vendorPath . '/vendormetadata.php';
|
||||
touch($vendorMetaDataPath);
|
||||
}
|
||||
}
|
9
twitter/vendor/composer/installers/src/Composer/Installers/PPIInstaller.php
vendored
Normal file
9
twitter/vendor/composer/installers/src/Composer/Installers/PPIInstaller.php
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PPIInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
}
|
11
twitter/vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php
vendored
Normal file
11
twitter/vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PhiftyInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'bundle' => 'bundles/{$name}/',
|
||||
'library' => 'libraries/{$name}/',
|
||||
'framework' => 'frameworks/{$name}/',
|
||||
);
|
||||
}
|
11
twitter/vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php
vendored
Normal file
11
twitter/vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PhpBBInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'extension' => 'ext/{$vendor}/{$name}/',
|
||||
'language' => 'language/{$name}/',
|
||||
'style' => 'styles/{$name}/',
|
||||
);
|
||||
}
|
21
twitter/vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php
vendored
Normal file
21
twitter/vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
32
twitter/vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php
vendored
Normal file
32
twitter/vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
29
twitter/vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php
vendored
Normal file
29
twitter/vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
17
twitter/vendor/composer/installers/src/Composer/Installers/Plugin.php
vendored
Normal file
17
twitter/vendor/composer/installers/src/Composer/Installers/Plugin.php
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\Composer;
|
||||
use Composer\IO\IOInterface;
|
||||
use Composer\Plugin\PluginInterface;
|
||||
|
||||
class Plugin implements PluginInterface
|
||||
{
|
||||
|
||||
public function activate(Composer $composer, IOInterface $io)
|
||||
{
|
||||
$installer = new Installer($io, $composer);
|
||||
$composer->getInstallationManager()->addInstaller($installer);
|
||||
}
|
||||
}
|
9
twitter/vendor/composer/installers/src/Composer/Installers/PortoInstaller.php
vendored
Normal file
9
twitter/vendor/composer/installers/src/Composer/Installers/PortoInstaller.php
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PortoInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'container' => 'app/Containers/{$name}/',
|
||||
);
|
||||
}
|
10
twitter/vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php
vendored
Normal file
10
twitter/vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PrestashopInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
'theme' => 'themes/{$name}/',
|
||||
);
|
||||
}
|
11
twitter/vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php
vendored
Normal file
11
twitter/vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PuppetInstaller extends BaseInstaller
|
||||
{
|
||||
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
}
|
63
twitter/vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php
vendored
Normal file
63
twitter/vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php
vendored
Normal file
|
@ -0,0 +1,63 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
24
twitter/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php
vendored
Normal file
24
twitter/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
10
twitter/vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php
vendored
Normal file
10
twitter/vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ReIndexInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'theme' => 'themes/{$name}/',
|
||||
'plugin' => 'plugins/{$name}/'
|
||||
);
|
||||
}
|
10
twitter/vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php
vendored
Normal file
10
twitter/vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?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}/'
|
||||
);
|
||||
}
|
22
twitter/vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php
vendored
Normal file
22
twitter/vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
10
twitter/vendor/composer/installers/src/Composer/Installers/SMFInstaller.php
vendored
Normal file
10
twitter/vendor/composer/installers/src/Composer/Installers/SMFInstaller.php
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class SMFInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'Sources/{$name}/',
|
||||
'theme' => 'Themes/{$name}/',
|
||||
);
|
||||
}
|
60
twitter/vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php
vendored
Normal file
60
twitter/vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php
vendored
Normal file
|
@ -0,0 +1,60 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
35
twitter/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php
vendored
Normal file
35
twitter/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?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);
|
||||
}
|
||||
}
|
25
twitter/vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php
vendored
Normal file
25
twitter/vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
49
twitter/vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php
vendored
Normal file
49
twitter/vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?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.
|
||||
*
|
||||
* @param array @vars
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
26
twitter/vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php
vendored
Normal file
26
twitter/vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
16
twitter/vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php
vendored
Normal file
16
twitter/vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?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}/',
|
||||
);
|
||||
}
|
38
twitter/vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php
vendored
Normal file
38
twitter/vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* An installer to handle TYPO3 Flow specifics when installing packages.
|
||||
*/
|
||||
class TYPO3FlowInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'package' => 'Packages/Application/{$name}/',
|
||||
'framework' => 'Packages/Framework/{$name}/',
|
||||
'plugin' => 'Packages/Plugins/{$name}/',
|
||||
'site' => 'Packages/Sites/{$name}/',
|
||||
'boilerplate' => 'Packages/Boilerplates/{$name}/',
|
||||
'build' => 'Build/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Modify the package name to be a TYPO3 Flow style key.
|
||||
*
|
||||
* @param array $vars
|
||||
* @return array
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
$autoload = $this->package->getAutoload();
|
||||
if (isset($autoload['psr-0']) && is_array($autoload['psr-0'])) {
|
||||
$namespace = key($autoload['psr-0']);
|
||||
$vars['name'] = str_replace('\\', '.', $namespace);
|
||||
}
|
||||
if (isset($autoload['psr-4']) && is_array($autoload['psr-4'])) {
|
||||
$namespace = key($autoload['psr-4']);
|
||||
$vars['name'] = rtrim(str_replace('\\', '.', $namespace), '.');
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
12
twitter/vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php
vendored
Normal file
12
twitter/vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class TheliaInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'local/modules/{$name}/',
|
||||
'frontoffice-template' => 'templates/frontOffice/{$name}/',
|
||||
'backoffice-template' => 'templates/backOffice/{$name}/',
|
||||
'email-template' => 'templates/email/{$name}/',
|
||||
);
|
||||
}
|
14
twitter/vendor/composer/installers/src/Composer/Installers/TuskInstaller.php
vendored
Normal file
14
twitter/vendor/composer/installers/src/Composer/Installers/TuskInstaller.php
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
/**
|
||||
* Composer installer for 3rd party Tusk utilities
|
||||
* @author Drew Ewing <drew@phenocode.com>
|
||||
*/
|
||||
class TuskInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'task' => '.tusk/tasks/{$name}/',
|
||||
'command' => '.tusk/commands/{$name}/',
|
||||
'asset' => 'assets/tusk/{$name}/',
|
||||
);
|
||||
}
|
9
twitter/vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php
vendored
Normal file
9
twitter/vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class UserFrostingInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'sprinkle' => 'app/sprinkles/{$name}/',
|
||||
);
|
||||
}
|
10
twitter/vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php
vendored
Normal file
10
twitter/vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class VanillaInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
'theme' => 'themes/{$name}/',
|
||||
);
|
||||
}
|
49
twitter/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php
vendored
Normal file
49
twitter/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class VgmcpInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'bundle' => 'src/{$vendor}/{$name}/',
|
||||
'theme' => 'themes/{$name}/'
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name.
|
||||
*
|
||||
* For package type vgmcp-bundle, cut off a trailing '-bundle' if present.
|
||||
*
|
||||
* For package type vgmcp-theme, cut off a trailing '-theme' if present.
|
||||
*
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
if ($vars['type'] === 'vgmcp-bundle') {
|
||||
return $this->inflectPluginVars($vars);
|
||||
}
|
||||
|
||||
if ($vars['type'] === 'vgmcp-theme') {
|
||||
return $this->inflectThemeVars($vars);
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectPluginVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-bundle$/', '', $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;
|
||||
}
|
||||
}
|
10
twitter/vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php
vendored
Normal file
10
twitter/vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class WHMCSInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'gateway' => 'modules/gateways/{$name}/',
|
||||
);
|
||||
}
|
9
twitter/vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php
vendored
Normal file
9
twitter/vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class WolfCMSInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'wolf/plugins/{$name}/',
|
||||
);
|
||||
}
|
12
twitter/vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php
vendored
Normal file
12
twitter/vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class WordPressInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'wp-content/plugins/{$name}/',
|
||||
'theme' => 'wp-content/themes/{$name}/',
|
||||
'muplugin' => 'wp-content/mu-plugins/{$name}/',
|
||||
'dropin' => 'wp-content/{$name}/',
|
||||
);
|
||||
}
|
32
twitter/vendor/composer/installers/src/Composer/Installers/YawikInstaller.php
vendored
Normal file
32
twitter/vendor/composer/installers/src/Composer/Installers/YawikInstaller.php
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: cbleek
|
||||
* Date: 25.03.16
|
||||
* Time: 20:55
|
||||
*/
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
|
||||
class YawikInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'module/{$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;
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue