Commit 87dc82a4 authored by webchick's avatar webchick
Browse files

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
{
"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\HttpFoundation\Session\Storage\Handler;
/**
* NativeFileSessionHandler.
*
* Native session handler using PHP's built in file storage.
*
* @author Drak <drak@zikula.org>
*/
class NativeFileSessionHandler extends NativeSessionHandler
{
/**
* Constructor.
*
* @param string $savePath Path of directory to save session files. Default null will leave setting as defined by PHP.
*/
public function __construct($savePath = null)
{
if (null === $savePath) {
$savePath = ini_get('session.save_path');
}
if ($savePath && !is_dir($savePath)) {
mkdir($savePath, 0777, true);
}
ini_set('session.save_handler', 'files');
ini_set('session.save_path', $savePath);
}
}
<?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\HttpFoundation\Session\Storage\Handler;
/**
* NativeMemcacheSessionHandler.
*
* Driver for the memcache session save hadlers provided by the memcache PHP extension.
*
* @see http://php.net/memcache
*
* @author Drak <drak@zikula.org>
*/
class NativeMemcacheSessionHandler extends NativeSessionHandler
{
/**
* Constructor.
*
* @param string $savePath Path of memcache server.
* @param array $options Session configuration options.
*/
public function __construct($savePath = 'tcp://127.0.0.1:11211?persistent=0', array $options = array())
{
if (!extension_loaded('memcache')) {
throw new \RuntimeException('PHP does not have "memcache" session module registered');
}
if (null === $savePath) {
$savePath = ini_get('session.save_path');
}
ini_set('session.save_handler', 'memcache');
ini_set('session.save_path', $savePath);
$this->setOptions($options);
}
/**
* Set any memcached ini values.
*
* @see http://php.net/memcache.ini
*/
protected function setOptions(array $options)
{
$validOptions = array_flip(array(
'memcache.allow_failover', 'memcache.max_failover_attempts',
'memcache.chunk_size', 'memcache.default_port', 'memcache.hash_strategy',
'memcache.hash_function', 'memcache.protocol', 'memcache.redundancy',
'memcache.session_redundancy', 'memcache.compress_threshold',
'memcache.lock_timeout',
));
foreach ($options as $key => $value) {
if (isset($validOptions[$key])) {
ini_set($key, $value);
}
}
}
}
<?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\HttpFoundation\Session\Storage\Handler;
/**
* NativeMemcachedSessionHandler.
*
* Driver for the memcached session save hadlers provided by the memcached PHP extension.
*
* @see http://php.net/memcached.sessions
*
* @author Drak <drak@zikula.org>
*/
class NativeMemcachedSessionHandler extends NativeSessionHandler
{
/**
* Constructor.
*
* @param string $savePath Comma separated list of servers: e.g. memcache1.example.com:11211,memcache2.example.com:11211
* @param array $options Session configuration options.
*/
public function __construct($savePath = '127.0.0.1:11211', array $options = array())
{
if (!extension_loaded('memcached')) {
throw new \RuntimeException('PHP does not have "memcached" session module registered');
}
if (null === $savePath) {
$savePath = ini_get('session.save_path');
}
ini_set('session.save_handler', 'memcached');
ini_set('session.save_path', $savePath);
$this->setOptions($options);
}
/**
* Set any memcached ini values.
*
* @see https://github.com/php-memcached-dev/php-memcached/blob/master/memcached.ini
*/
protected function setOptions(array $options)
{
$validOptions = array_flip(array(
'memcached.sess_locking', 'memcached.sess_lock_wait',
'memcached.sess_prefix', 'memcached.compression_type',
'memcached.compression_factor', 'memcached.compression_threshold',
'memcached.serializer',
));
foreach ($options as $key => $value) {
if (isset($validOptions[$key])) {
ini_set($key, $value);
}
}
}
}
<?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\HttpFoundation\Session\Storage\Handler;
/**
* NativeRedisSessionStorage.
*
* Driver for the redis session save hadlers provided by the redis PHP extension.
*
* @see https://github.com/nicolasff/phpredis
*
* @author Andrej Hudec <pulzarraider@gmail.com>
*/
class NativeRedisSessionHandler extends NativeSessionHandler
{
/**
* Constructor.
*
* @param string $savePath Path of redis server.
*/
public function __construct($savePath = 'tcp://127.0.0.1:6379?persistent=0')
{
if (!extension_loaded('redis')) {
throw new \RuntimeException('PHP does not have "redis" session module registered');
}
if (null === $savePath) {
$savePath = ini_get('session.save_path');
}
ini_set('session.save_handler', 'redis');
ini_set('session.save_path', $savePath);
}
}
<?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\HttpFoundation\Session\Storage\Handler;
/**
* NativeSqliteSessionHandler.
*
* Driver for the sqlite session save hadlers provided by the SQLite PHP extension.
*
* @author Drak <drak@zikula.org>
*/
class NativeSqliteSessionHandler extends NativeSessionHandler
{
/**
* Constructor.
*
* @param string $savePath Path to SQLite database file itself.
* @param array $options Session configuration options.
*/
public function __construct($savePath, array $options = array())
{
if (!extension_loaded('sqlite')) {
throw new \RuntimeException('PHP does not have "sqlite" session module registered');
}
if (null === $savePath) {
$savePath = ini_get('session.save_path');
}
ini_set('session.save_handler', 'sqlite');
ini_set('session.save_path', $savePath);
$this->setOptions($options);
}
/**
* Set any sqlite ini values.
*
* @see http://php.net/sqlite.configuration
*/
protected function setOptions(array $options)
{
foreach ($options as $key => $value) {
if (in_array($key, array('sqlite.assoc_case'))) {
ini_set($key, $value);
}
}
}
}
<?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\HttpFoundation\Tests\Session\Storage\Handler;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler;
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
/**
* Test class for NativeFileSessionHandler.
*
* @author Drak <drak@zikula.org>
*
* @runTestsInSeparateProcesses
*/
class NativeFileSessionHandlerTest extends \PHPUnit_Framework_TestCase
{
public function testConstruct()
{
$storage = new NativeSessionStorage(array('name' => 'TESTING'), new NativeFileSessionHandler(sys_get_temp_dir()));
if (version_compare(phpversion(), '5.4.0', '<')) {
$this->assertEquals('files', $storage->getSaveHandler()->getSaveHandlerName());
$this->assertEquals('files', ini_get('session.save_handler'));
} else {
$this->assertEquals('files', $storage->getSaveHandler()->getSaveHandlerName());
$this->assertEquals('user', ini_get('session.save_handler'));
}
$this->assertEquals(sys_get_temp_dir(), ini_get('session.save_path'));
$this->assertEquals('TESTING', ini_get('session.name'));
}
public function testConstructDefault()
{
$path = ini_get('session.save_path');
$storage = new NativeSessionStorage(array('name' => 'TESTING'), new NativeFileSessionHandler());
$this->assertEquals($path, ini_get('session.save_path'));
}
}
<?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\HttpFoundation\Tests\Session\Storage\Handler;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeMemcacheSessionHandler;
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
/**
* Test class for NativeMemcacheSessionHandler.
*
* @author Drak <drak@zikula.org>
*
* @runTestsInSeparateProcesses
*/
class NativeMemcacheSessionHandlerTest extends \PHPUnit_Framework_TestCase
{
public function testSaveHandlers()
{
if (!extension_loaded('memcache')) {
$this->markTestSkipped('Skipped tests memcache extension is not present');
}
$storage = new NativeSessionStorage(array('name' => 'TESTING'), new NativeMemcacheSessionHandler('tcp://127.0.0.1:11211?persistent=0'));
if (version_compare(phpversion(), '5.4.0', '<')) {
$this->assertEquals('memcache', $storage->getSaveHandler()->getSaveHandlerName());
$this->assertEquals('memcache', ini_get('session.save_handler'));
} else {
$this->assertEquals('memcache', $storage->getSaveHandler()->getSaveHandlerName());
$this->assertEquals('user', ini_get('session.save_handler'));
}
$this->assertEquals('tcp://127.0.0.1:11211?persistent=0', ini_get('session.save_path'));
$this->assertEquals('TESTING', ini_get('session.name'));
}
}
<?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\HttpFoundation\Tests\Session\Storage\Handler;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeMemcachedSessionHandler;
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
/**
* Test class for NativeMemcachedSessionHandler.
*
* @author Drak <drak@zikula.org>
*
* @runTestsInSeparateProcesses
*/
class NativeMemcachedSessionHandlerTest extends \PHPUnit_Framework_TestCase
{
public function testSaveHandlers()
{
if (!extension_loaded('memcached')) {
$this->markTestSkipped('Skipped tests memcached extension is not present');
}
// test takes too long if memcached server is not running
ini_set('memcached.sess_locking', '0');
$storage = new NativeSessionStorage(array('name' => 'TESTING'), new NativeMemcachedSessionHandler('127.0.0.1:11211'));
if (version_compare(phpversion(), '5.4.0', '<')) {
$this->assertEquals('memcached', $storage->getSaveHandler()->getSaveHandlerName());
$this->assertEquals('memcached', ini_get('session.save_handler'));
} else {
$this->assertEquals('memcached', $storage->getSaveHandler()->getSaveHandlerName());
$this->assertEquals('user', ini_get('session.save_handler'));
}
$this->assertEquals('127.0.0.1:11211', ini_get('session.save_path'));
$this->assertEquals('TESTING', ini_get('session.name'));
}
}
<?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\HttpFoundation\Tests\Session\Storage;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeRedisSessionHandler;
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
/**
* Test class for NativeRedisSessionHandlerTest.
*
* @runTestsInSeparateProcesses
*/
class NativeRedisSessionHandlerTest extends \PHPUnit_Framework_TestCase
{
public function testSaveHandlers()
{
if (!extension_loaded('redis')) {
$this->markTestSkipped('Skipped tests Redis extension is not present');
}
$storage = new NativeSessionStorage(array('name' => 'TESTING'), new NativeRedisSessionHandler('tcp://127.0.0.1:6379?persistent=0'));
if (version_compare(phpversion(), '5.4.0', '<')) {
$this->assertEquals('redis', $storage->getSaveHandler()->getSaveHandlerName());
$this->assertEquals('redis', ini_get('session.save_handler'));
} else {
$this->assertEquals('redis', $storage->getSaveHandler()->getSaveHandlerName());
$this->assertEquals('user', ini_get('session.save_handler'));
}
$this->assertEquals('tcp://127.0.0.1:6379?persistent=0', ini_get('session.save_path'));
$this->assertEquals('TESTING', ini_get('session.name'));