Commit ef326513 authored by catch's avatar catch

Issue #1977570 by RobLoach: Update third-party vendors and fix composer.json

parent e5fbed4c
......@@ -4,22 +4,22 @@
"type": "drupal-core",
"license": "GPL-2.0+",
"require": {
"symfony/class-loader": "2.2.0",
"symfony/dependency-injection": "2.2.0",
"symfony/event-dispatcher": "2.2.0",
"symfony/http-foundation": "2.2.0",
"symfony/http-kernel": "2.2.0",
"symfony/routing": "2.2.0",
"symfony/serializer": "2.2.0",
"symfony/validator": "2.2.0",
"symfony/yaml": "2.2.0",
"twig/twig": "1.12.1",
"doctrine/common": "2.3.0",
"guzzle/http": "3.1.0",
"kriswallsmith/assetic": "1.1.0-alpha1",
"symfony-cmf/routing": "dev-master#ea4a10",
"easyrdf/easyrdf": "0.8.0-beta.1",
"phpunit/phpunit": "3.7.15"
"symfony/class-loader": "2.2.*",
"symfony/dependency-injection": "2.2.*",
"symfony/event-dispatcher": "2.2.*",
"symfony/http-foundation": "2.2.*",
"symfony/http-kernel": "2.2.*",
"symfony/routing": "2.2.*",
"symfony/serializer": "2.2.*",
"symfony/validator": "2.2.*",
"symfony/yaml": "2.2.*",
"twig/twig": "1.12.*",
"doctrine/common": "2.3.*",
"guzzle/http": "3.1.*",
"kriswallsmith/assetic": "1.1.*@alpha",
"symfony-cmf/routing": "1.1.*@alpha",
"easyrdf/easyrdf": "0.8.*@beta",
"phpunit/phpunit": "3.7.*"
},
"autoload": {
"psr-0": {
......@@ -28,8 +28,8 @@
"Drupal\\Driver": "drivers/lib/"
}
},
"minimum-stability": "dev",
"config": {
"vendor-dir": "core/vendor"
"vendor-dir": "core/vendor",
"preferred-install": "dist"
}
}
This diff is collapsed.
# SimpleTest breaks with the following files, so avoid adding them.
symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php
symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/php5.4/traits.php
symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services11.php
vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php
vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/php5.4/traits.php
vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services11.php
# The resources for the Validator component are not required.
symfony/validator/Symfony/Component/Validator/Resources
vendor/symfony/validator/Symfony/Component/Validator/Resources
# Symfony Validator depends on Symfony Translation but only requires the
# TranslatorInterface. Thus, we add only the required interface from Symfony
# Translation by ignoring everything except the interface.
symfony/translation/Symfony/Component/Translation/*
!symfony/translation/Symfony/Component/Translation/TranslatorInterface.php
vendor/symfony/translation/Symfony/Component/Translation/*
!vendor/symfony/translation/Symfony/Component/Translation/TranslatorInterface.php
# PHPUnit provides some binary dependencies that are already available.
vendor/phpunit/phpunit/build/dependencies
......@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit7f0efddf867398398517e0ca6863b8f1::getLoader();
return ComposerAutoloaderInitc244582ae2d491644d70197d64a9670b::getLoader();
......@@ -49,7 +49,7 @@ class ClassLoader
public function getPrefixes()
{
return $this->prefixes;
return call_user_func_array('array_merge', $this->prefixes);
}
public function getFallbackDirs()
......@@ -98,19 +98,21 @@ public function add($prefix, $paths, $prepend = false)
return;
}
if (!isset($this->prefixes[$prefix])) {
$this->prefixes[$prefix] = (array) $paths;
$first = $prefix[0];
if (!isset($this->prefixes[$first][$prefix])) {
$this->prefixes[$first][$prefix] = (array) $paths;
return;
}
if ($prepend) {
$this->prefixes[$prefix] = array_merge(
$this->prefixes[$first][$prefix] = array_merge(
(array) $paths,
$this->prefixes[$prefix]
$this->prefixes[$first][$prefix]
);
} else {
$this->prefixes[$prefix] = array_merge(
$this->prefixes[$prefix],
$this->prefixes[$first][$prefix] = array_merge(
$this->prefixes[$first][$prefix],
(array) $paths
);
}
......@@ -129,7 +131,7 @@ public function set($prefix, $paths)
return;
}
$this->prefixes[$prefix] = (array) $paths;
$this->prefixes[substr($prefix, 0, 1)][$prefix] = (array) $paths;
}
/**
......@@ -175,7 +177,7 @@ public function unregister()
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return bool|null True, if loaded
* @return bool|null True if loaded, null otherwise
*/
public function loadClass($class)
{
......@@ -191,7 +193,7 @@ public function loadClass($class)
*
* @param string $class The name of the class
*
* @return string|null The path, if found
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
......@@ -205,7 +207,7 @@ public function findFile($class)
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)) . DIRECTORY_SEPARATOR;
$classPath = strtr(substr($class, 0, $pos), '\\', DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
$className = substr($class, $pos + 1);
} else {
// PEAR-like class name
......@@ -213,13 +215,16 @@ public function findFile($class)
$className = $class;
}
$classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
$classPath .= strtr($className, '_', DIRECTORY_SEPARATOR) . '.php';
foreach ($this->prefixes as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) {
return $dir . DIRECTORY_SEPARATOR . $classPath;
$first = $class[0];
if (isset($this->prefixes[$first])) {
foreach ($this->prefixes[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) {
return $dir . DIRECTORY_SEPARATOR . $classPath;
}
}
}
}
......
This diff is collapsed.
......@@ -2,32 +2,32 @@
// autoload_namespaces.php generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname(dirname($vendorDir));
return array(
'Drupal\\Driver' => $baseDir . '/../drivers/lib/',
'Drupal\\Core' => $baseDir . '/lib/',
'Drupal\\Component' => $baseDir . '/lib/',
'Twig_' => $vendorDir . '/twig/twig/lib/',
'Symfony\\Component\\Yaml\\' => $vendorDir . '/symfony/yaml/',
'Symfony\\Component\\Validator\\' => $vendorDir . '/symfony/validator/',
'Symfony\\Component\\Translation\\' => $vendorDir . '/symfony/translation/',
'Symfony\\Component\\Serializer\\' => $vendorDir . '/symfony/serializer/',
'Symfony\\Component\\Routing\\' => $vendorDir . '/symfony/routing/',
'Symfony\\Component\\Process' => $vendorDir . '/symfony/process/',
'Symfony\\Component\\HttpKernel\\' => $vendorDir . '/symfony/http-kernel/',
'Symfony\\Component\\HttpFoundation\\' => $vendorDir . '/symfony/http-foundation/',
'Symfony\\Component\\EventDispatcher\\' => $vendorDir . '/symfony/event-dispatcher/',
'Symfony\\Component\\DependencyInjection\\' => $vendorDir . '/symfony/dependency-injection/',
'Symfony\\Component\\ClassLoader\\' => $vendorDir . '/symfony/class-loader/',
'Symfony\\Cmf\\Component\\Routing' => $vendorDir . '/symfony-cmf/routing/',
'Psr\\Log\\' => $vendorDir . '/psr/log/',
'Guzzle\\Stream' => $vendorDir . '/guzzle/stream/',
'Guzzle\\Parser' => $vendorDir . '/guzzle/parser/',
'Guzzle\\Http' => $vendorDir . '/guzzle/http/',
'Guzzle\\Common' => $vendorDir . '/guzzle/common/',
'EasyRdf_' => $vendorDir . '/easyrdf/easyrdf/lib/',
'Doctrine\\Common' => $vendorDir . '/doctrine/common/lib/',
'Assetic' => $vendorDir . '/kriswallsmith/assetic/src/',
'Twig_' => array($vendorDir . '/twig/twig/lib'),
'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
'Symfony\\Component\\Validator\\' => array($vendorDir . '/symfony/validator'),
'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'),
'Symfony\\Component\\Serializer\\' => array($vendorDir . '/symfony/serializer'),
'Symfony\\Component\\Routing\\' => array($vendorDir . '/symfony/routing'),
'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'),
'Symfony\\Component\\HttpKernel\\' => array($vendorDir . '/symfony/http-kernel'),
'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'),
'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'),
'Symfony\\Component\\DependencyInjection\\' => array($vendorDir . '/symfony/dependency-injection'),
'Symfony\\Component\\ClassLoader\\' => array($vendorDir . '/symfony/class-loader'),
'Symfony\\Cmf\\Component\\Routing' => array($vendorDir . '/symfony-cmf/routing'),
'Psr\\Log\\' => array($vendorDir . '/psr/log'),
'Guzzle\\Stream' => array($vendorDir . '/guzzle/stream'),
'Guzzle\\Parser' => array($vendorDir . '/guzzle/parser'),
'Guzzle\\Http' => array($vendorDir . '/guzzle/http'),
'Guzzle\\Common' => array($vendorDir . '/guzzle/common'),
'EasyRdf_' => array($vendorDir . '/easyrdf/easyrdf/lib'),
'Drupal\\Driver' => array($baseDir . '/drivers/lib'),
'Drupal\\Core' => array($baseDir . '/core/lib'),
'Drupal\\Component' => array($baseDir . '/core/lib'),
'Doctrine\\Common' => array($vendorDir . '/doctrine/common/lib'),
'Assetic' => array($vendorDir . '/kriswallsmith/assetic/src'),
);
......@@ -2,7 +2,7 @@
// autoload_real.php generated by Composer
class ComposerAutoloaderInit7f0efddf867398398517e0ca6863b8f1
class ComposerAutoloaderInitc244582ae2d491644d70197d64a9670b
{
private static $loader;
......@@ -19,12 +19,12 @@ public static function getLoader()
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit7f0efddf867398398517e0ca6863b8f1', 'loadClassLoader'));
spl_autoload_register(array('ComposerAutoloaderInitc244582ae2d491644d70197d64a9670b', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit7f0efddf867398398517e0ca6863b8f1', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitc244582ae2d491644d70197d64a9670b', 'loadClassLoader'));
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
$baseDir = dirname(dirname($vendorDir));
$includePaths = require __DIR__ . '/include_paths.php';
array_push($includePaths, get_include_path());
......@@ -32,7 +32,7 @@ public static function getLoader()
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->add($namespace, $path);
$loader->set($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
......@@ -42,6 +42,8 @@ public static function getLoader()
$loader->register(true);
require $vendorDir . '/kriswallsmith/assetic/src/functions.php';
return $loader;
}
}
......@@ -2,16 +2,16 @@
// include_paths.php generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname(dirname($vendorDir));
return array(
$vendorDir . '/phpunit/php-text-template/',
$vendorDir . '/phpunit/phpunit-mock-objects/',
$vendorDir . '/phpunit/php-timer/',
$vendorDir . '/phpunit/php-token-stream/',
$vendorDir . '/phpunit/php-file-iterator/',
$vendorDir . '/phpunit/php-code-coverage/',
$vendorDir . '/phpunit/phpunit/',
$vendorDir . '/phpunit/phpunit/../../symfony/yaml',
$vendorDir . '/phpunit/php-text-template',
$vendorDir . '/phpunit/phpunit-mock-objects',
$vendorDir . '/phpunit/php-timer',
$vendorDir . '/phpunit/php-token-stream',
$vendorDir . '/phpunit/php-file-iterator',
$vendorDir . '/phpunit/php-code-coverage',
$vendorDir . '/phpunit/phpunit',
$vendorDir . '/symfony/yaml',
);
This diff is collapsed.
......@@ -365,26 +365,78 @@ public function inject($input)
/**
* Gets a value from the collection using an array path (e.g. foo/baz/bar would retrieve bar from two nested arrays)
* Allows for wildcard searches which recursively combine matches up to the level at which the wildcard occurs. This
* can be useful for accepting any key of a sub-array and combining matching keys from each diverging path.
*
* @param string $path Path to traverse and retrieve a value from
* @param string $separator Character used to add depth to the search
* @param mixed $data Optional data to descend into (used when wildcards are encountered)
*
* @return mixed|null
*/
public function getPath($path, $separator = '/')
public function getPath($path, $separator = '/', $data = null)
{
$parts = explode($separator, $path);
$data = &$this->data;
// Assume the data of the collection if no data was passed into the method
if ($data === null) {
$data = &$this->data;
}
// Break the path into an array if needed
if (!is_array($path)) {
$path = explode($separator, $path);
}
// Using an iterative approach rather than recursion for speed
while (null !== ($part = array_shift($parts))) {
// Return null if this path doesn't exist or if there's more depth and the value is not an array
if (!isset($data[$part]) || ($parts && !is_array($data[$part]))) {
while (null !== ($part = array_shift($path))) {
if (!is_array($data)) {
return null;
}
// The value does not exist in the array or the path has more but the value is not an array
if (!isset($data[$part])) {
// Not using a wildcard and the key was not found, so return null
if ($part != '*') {
return null;
}
// If using a wildcard search, then diverge and combine paths
$result = array();
foreach ($data as $value) {
if (!$path) {
$result = array_merge_recursive($result, (array) $value);
} else {
$test = $this->getPath($path, $separator, $value);
if ($test !== null) {
$result = array_merge_recursive($result, (array) $test);
}
}
}
return $result;
}
// Descend deeper into the data
$data = &$data[$part];
}
return $data;
}
/**
* Over write key value pairs in this collection with all of the data from an array or collection.
*
* @param array|\Traversable $data Values to override over this config
*
* @return self
*/
public function overwriteWith($data)
{
foreach ($data as $k => $v) {
$this->set($k, $v);
}
return $this;
}
}
......@@ -7,5 +7,5 @@
*/
class Version
{
const VERSION = '3.1.0';
const VERSION = '3.1.2';
}
......@@ -30,6 +30,11 @@ class Client extends AbstractHasDispatcher implements ClientInterface
*/
protected $defaultHeaders;
/**
* @var string The user agent string to set on each request
*/
protected $userAgent;
/**
* @var Collection Parameter object holding configuration data
*/
......@@ -133,7 +138,7 @@ public function __construct($baseUrl = '', $config = null)
} elseif ($certificateAuthority === false) {
unset($opts[CURLOPT_CAINFO]);
$opts[CURLOPT_SSL_VERIFYPEER] = false;
$opts[CURLOPT_SSL_VERIFYHOST] = 1;
$opts[CURLOPT_SSL_VERIFYHOST] = 2;
} elseif ($verifyPeer !== true && $verifyPeer !== false && $verifyPeer !== 1 && $verifyPeer !== 0) {
throw new InvalidArgumentException('verifyPeer must be 1, 0 or boolean');
} elseif ($verifyHost !== 0 && $verifyHost !== 1 && $verifyHost !== 2) {
......@@ -240,6 +245,10 @@ public function createRequest($method = RequestInterface::GET, $uri = null, $hea
$url = Url::factory($this->getBaseUrl())->combine($this->expandTemplate($uri, $templateVars));
}
if ($this->userAgent) {
$this->defaultHeaders->set('User-Agent', $this->userAgent);
}
// If default headers are provided, then merge them into existing headers
// If a collision occurs, the header is completely replaced
if (count($this->defaultHeaders)) {
......@@ -283,7 +292,7 @@ public function setUserAgent($userAgent, $includeDefault = false)
if ($includeDefault) {
$userAgent .= ' ' . Utils::getDefaultUserAgent();
}