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/',
);
This diff is collapsed.
language: php
env:
- OPCODE_CACHE=apc
php:
- 5.3
- 5.4
before_script: php ./bin/travis-setup.php $OPCODE_CACHE
\ No newline at end of file
This diff is collapsed.
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
/**
* Install PHP extensions required for testing by Travis CI.
*
* @author Victor Berchet <victor@suumit.com>
* @since 2.2
*/
$installer = new PhpExtensions();
if (isset($argv[1]) && 'APC' === strtoupper($argv[1])) {
$installer->install('apc');
} else {
$installer->install('xcache');
}
$installer->install('memcache');
$installer->install('memcached');
class PhpExtensions
{
protected $extensions;
protected $phpVersion;
protected $iniPath;
public function __construct()
{
$this->phpVersion = phpversion();
$this->iniPath = php_ini_loaded_file();
$this->extensions = array(
'memcache' => array(
'url' => 'http://pecl.php.net/get/memcache-2.2.6.tgz',
'php_version' => array(),
'cfg' => array('--enable-memcache'),
'ini' => array('extension=memcache.so'),
),
'memcached' => array(
'url' => 'http://pecl.php.net/get/memcached-1.0.2.tgz',
'php_version' => array(
// memcached 1.0.2 does not build on PHP 5.4
array('<', '5.4'),
),
'cfg' => array(),
'ini' => array('extension=memcached.so'),
),
'apc' => array(
'url' => 'http://pecl.php.net/get/APC-3.1.9.tgz',
'php_version' => array(
// apc 3.1.9 causes a segfault on PHP 5.4
array('<', '5.4'),
),
'cfg' => array(),
'ini' => array(
'extension=apc.so',
'apc.enabled=1',
'apc.enable_cli=1'
),
),
'xcache' => array(
'url' => 'http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz',
'php_version' => array(
// xcache does not build with Travis CI (as of 2012-01-09)
array('<', '5'),
),
'cfg' => array('--enable-xcache'),
'ini' => array(
'extension=xcache.so',
'xcache.cacher=false',
'xcache.admin.enable_auth=0',
'xcache.var_size=1M',
),
),
);
}
public function install($name)
{
if (array_key_exists($name, $this->extensions)) {
$extension = $this->extensions[$name];
echo "== extension: $name ==\n";
foreach ($extension['php_version'] as $version) {
if (!version_compare($this->phpVersion, $version[1], $version[0])) {
printf(
"=> not installed, requires a PHP version %s %s (%s installed)\n",
$version[0],
$version[1],
$this->phpVersion
);
return;
}
}
$this->system(sprintf("wget %s > /dev/null 2>&1", $extension['url']));
$file = basename($extension['url']);
$this->system(sprintf("tar -xzf %s > /dev/null 2>&1", $file));
$folder = basename($file, ".tgz");
$folder = basename($folder, ".tar.gz");
$this->system(sprintf(
'sh -c "cd %s && phpize && ./configure %s && make && sudo make install" > /dev/null 2>&1',
$folder,
implode(' ', $extension['cfg'])
));
foreach ($extension['ini'] as $ini) {
$this->system(sprintf("echo %s >> %s", $ini, $this->iniPath));
}
printf("=> installed (%s)\n", $folder);
}
}
private function system($cmd)
{
$ret = 0;
system($cmd, $ret);
if (0 !== $ret) {
printf("=> Command '%s' failed !", $cmd);
exit($ret);
}
}
}
{
"name": "doctrine/common",
"type": "library","version":"2.2.2",
"type": "library","version":"2.3.0-RC1",
"description": "Common Library for Doctrine projects",
"keywords": ["collections", "spl", "eventmanager", "annotations", "persistence"],
"homepage": "http://www.doctrine-project.org",
"license": "LGPL",
"license": "MIT",
"authors": [
{"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"},
{"name": "Roman Borschel", "email": "roman@code-factory.org"},
......@@ -17,5 +17,10 @@
},
"autoload": {
"psr-0": { "Doctrine\\Common": "lib/" }
},
"extra": {
"branch-alias": {
"dev-master": "2.3.x-dev"
}
}
}
......@@ -13,7 +13,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
......@@ -52,6 +52,8 @@ class Annotation
* Error handler for unknown property accessor in Annotation class.
*
* @param string $name Unknown property name
*
* @throws \BadMethodCallException
*/
public function __get($name)
{
......@@ -65,6 +67,8 @@ public function __get($name)
*
* @param string $name Unkown property name
* @param mixed $value Property value
*
* @throws \BadMethodCallException
*/
public function __set($name, $value)
{
......@@ -72,4 +76,4 @@ public function __set($name, $value)
sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this))
);
}
}
\ No newline at end of file
}
......@@ -14,7 +14,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
......@@ -44,4 +44,4 @@ final class Attribute
* @var boolean
*/
public $required = false;
}
\ No newline at end of file
}
......@@ -14,7 +14,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
......@@ -34,4 +34,4 @@ final class Attributes
* @var array<Doctrine\Common\Annotations\Annotation\Attribute>
*/
public $value;
}
\ No newline at end of file
}
......@@ -13,7 +13,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
......@@ -28,8 +28,18 @@
*/
final class IgnoreAnnotation
{
/**
* @var array
*/
public $names;
/**
* Constructor
*
* @param array $values
*
* @throws \RuntimeException
*/
public function __construct(array $values)
{
if (is_string($values['value'])) {
......@@ -41,4 +51,4 @@ public function __construct(array $values)
$this->names = $values['value'];
}
}
\ No newline at end of file
}
......@@ -14,7 +14,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
......@@ -30,4 +30,4 @@
*/
final class Required
{
}
\ No newline at end of file
}
......@@ -14,7 +14,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
......@@ -70,6 +70,8 @@ final class Target
* Annotation construct
*
* @param array $values
*
* @throws \InvalidArgumentException
*/
public function __construct(array $values)
{
......@@ -102,4 +104,4 @@ public function __construct(array $values)
$this->value = $values['value'];
$this->literal = implode(', ', $this->value);
}
}
\ No newline at end of file
}
......@@ -13,7 +13,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
......@@ -52,6 +52,22 @@ public static function semanticalError($message)
return new self('[Semantical Error] ' . $message);
}
/**
* Creates a new AnnotationException describing a constant semantical error.
*
* @since 2.3
* @param string $identifier
* @param string $context
* @return AnnotationException
*/
public static function semanticalErrorConstants($identifier, $context = null)
{
return self::semanticalError(sprintf(
"Couldn't find constant %s%s", $identifier,
$context ? ", $context." : "."
));
}
/**
* Creates a new AnnotationException describing an error which occurred during