Commit 87dc82a4 authored by webchick's avatar webchick

Issue #1424924 by Rob Loach: Added Use Composer for updating Symfony...

Issue #1424924 by Rob Loach: Added Use Composer for updating Symfony components (without removing Symfony code from repo).
parent 3b2f5ad9

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

{
"require": {
"symfony/class-loader": "2.1.*",
"symfony/dependency-injection": "2.1.*",
"symfony/event-dispatcher": "2.1.*",
"symfony/http-foundation": "2.1.*",
"symfony/http-kernel": "2.1.*",
"symfony/routing": "2.1.*",
"symfony/yaml": "2.1.*",
"twig/twig": "1.8.*"
},
"minimum-stability": "beta"
}
{
"hash": "ec77094fc475b57afb7a27f63983ead1",
"packages": [
{
"package": "symfony/class-loader",
"version": "v2.1.0-BETA1"
},
{
"package": "symfony/dependency-injection",
"version": "v2.1.0-BETA1"
},
{
"package": "symfony/event-dispatcher",
"version": "v2.1.0-BETA1"
},
{
"package": "symfony/http-foundation",
"version": "v2.1.0-BETA1"
},
{
"package": "symfony/http-kernel",
"version": "v2.1.0-BETA1"
},
{
"package": "symfony/routing",
"version": "v2.1.0-BETA1"
},
{
"package": "symfony/yaml",
"version": "v2.1.0-BETA1"
},
{
"package": "twig/twig",
"version": "v1.8.3"
}
],
"packages-dev": null,
"aliases": [
],
"minimum-stability": "beta",
"stability-flags": [
]
}
......@@ -2994,13 +2994,13 @@ function drupal_classloader() {
if (!isset($loader)) {
// Include the Symfony ClassLoader for loading PSR-0-compatible classes.
require_once DRUPAL_ROOT . '/core/vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php';
require_once DRUPAL_ROOT . '/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php';
// @todo Use a cleaner way than variable_get() to switch autoloaders.
switch (variable_get('autoloader_mode', 'default')) {
case 'apc':
if (function_exists('apc_store')) {
require_once DRUPAL_ROOT . '/core/vendor/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php';
require_once DRUPAL_ROOT . '/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php';
$loader = new ApcUniversalClassLoader('drupal.' . $GLOBALS['drupal_hash_salt']);
break;
}
......@@ -3015,13 +3015,19 @@ function drupal_classloader() {
// Register explicit PSR-0 vendor namespaces.
$loader->registerNamespaces(array(
// All Symfony-borrowed code lives in /core/vendor/Symfony.
'Symfony' => DRUPAL_ROOT . '/core/vendor',
// All Symfony-borrowed code lives in /core/vendor/symfony.
'Symfony\Component\ClassLoader' => DRUPAL_ROOT . '/core/vendor/symfony/class-loader',
'Symfony\Component\DependencyInjection' => DRUPAL_ROOT . '/core/vendor/symfony/dependency-injection',
'Symfony\Component\EventDispatcher' => DRUPAL_ROOT . '/core/vendor/symfony/event-dispatcher',
'Symfony\Component\HttpFoundation' => DRUPAL_ROOT . '/core/vendor/symfony/http-foundation',
'Symfony\Component\HttpKernel' => DRUPAL_ROOT . '/core/vendor/symfony/http-kernel',
'Symfony\Component\Routing' => DRUPAL_ROOT . '/core/vendor/symfony/routing',
'Symfony\Component\Yaml' => DRUPAL_ROOT . '/core/vendor/symfony/yaml',
));
// Register PEAR-style vendor namespaces.
$loader->registerPrefixes(array(
// All Twig-borrowed code lives in /core/vendor/Twig.
'Twig' => DRUPAL_ROOT . '/core/vendor',
// All Twig-borrowed code lives in /core/vendor/twig.
'Twig' => DRUPAL_ROOT . '/core/vendor/twig/twig/lib',
));
// Register the Drupal namespace for classes in core as a fallback.
// This allows to register additional namespaces within the Drupal namespace
......
# 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
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\ClassLoader;
/**
* ApcClassLoader implements a wrapping autoloader cached in APC for PHP 5.3.
*
* It expects an object implementing a findFile method to find the file. This
* allow using it as a wrapper around the other loaders of the component (the
* ClassLoader and the UniversalClassLoader for instance) but also around any
* other autoloader following this convention (the Composer one for instance)
*
* $loader = new ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* $cachedLoader = new ApcClassLoader('my_prefix', $loader);
*
* // activate the cached autoloader
* $cachedLoader->register();
*
* // eventually deactivate the non-cached loader if it was registered previously
* // to be sure to use the cached one.
* $loader->unregister();
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Kris Wallsmith <kris@symfony.com>
*
* @api
*/
class ApcClassLoader
{
private $prefix;
private $classFinder;
/**
* Constructor.
*
* @param string $prefix A prefix to create a namespace in APC
* @param object $classFinder
*
* @api
*/
public function __construct($prefix, $classFinder)
{
if (!extension_loaded('apc')) {
throw new \RuntimeException('Unable to use ApcUniversalClassLoader as APC is not enabled.');
}
if (!method_exists($classFinder, 'findFile')) {
throw new \InvalidArgumentException('The class finder must implement a "findFile" method.');
}
$this->prefix = $prefix;
$this->classFinder = $classFinder;
}
/**
* Registers this instance as an autoloader.
*
* @param Boolean $prepend Whether to prepend the autoloader or not
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
}
/**
* Unregisters this instance as an autoloader.
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return Boolean|null True, if loaded
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
require $file;
return true;
}
}
/**
* Finds a file by class name while caching lookups to APC.
*
* @param string $class A class name to resolve to file
*
* @return string|null
*/