Commit f77cdf16 authored by webchick's avatar webchick

Issue #1698108 by chx, effulgentsia, Rob Loach: Update Drupal's dependencies.

parent 47cf40ee
......@@ -8,7 +8,7 @@
"symfony/routing": "2.1.*",
"symfony/yaml": "2.1.*",
"twig/twig": "1.8.*",
"doctrine/common": "2.2.*"
"doctrine/common": "2.3.*"
},
"minimum-stability": "beta"
}
{
"hash": "2ea132b64c01235b70e9fb16c528ea0e",
"hash": "be2e79923e2be0777a9f60ec185168a8",
"packages": [
{
"package": "doctrine/common",
"version": "2.2.2"
"version": "2.3.0-RC1"
},
{
"package": "symfony/class-loader",
"version": "v2.1.0-BETA1"
"version": "v2.1.0-RC1"
},
{
"package": "symfony/dependency-injection",
"version": "v2.1.0-BETA1"
"version": "v2.1.0-RC1"
},
{
"package": "symfony/event-dispatcher",
"version": "v2.1.0-BETA1"
"version": "v2.1.0-RC1"
},
{
"package": "symfony/http-foundation",
"version": "v2.1.0-BETA1"
"version": "v2.1.0-RC1"
},
{
"package": "symfony/http-kernel",
"version": "v2.1.0-BETA1"
"version": "v2.1.0-RC1"
},
{
"package": "symfony/routing",
"version": "v2.1.0-BETA1"
"version": "v2.1.0-RC1"
},
{
"package": "symfony/yaml",
"version": "v2.1.0-BETA1"
"version": "v2.1.0-RC1"
},
{
"package": "twig/twig",
......
......@@ -4962,9 +4962,14 @@ function _drupal_bootstrap_full($skip = FALSE) {
* Page compression requires the PHP zlib extension
* (http://php.net/manual/ref.zlib.php).
*
* @param $body
* The response body.
* @return
* The cached object or NULL if the page cache was not set.
*
* @see drupal_page_header()
*/
function drupal_page_set_cache() {
function drupal_page_set_cache($body) {
global $base_root;
if (drupal_page_is_cacheable()) {
......@@ -4972,7 +4977,7 @@ function drupal_page_set_cache() {
'cid' => $base_root . request_uri(),
'data' => array(
'path' => current_path(),
'body' => ob_get_clean(),
'body' => $body,
'title' => drupal_get_title(),
'headers' => array(),
),
......
......@@ -66,8 +66,18 @@ public function onRespond(FilterResponseEvent $event) {
// @todo Revisit whether or not this is still appropriate now that the
// Response object does its own cache control procesisng and we intend to
// use partial page caching more extensively.
$response->headers->set('Expires', 'Sun, 19 Nov 1978 05:00:00 GMT');
$response->headers->set('Cache-Control', 'no-cache, must-revalidate, post-check=0, pre-check=0');
// Commit the user session, if needed.
drupal_session_commit();
if (config('system.performance')->get('cache') && ($cache = drupal_page_set_cache($response->getContent()))) {
drupal_serve_page_from_cache($cache);
// drupal_serve_page_from_cache() already printed the response.
$response->setContent('');
$response->headers->remove('cache-control');
}
else {
$response->headers->set('Expires', 'Sun, 19 Nov 1978 05:00:00 GMT');
$response->headers->set('Cache-Control', 'no-cache, must-revalidate, post-check=0, pre-check=0');
}
}
/**
......
......@@ -28,32 +28,7 @@ class RequestCloseSubscriber implements EventSubscriberInterface {
* The Event to process.
*/
public function onTerminate(PostResponseEvent $event) {
global $user;
module_invoke_all('exit');
// Commit the user session, if needed.
drupal_session_commit();
$response = $event->getResponse();
$config = config('system.performance');
if ($config->get('cache') && ($cache = drupal_page_set_cache())) {
drupal_serve_page_from_cache($cache);
}
else {
// This listener will be run in all cases, including when sending an HTTP
// redirect code. In this particular case, PHP output buffer has not been
// initialized yet and won't be, calling the ob_end_flush() method would
// throw PHP warnings.
// See http://www.php.net/manual/en/function.ob-end-flush.php#42979
while (ob_get_level() > 0) {
// Using ob_end_flush() instead of ob_flush() will close the output
// buffer. This means that potential later errors won't get to the user
// and the HTTPd might release the connection sooner.
ob_end_flush();
}
}
_registry_check_code(REGISTRY_WRITE_LOOKUP_CACHE);
drupal_cache_system_paths();
module_implements_write_cache();
......
......@@ -41,6 +41,8 @@ function testConditionalRequests() {
// Fill the cache.
$this->drupalGet('');
// Verify the page is not printed twice when the cache is cold.
$this->assertNoPattern('#<html.*<html#');
$this->drupalHead('');
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', t('Page was cached.'));
......@@ -57,6 +59,8 @@ function testConditionalRequests() {
$this->assertResponse(304, t('Conditional request with obsolete If-Modified-Since date returned 304 Not Modified.'));
$this->drupalGet('', array(), array('If-Modified-Since: ' . $last_modified));
// Verify the page is not printed twice when the cache is warm.
$this->assertNoPattern('#<html.*<html#');
$this->assertResponse(200, t('Conditional request without If-None-Match returned 200 OK.'));
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', t('Page was cached.'));
......
......@@ -32,6 +32,7 @@ function setUp() {
function testUserAutocomplete() {
$this->drupalLogin($this->account);
$this->drupalGet('user/autocomplete/' . $this->account->name);
$this->assertText('registry not initialized', t('The registry was not initialized'));
$this->assertRaw($this->account->name);
$this->assertNoText('registry initialized', t('The registry was not initialized'));
}
}
......@@ -76,17 +76,10 @@ function theme_test_init() {
// still capable of returning output and theming the page as a whole.
$GLOBALS['theme_test_output'] = theme('more_link', array('url' => 'user', 'title' => 'Themed output generated in hook_init()'));
}
}
/**
* Implements hook_exit().
*/
function theme_test_exit() {
if (arg(0) == 'user') {
if (arg(0) == 'user' && arg(1) == 'autocomplete') {
// Register a fake registry loading callback. If it gets called by
// theme_get_registry(), the registry has not been initialized yet.
_theme_registry_callback('_theme_test_load_registry', array());
print theme_get_registry() ? 'registry initialized' : 'registry not initialized';
}
}
......@@ -94,6 +87,7 @@ function theme_test_exit() {
* Fake registry loading callback.
*/
function _theme_test_load_registry() {
print 'registry initialized';
return array();
}
......
......@@ -14,5 +14,6 @@
'Symfony\\Component\\EventDispatcher' => $vendorDir . '/symfony/event-dispatcher/',
'Symfony\\Component\\DependencyInjection' => $vendorDir . '/symfony/dependency-injection/',
'Symfony\\Component\\ClassLoader' => $vendorDir . '/symfony/class-loader/',
'SessionHandlerInterface' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Resources/stubs',
'Doctrine\\Common' => $vendorDir . '/doctrine/common/lib/',
);
......@@ -3,7 +3,7 @@
"name": "twig/twig",
"version": "v1.8.3",
"version_normalized": "1.8.3.0",
"time": "2012-06-18 01:48:16",
"time": "2012-06-18 15:48:16",
"source": {
"type": "git",
"url": "git://github.com/fabpot/Twig.git",
......@@ -54,29 +54,34 @@
}
},
{
"name": "symfony/dependency-injection",
"version": "v2.1.0-BETA1",
"version_normalized": "2.1.0.0-beta1",
"target-dir": "Symfony/Component/DependencyInjection",
"time": "2012-06-12 18:59:42",
"name": "symfony/class-loader",
"version": "v2.1.0-RC1",
"version_normalized": "2.1.0.0-RC1",
"target-dir": "Symfony/Component/ClassLoader",
"time": "2012-07-15 17:13:51",
"source": {
"type": "git",
"url": "https://github.com/symfony/DependencyInjection",
"reference": "v2.1.0-BETA1"
"url": "https://github.com/symfony/ClassLoader",
"reference": "v2.1.0-RC1"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/DependencyInjection/zipball/v2.1.0-BETA1",
"reference": "v2.1.0-BETA1",
"url": "https://github.com/symfony/ClassLoader/zipball/v2.1.0-RC1",
"reference": "v2.1.0-RC1",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
"php": ">=5.3.3"
},
"suggest": {
"symfony/yaml": "v2.1.0-BETA1"
"require-dev": {
"symfony/finder": "2.1.*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.1-dev"
}
},
"installation-source": "dist",
"license": [
"MIT"
......@@ -95,35 +100,48 @@
"role": null
}
],
"description": "Symfony DependencyInjection Component",
"description": "Symfony ClassLoader Component",
"homepage": "http://symfony.com",
"autoload": {
"psr-0": {
"Symfony\\Component\\DependencyInjection": ""
"Symfony\\Component\\ClassLoader": ""
}
}
},
{
"name": "symfony/event-dispatcher",
"version": "v2.1.0-BETA1",
"version_normalized": "2.1.0.0-beta1",
"target-dir": "Symfony/Component/EventDispatcher",
"time": "2012-05-15 23:56:32",
"name": "symfony/dependency-injection",
"version": "v2.1.0-RC1",
"version_normalized": "2.1.0.0-RC1",
"target-dir": "Symfony/Component/DependencyInjection",
"time": "2012-08-03 19:44:30",
"source": {
"type": "git",
"url": "https://github.com/symfony/EventDispatcher",
"reference": "v2.1.0-BETA1"
"url": "https://github.com/symfony/DependencyInjection",
"reference": "v2.1.0-RC1"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/EventDispatcher/zipball/v2.1.0-BETA1",
"reference": "v2.1.0-BETA1",
"url": "https://github.com/symfony/DependencyInjection/zipball/v2.1.0-RC1",
"reference": "v2.1.0-RC1",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
"php": ">=5.3.3"
},
"require-dev": {
"symfony/yaml": "2.1.*",
"symfony/config": "2.1.*"
},
"suggest": {
"symfony/yaml": "v2.1.0-RC1",
"symfony/config": "v2.1.0-RC1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.1-dev"
}
},
"installation-source": "dist",
"license": [
"MIT"
......@@ -142,35 +160,40 @@
"role": null
}
],
"description": "Symfony EventDispatcher Component",
"description": "Symfony DependencyInjection Component",
"homepage": "http://symfony.com",
"autoload": {
"psr-0": {
"Symfony\\Component\\EventDispatcher": ""
"Symfony\\Component\\DependencyInjection": ""
}
}
},
{
"name": "symfony/http-foundation",
"version": "v2.1.0-BETA1",
"version_normalized": "2.1.0.0-beta1",
"version": "v2.1.0-RC1",
"version_normalized": "2.1.0.0-RC1",
"target-dir": "Symfony/Component/HttpFoundation",
"time": "2012-06-12 13:10:53",
"time": "2012-08-04 16:18:38",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpFoundation",
"reference": "v2.1.0-BETA1"
"reference": "v2.1.0-RC1"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/HttpFoundation/zipball/v2.1.0-BETA1",
"reference": "v2.1.0-BETA1",
"url": "https://github.com/symfony/HttpFoundation/zipball/v2.1.0-RC1",
"reference": "v2.1.0-RC1",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.1-dev"
}
},
"installation-source": "dist",
"license": [
"MIT"
......@@ -193,41 +216,44 @@
"homepage": "http://symfony.com",
"autoload": {
"psr-0": {
"Symfony\\Component\\HttpFoundation": ""
"Symfony\\Component\\HttpFoundation": "",
"SessionHandlerInterface": "Symfony/Component/HttpFoundation/Resources/stubs"
}
}
},
{
"name": "symfony/http-kernel",
"version": "v2.1.0-BETA1",
"version_normalized": "2.1.0.0-beta1",
"target-dir": "Symfony/Component/HttpKernel",
"time": "2012-06-12 18:59:42",
"name": "symfony/event-dispatcher",
"version": "v2.1.0-RC1",
"version_normalized": "2.1.0.0-RC1",
"target-dir": "Symfony/Component/EventDispatcher",
"time": "2012-07-20 06:18:14",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpKernel",
"reference": "v2.1.0-BETA1"
"url": "https://github.com/symfony/EventDispatcher",
"reference": "v2.1.0-RC1"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/HttpKernel/zipball/v2.1.0-BETA1",
"reference": "v2.1.0-BETA1",
"url": "https://github.com/symfony/EventDispatcher/zipball/v2.1.0-RC1",
"reference": "v2.1.0-RC1",
"shasum": ""
},
"require": {
"php": ">=5.3.2",
"symfony/event-dispatcher": "self.version",
"symfony/http-foundation": "self.version"
"php": ">=5.3.3"
},
"require-dev": {
"symfony/dependency-injection": "2.1.*"
},
"suggest": {
"symfony/browser-kit": "v2.1.0-BETA1",
"symfony/class-loader": "v2.1.0-BETA1",
"symfony/config": "v2.1.0-BETA1",
"symfony/console": "v2.1.0-BETA1",
"symfony/dependency-injection": "v2.1.0-BETA1",
"symfony/finder": "v2.1.0-BETA1"
"symfony/dependency-injection": "v2.1.0-RC1",
"symfony/http-kernel": "v2.1.0-RC1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.1-dev"
}
},
"installation-source": "dist",
"license": [
"MIT"
......@@ -246,39 +272,60 @@
"role": null
}
],
"description": "Symfony HttpKernel Component",
"description": "Symfony EventDispatcher Component",
"homepage": "http://symfony.com",
"autoload": {
"psr-0": {
"Symfony\\Component\\HttpKernel": ""
"Symfony\\Component\\EventDispatcher": ""
}
}
},
{
"name": "symfony/routing",
"version": "v2.1.0-BETA1",
"version_normalized": "2.1.0.0-beta1",
"target-dir": "Symfony/Component/Routing",
"time": "2012-06-12 18:59:42",
"name": "symfony/http-kernel",
"version": "v2.1.0-RC1",
"version_normalized": "2.1.0.0-RC1",
"target-dir": "Symfony/Component/HttpKernel",
"time": "2012-08-04 16:32:21",
"source": {
"type": "git",
"url": "https://github.com/symfony/Routing",
"reference": "v2.1.0-BETA1"
"url": "https://github.com/symfony/HttpKernel",
"reference": "v2.1.0-RC1"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Routing/zipball/v2.1.0-BETA1",
"reference": "v2.1.0-BETA1",
"url": "https://github.com/symfony/HttpKernel/zipball/v2.1.0-RC1",
"reference": "v2.1.0-RC1",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
"php": ">=5.3.3",
"symfony/event-dispatcher": "2.1.*",
"symfony/http-foundation": "2.1.*"
},
"require-dev": {
"symfony/browser-kit": "2.1.*",
"symfony/class-loader": "2.1.*",
"symfony/config": "2.1.*",
"symfony/console": "2.1.*",
"symfony/dependency-injection": "2.1.*",
"symfony/finder": "2.1.*",
"symfony/process": "2.1.*",
"symfony/routing": "2.1.*"
},
"suggest": {
"symfony/config": "v2.1.0-BETA1",
"symfony/yaml": "v2.1.0-BETA1"
"symfony/browser-kit": "v2.1.0-RC1",
"symfony/class-loader": "v2.1.0-RC1",
"symfony/config": "v2.1.0-RC1",
"symfony/console": "v2.1.0-RC1",
"symfony/dependency-injection": "v2.1.0-RC1",
"symfony/finder": "v2.1.0-RC1"
},