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 @@ ...@@ -4,22 +4,22 @@
"type": "drupal-core", "type": "drupal-core",
"license": "GPL-2.0+", "license": "GPL-2.0+",
"require": { "require": {
"symfony/class-loader": "2.2.0", "symfony/class-loader": "2.2.*",
"symfony/dependency-injection": "2.2.0", "symfony/dependency-injection": "2.2.*",
"symfony/event-dispatcher": "2.2.0", "symfony/event-dispatcher": "2.2.*",
"symfony/http-foundation": "2.2.0", "symfony/http-foundation": "2.2.*",
"symfony/http-kernel": "2.2.0", "symfony/http-kernel": "2.2.*",
"symfony/routing": "2.2.0", "symfony/routing": "2.2.*",
"symfony/serializer": "2.2.0", "symfony/serializer": "2.2.*",
"symfony/validator": "2.2.0", "symfony/validator": "2.2.*",
"symfony/yaml": "2.2.0", "symfony/yaml": "2.2.*",
"twig/twig": "1.12.1", "twig/twig": "1.12.*",
"doctrine/common": "2.3.0", "doctrine/common": "2.3.*",
"guzzle/http": "3.1.0", "guzzle/http": "3.1.*",
"kriswallsmith/assetic": "1.1.0-alpha1", "kriswallsmith/assetic": "1.1.*@alpha",
"symfony-cmf/routing": "dev-master#ea4a10", "symfony-cmf/routing": "1.1.*@alpha",
"easyrdf/easyrdf": "0.8.0-beta.1", "easyrdf/easyrdf": "0.8.*@beta",
"phpunit/phpunit": "3.7.15" "phpunit/phpunit": "3.7.*"
}, },
"autoload": { "autoload": {
"psr-0": { "psr-0": {
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
"Drupal\\Driver": "drivers/lib/" "Drupal\\Driver": "drivers/lib/"
} }
}, },
"minimum-stability": "dev",
"config": { "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. # SimpleTest breaks with the following files, so avoid adding them.
symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php
symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/php5.4/traits.php vendor/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/services11.php
# The resources for the Validator component are not required. # 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 # Symfony Validator depends on Symfony Translation but only requires the
# TranslatorInterface. Thus, we add only the required interface from Symfony # TranslatorInterface. Thus, we add only the required interface from Symfony
# Translation by ignoring everything except the interface. # Translation by ignoring everything except the interface.
symfony/translation/Symfony/Component/Translation/* vendor/symfony/translation/Symfony/Component/Translation/*
!symfony/translation/Symfony/Component/Translation/TranslatorInterface.php !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 @@ ...@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php'; require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit7f0efddf867398398517e0ca6863b8f1::getLoader(); return ComposerAutoloaderInitc244582ae2d491644d70197d64a9670b::getLoader();
...@@ -49,7 +49,7 @@ class ClassLoader ...@@ -49,7 +49,7 @@ class ClassLoader
public function getPrefixes() public function getPrefixes()
{ {
return $this->prefixes; return call_user_func_array('array_merge', $this->prefixes);
} }
public function getFallbackDirs() public function getFallbackDirs()
...@@ -98,19 +98,21 @@ public function add($prefix, $paths, $prepend = false) ...@@ -98,19 +98,21 @@ public function add($prefix, $paths, $prepend = false)
return; 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; return;
} }
if ($prepend) { if ($prepend) {
$this->prefixes[$prefix] = array_merge( $this->prefixes[$first][$prefix] = array_merge(
(array) $paths, (array) $paths,
$this->prefixes[$prefix] $this->prefixes[$first][$prefix]
); );
} else { } else {
$this->prefixes[$prefix] = array_merge( $this->prefixes[$first][$prefix] = array_merge(
$this->prefixes[$prefix], $this->prefixes[$first][$prefix],
(array) $paths (array) $paths
); );
} }
...@@ -129,7 +131,7 @@ public function set($prefix, $paths) ...@@ -129,7 +131,7 @@ public function set($prefix, $paths)
return; return;
} }
$this->prefixes[$prefix] = (array) $paths; $this->prefixes[substr($prefix, 0, 1)][$prefix] = (array) $paths;
} }
/** /**
...@@ -175,7 +177,7 @@ public function unregister() ...@@ -175,7 +177,7 @@ public function unregister()
* Loads the given class or interface. * Loads the given class or interface.
* *
* @param string $class The name of the class * @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) public function loadClass($class)
{ {
...@@ -191,7 +193,7 @@ public function loadClass($class) ...@@ -191,7 +193,7 @@ public function loadClass($class)
* *
* @param string $class The name of the 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) public function findFile($class)
{ {
...@@ -205,7 +207,7 @@ public function findFile($class) ...@@ -205,7 +207,7 @@ public function findFile($class)
if (false !== $pos = strrpos($class, '\\')) { if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name // 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); $className = substr($class, $pos + 1);
} else { } else {
// PEAR-like class name // PEAR-like class name
...@@ -213,13 +215,16 @@ public function findFile($class) ...@@ -213,13 +215,16 @@ public function findFile($class)
$className = $class; $className = $class;
} }
$classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; $classPath .= strtr($className, '_', DIRECTORY_SEPARATOR) . '.php';
foreach ($this->prefixes as $prefix => $dirs) { $first = $class[0];
if (0 === strpos($class, $prefix)) { if (isset($this->prefixes[$first])) {
foreach ($dirs as $dir) { foreach ($this->prefixes[$first] as $prefix => $dirs) {
if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) { if (0 === strpos($class, $prefix)) {
return $dir . DIRECTORY_SEPARATOR . $classPath; foreach ($dirs as $dir) {
if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) {
return $dir . DIRECTORY_SEPARATOR . $classPath;
}
} }
} }
} }
......
This diff is collapsed.
...@@ -2,32 +2,32 @@ ...@@ -2,32 +2,32 @@
// autoload_namespaces.php generated by Composer // autoload_namespaces.php generated by Composer
$vendorDir = dirname(__DIR__); $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir); $baseDir = dirname(dirname($vendorDir));
return array( return array(
'Drupal\\Driver' => $baseDir . '/../drivers/lib/', 'Twig_' => array($vendorDir . '/twig/twig/lib'),
'Drupal\\Core' => $baseDir . '/lib/', 'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
'Drupal\\Component' => $baseDir . '/lib/', 'Symfony\\Component\\Validator\\' => array($vendorDir . '/symfony/validator'),
'Twig_' => $vendorDir . '/twig/twig/lib/', 'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'),
'Symfony\\Component\\Yaml\\' => $vendorDir . '/symfony/yaml/', 'Symfony\\Component\\Serializer\\' => array($vendorDir . '/symfony/serializer'),
'Symfony\\Component\\Validator\\' => $vendorDir . '/symfony/validator/', 'Symfony\\Component\\Routing\\' => array($vendorDir . '/symfony/routing'),
'Symfony\\Component\\Translation\\' => $vendorDir . '/symfony/translation/', 'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'),
'Symfony\\Component\\Serializer\\' => $vendorDir . '/symfony/serializer/', 'Symfony\\Component\\HttpKernel\\' => array($vendorDir . '/symfony/http-kernel'),
'Symfony\\Component\\Routing\\' => $vendorDir . '/symfony/routing/', 'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'),
'Symfony\\Component\\Process' => $vendorDir . '/symfony/process/', 'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'),
'Symfony\\Component\\HttpKernel\\' => $vendorDir . '/symfony/http-kernel/', 'Symfony\\Component\\DependencyInjection\\' => array($vendorDir . '/symfony/dependency-injection'),
'Symfony\\Component\\HttpFoundation\\' => $vendorDir . '/symfony/http-foundation/', 'Symfony\\Component\\ClassLoader\\' => array($vendorDir . '/symfony/class-loader'),
'Symfony\\Component\\EventDispatcher\\' => $vendorDir . '/symfony/event-dispatcher/', 'Symfony\\Cmf\\Component\\Routing' => array($vendorDir . '/symfony-cmf/routing'),
'Symfony\\Component\\DependencyInjection\\' => $vendorDir . '/symfony/dependency-injection/', 'Psr\\Log\\' => array($vendorDir . '/psr/log'),
'Symfony\\Component\\ClassLoader\\' => $vendorDir . '/symfony/class-loader/', 'Guzzle\\Stream' => array($vendorDir . '/guzzle/stream'),
'Symfony\\Cmf\\Component\\Routing' => $vendorDir . '/symfony-cmf/routing/', 'Guzzle\\Parser' => array($vendorDir . '/guzzle/parser'),
'Psr\\Log\\' => $vendorDir . '/psr/log/', 'Guzzle\\Http' => array($vendorDir . '/guzzle/http'),
'Guzzle\\Stream' => $vendorDir . '/guzzle/stream/', 'Guzzle\\Common' => array($vendorDir . '/guzzle/common'),
'Guzzle\\Parser' => $vendorDir . '/guzzle/parser/', 'EasyRdf_' => array($vendorDir . '/easyrdf/easyrdf/lib'),
'Guzzle\\Http' => $vendorDir . '/guzzle/http/', 'Drupal\\Driver' => array($baseDir . '/drivers/lib'),
'Guzzle\\Common' => $vendorDir . '/guzzle/common/', 'Drupal\\Core' => array($baseDir . '/core/lib'),
'EasyRdf_' => $vendorDir . '/easyrdf/easyrdf/lib/', 'Drupal\\Component' => array($baseDir . '/core/lib'),
'Doctrine\\Common' => $vendorDir . '/doctrine/common/lib/', 'Doctrine\\Common' => array($vendorDir . '/doctrine/common/lib'),
'Assetic' => $vendorDir . '/kriswallsmith/assetic/src/', 'Assetic' => array($vendorDir . '/kriswallsmith/assetic/src'),
); );
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// autoload_real.php generated by Composer // autoload_real.php generated by Composer
class ComposerAutoloaderInit7f0efddf867398398517e0ca6863b8f1 class ComposerAutoloaderInitc244582ae2d491644d70197d64a9670b
{ {
private static $loader; private static $loader;
...@@ -19,12 +19,12 @@ public static function getLoader() ...@@ -19,12 +19,12 @@ public static function getLoader()
return self::$loader; return self::$loader;
} }
spl_autoload_register(array('ComposerAutoloaderInit7f0efddf867398398517e0ca6863b8f1', 'loadClassLoader')); spl_autoload_register(array('ComposerAutoloaderInitc244582ae2d491644d70197d64a9670b', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(); self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit7f0efddf867398398517e0ca6863b8f1', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInitc244582ae2d491644d70197d64a9670b', 'loadClassLoader'));
$vendorDir = dirname(__DIR__); $vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir); $baseDir = dirname(dirname($vendorDir));
$includePaths = require __DIR__ . '/include_paths.php'; $includePaths = require __DIR__ . '/include_paths.php';
array_push($includePaths, get_include_path()); array_push($includePaths, get_include_path());
...@@ -32,7 +32,7 @@ public static function getLoader() ...@@ -32,7 +32,7 @@ public static function getLoader()
$map = require __DIR__ . '/autoload_namespaces.php'; $map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) { foreach ($map as $namespace => $path) {
$loader->add($namespace, $path); $loader->set($namespace, $path);
} }
$classMap = require __DIR__ . '/autoload_classmap.php'; $classMap = require __DIR__ . '/autoload_classmap.php';
...@@ -42,6 +42,8 @@ public static function getLoader() ...@@ -42,6 +42,8 @@ public static function getLoader()
$loader->register(true); $loader->register(true);
require $vendorDir . '/kriswallsmith/assetic/src/functions.php';
return $loader; return $loader;
} }
} }
...@@ -2,16 +2,16 @@ ...@@ -2,16 +2,16 @@
// include_paths.php generated by Composer // include_paths.php generated by Composer