minor #12522 [3.0] Update required PHP to 5.5.9 (nicolas-grekas, GrahamCampbell)
This PR was merged into the 3.0-dev branch. Discussion ---------- [3.0] Update required PHP to 5.5.9 | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | yes | Deprecations? | no | Tests pass? | yes | Fixed tickets | #13126, #12778 | License | MIT | Doc PR | - This PR upgrades composer.json files to php>=5.5.9 5.5.9 is the lowest version available on Travis and the version shipped with Ubuntu LTS 14.04. We can change the php version later when we'll agree on some other requirement, but currently, this is required to safely merge in master without having some users reporting issues because they have a `dev-master@dev` requirement. Commits -------35e0845
[3.0] Removed some old hacksfddcb86
[3.0] Update required PHP to 5.5.9
This commit is contained in:
commit
479a9383fd
@ -2,13 +2,10 @@ language: php
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- php: 5.3.3
|
||||
- php: 5.5.9
|
||||
env: components=low
|
||||
- php: 5.6
|
||||
env: components=high
|
||||
- php: 5.3.3
|
||||
- php: 5.3
|
||||
- php: 5.4
|
||||
- php: 5.5
|
||||
- php: 5.6
|
||||
- php: hhvm-nightly
|
||||
|
21
README.md
21
README.md
@ -4,32 +4,13 @@ README
|
||||
What is Symfony?
|
||||
-----------------
|
||||
|
||||
Symfony is a PHP 5.3 full-stack web framework. It is written with speed and
|
||||
Symfony is a PHP full-stack web framework. It is written with speed and
|
||||
flexibility in mind. It allows developers to build better and easy to maintain
|
||||
websites with PHP.
|
||||
|
||||
Symfony can be used to develop all kind of websites, from your personal blog
|
||||
to high traffic ones like Dailymotion or Yahoo! Answers.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
Symfony is only supported on PHP 5.3.3 and up.
|
||||
|
||||
Be warned that PHP versions before 5.3.8 are known to be buggy and might not
|
||||
work for you:
|
||||
|
||||
* before PHP 5.3.4, if you get "Notice: Trying to get property of
|
||||
non-object", you've hit a known PHP bug (see
|
||||
https://bugs.php.net/bug.php?id=52083 and
|
||||
https://bugs.php.net/bug.php?id=50027);
|
||||
|
||||
* before PHP 5.3.8, if you get an error involving annotations, you've hit a
|
||||
known PHP bug (see https://bugs.php.net/bug.php?id=55156).
|
||||
|
||||
* PHP 5.3.16 has a major bug in the Reflection subsystem and is not suitable to
|
||||
run Symfony (https://bugs.php.net/bug.php?id=62715)
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
if (PHP_VERSION_ID >= 50400 && gc_enabled()) {
|
||||
// Disabling Zend Garbage Collection to prevent segfaults with PHP5.4+
|
||||
// https://bugs.php.net/bug.php?id=53976
|
||||
// Disabling Zend Garbage Collection to prevent segfaults
|
||||
// https://bugs.php.net/bug.php?id=53976
|
||||
if (gc_enabled()) {
|
||||
gc_disable();
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"php": ">=5.5.9",
|
||||
"doctrine/common": "~2.3",
|
||||
"twig/twig": "~1.12,>=1.12.3",
|
||||
"psr/log": "~1.0"
|
||||
@ -24,47 +24,47 @@
|
||||
"replace": {
|
||||
"symfony/browser-kit": "self.version",
|
||||
"symfony/class-loader": "self.version",
|
||||
"symfony/config": "self.version",
|
||||
"symfony/console": "self.version",
|
||||
"symfony/config": "2.99.99",
|
||||
"symfony/console": "2.99.99",
|
||||
"symfony/css-selector": "self.version",
|
||||
"symfony/dependency-injection": "self.version",
|
||||
"symfony/dependency-injection": "2.99.99",
|
||||
"symfony/debug": "self.version",
|
||||
"symfony/debug-bundle": "self.version",
|
||||
"symfony/doctrine-bridge": "self.version",
|
||||
"symfony/doctrine-bridge": "2.99.99",
|
||||
"symfony/dom-crawler": "self.version",
|
||||
"symfony/event-dispatcher": "self.version",
|
||||
"symfony/expression-language": "self.version",
|
||||
"symfony/filesystem": "self.version",
|
||||
"symfony/event-dispatcher": "2.99.99",
|
||||
"symfony/expression-language": "2.99.99",
|
||||
"symfony/filesystem": "2.99.99",
|
||||
"symfony/finder": "self.version",
|
||||
"symfony/form": "self.version",
|
||||
"symfony/framework-bundle": "self.version",
|
||||
"symfony/framework-bundle": "2.99.99",
|
||||
"symfony/http-foundation": "self.version",
|
||||
"symfony/http-kernel": "self.version",
|
||||
"symfony/intl": "self.version",
|
||||
"symfony/locale": "self.version",
|
||||
"symfony/monolog-bridge": "self.version",
|
||||
"symfony/options-resolver": "self.version",
|
||||
"symfony/process": "self.version",
|
||||
"symfony/process": "2.99.99",
|
||||
"symfony/propel1-bridge": "self.version",
|
||||
"symfony/property-access": "self.version",
|
||||
"symfony/proxy-manager-bridge": "self.version",
|
||||
"symfony/routing": "self.version",
|
||||
"symfony/security": "self.version",
|
||||
"symfony/security": "2.99.99",
|
||||
"symfony/security-acl": "self.version",
|
||||
"symfony/security-core": "self.version",
|
||||
"symfony/security-csrf": "self.version",
|
||||
"symfony/security-http": "self.version",
|
||||
"symfony/security-bundle": "self.version",
|
||||
"symfony/serializer": "self.version",
|
||||
"symfony/stopwatch": "self.version",
|
||||
"symfony/stopwatch": "2.99.99",
|
||||
"symfony/templating": "self.version",
|
||||
"symfony/translation": "self.version",
|
||||
"symfony/twig-bridge": "self.version",
|
||||
"symfony/twig-bundle": "self.version",
|
||||
"symfony/validator": "self.version",
|
||||
"symfony/validator": "2.99.99",
|
||||
"symfony/var-dumper": "self.version",
|
||||
"symfony/web-profiler-bundle": "self.version",
|
||||
"symfony/yaml": "self.version"
|
||||
"symfony/yaml": "2.99.99"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/data-fixtures": "1.0.*",
|
||||
@ -73,7 +73,6 @@
|
||||
"doctrine/doctrine-bundle": "~1.2",
|
||||
"monolog/monolog": "~1.11",
|
||||
"propel/propel1": "~1.6",
|
||||
"ircmaxell/password-compat": "~1.0",
|
||||
"ocramius/proxy-manager": "~0.4|~1.0",
|
||||
"egulias/email-validator": "~1.2"
|
||||
},
|
||||
|
@ -1,26 +0,0 @@
|
||||
<?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\Bridge\Doctrine\Tests\Validator\Constraints;
|
||||
|
||||
use Symfony\Component\Validator\Validation;
|
||||
|
||||
/**
|
||||
* @since 2.5.4
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
*/
|
||||
class LegacyUniqueEntityValidator2Dot4ApiTest extends UniqueEntityValidatorTest
|
||||
{
|
||||
protected function getApiVersion()
|
||||
{
|
||||
return Validation::API_VERSION_2_4;
|
||||
}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
<?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\Bridge\Doctrine\Tests\Validator\Constraints;
|
||||
|
||||
use Symfony\Component\Validator\Validation;
|
||||
|
||||
/**
|
||||
* @since 2.5.4
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
*/
|
||||
class LegacyUniqueEntityValidatorLegacyApiTest extends UniqueEntityValidatorTest
|
||||
{
|
||||
protected function getApiVersion()
|
||||
{
|
||||
return Validation::API_VERSION_2_5_BC;
|
||||
}
|
||||
}
|
@ -16,19 +16,19 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"php": ">=5.5.9",
|
||||
"doctrine/common": "~2.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/stopwatch": "~2.2|~3.0.0",
|
||||
"symfony/dependency-injection": "~2.2|~3.0.0",
|
||||
"symfony/form": "~2.3,>=2.3.8|~3.0.0",
|
||||
"symfony/http-kernel": "~2.2|~3.0.0",
|
||||
"symfony/property-access": "~2.3|~3.0.0",
|
||||
"symfony/security": "~2.2|~3.0.0",
|
||||
"symfony/expression-language": "~2.2|~3.0.0",
|
||||
"symfony/validator": "~2.5,>=2.5.5|~3.0.0",
|
||||
"symfony/translation": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/stopwatch": "~2.7|~3.0",
|
||||
"symfony/dependency-injection": "~2.7|~3.0",
|
||||
"symfony/form": "~2.7|~3.0",
|
||||
"symfony/http-kernel": "~2.7|~3.0",
|
||||
"symfony/property-access": "~2.7|~3.0",
|
||||
"symfony/security": "~2.7|~3.0",
|
||||
"symfony/expression-language": "~2.7|~3.0",
|
||||
"symfony/validator": "~2.7|~3.0",
|
||||
"symfony/translation": "~2.7|~3.0",
|
||||
"doctrine/data-fixtures": "1.0.*",
|
||||
"doctrine/dbal": "~2.2",
|
||||
"doctrine/orm": "~2.2,>=2.2.3"
|
||||
|
@ -16,13 +16,13 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"php": ">=5.5.9",
|
||||
"monolog/monolog": "~1.11"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/http-kernel": "~2.4|~3.0.0",
|
||||
"symfony/console": "~2.4|~3.0.0",
|
||||
"symfony/event-dispatcher": "~2.2|~3.0.0"
|
||||
"symfony/http-kernel": "~2.7|~3.0",
|
||||
"symfony/console": "~2.7|~3.0",
|
||||
"symfony/event-dispatcher": "~2.7|~3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/http-kernel": "For using the debugging handlers together with the response life cycle of the HTTP kernel.",
|
||||
|
@ -16,15 +16,15 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"symfony/http-foundation": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/http-kernel": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/form": "~2.3,>=2.3.8|~3.0.0",
|
||||
"symfony/property-access": "~2.3|~3.0.0",
|
||||
"php": ">=5.5.9",
|
||||
"symfony/http-foundation": "~2.7|~3.0",
|
||||
"symfony/http-kernel": "~2.7|~3.0",
|
||||
"symfony/form": "~2.7|~3.0",
|
||||
"symfony/property-access": "~2.7|~3.0",
|
||||
"propel/propel1": "~1.6,>=1.6.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/stopwatch": "~2.2|~3.0.0"
|
||||
"symfony/stopwatch": "~2.7|~3.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "Symfony\\Bridge\\Propel1\\": "" }
|
||||
|
@ -16,12 +16,12 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"symfony/dependency-injection": "~2.3|~3.0.0",
|
||||
"php": ">=5.5.9",
|
||||
"symfony/dependency-injection": "~2.7|~3.0",
|
||||
"ocramius/proxy-manager": "~0.4|~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/config": "~2.3|~3.0.0"
|
||||
"symfony/config": "~2.7|~3.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
|
@ -11,10 +11,6 @@
|
||||
|
||||
namespace Symfony\Bridge\Twig\Command;
|
||||
|
||||
if (!defined('JSON_PRETTY_PRINT')) {
|
||||
define('JSON_PRETTY_PRINT', 128);
|
||||
}
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
|
@ -174,11 +174,7 @@ class CodeExtension extends \Twig_Extension
|
||||
$text = "$text at line $line";
|
||||
|
||||
if (false !== $link = $this->getFileLink($file, $line)) {
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
$flags = ENT_QUOTES | ENT_SUBSTITUTE;
|
||||
} else {
|
||||
$flags = ENT_QUOTES;
|
||||
}
|
||||
$flags = ENT_QUOTES | ENT_SUBSTITUTE;
|
||||
|
||||
return sprintf('<a href="%s" title="Click to open this file" class="file_link">%s</a>', htmlspecialchars($link, $flags, $this->charset), $text);
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ if ($this->env->isDebug()) {
|
||||
}
|
||||
|
||||
EOTXT;
|
||||
$expected = preg_replace('/%(.*?)%/', version_compare(PHP_VERSION, '5.4.0') >= 0 ? '(isset($context["$1"]) ? $context["$1"] : null)' : '$this->getContext($context, "$1")', $expected);
|
||||
$expected = preg_replace('/%(.*?)%/', '(isset($context["$1"]) ? $context["$1"] : null)', $expected);
|
||||
|
||||
$this->assertSame($expected, $compiler->compile($node)->getSource());
|
||||
}
|
||||
@ -82,7 +82,7 @@ if ($this->env->isDebug()) {
|
||||
}
|
||||
|
||||
EOTXT;
|
||||
$expected = preg_replace('/%(.*?)%/', version_compare(PHP_VERSION, '5.4.0') >= 0 ? '(isset($context["$1"]) ? $context["$1"] : null)' : '$this->getContext($context, "$1")', $expected);
|
||||
$expected = preg_replace('/%(.*?)%/', '(isset($context["$1"]) ? $context["$1"] : null)', $expected);
|
||||
|
||||
$this->assertSame($expected, $compiler->compile($node)->getSource());
|
||||
}
|
||||
|
@ -66,10 +66,6 @@ class FormThemeTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
protected function getVariableGetter($name)
|
||||
{
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name);
|
||||
}
|
||||
|
||||
return sprintf('$this->getContext($context, "%s")', $name);
|
||||
return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name);
|
||||
}
|
||||
}
|
||||
|
@ -263,10 +263,6 @@ class SearchAndRenderBlockNodeTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
protected function getVariableGetter($name)
|
||||
{
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name);
|
||||
}
|
||||
|
||||
return sprintf('$this->getContext($context, "%s")', $name);
|
||||
return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name);
|
||||
}
|
||||
}
|
||||
|
@ -38,19 +38,11 @@ class TransNodeTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
protected function getVariableGetterWithoutStrictCheck($name)
|
||||
{
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name);
|
||||
}
|
||||
|
||||
return sprintf('$this->getContext($context, "%s", true)', $name);
|
||||
return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name);
|
||||
}
|
||||
|
||||
protected function getVariableGetterWithStrictCheck($name)
|
||||
{
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
return sprintf('(isset($context["%s"]) ? $context["%s"] : $this->getContext($context, "%s"))', $name, $name, $name);
|
||||
}
|
||||
|
||||
return sprintf('$this->getContext($context, "%s")', $name);
|
||||
return sprintf('(isset($context["%s"]) ? $context["%s"] : $this->getContext($context, "%s"))', $name, $name, $name);
|
||||
}
|
||||
}
|
||||
|
@ -16,24 +16,24 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"symfony/security-csrf": "~2.4|~3.0.0",
|
||||
"php": ">=5.5.9",
|
||||
"symfony/security-csrf": "~2.7|~3.0",
|
||||
"twig/twig": "~1.13,>=1.13.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/finder": "~2.3|~3.0.0",
|
||||
"symfony/form": "~2.6|~3.0.0",
|
||||
"symfony/http-kernel": "~2.3|~3.0.0",
|
||||
"symfony/locale": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/routing": "~2.2|~3.0.0",
|
||||
"symfony/templating": "~2.1|~3.0.0",
|
||||
"symfony/translation": "~2.2|~3.0.0",
|
||||
"symfony/yaml": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/security": "~2.4|~3.0.0",
|
||||
"symfony/stopwatch": "~2.2|~3.0.0",
|
||||
"symfony/console": "~2.4|~3.0.0",
|
||||
"symfony/var-dumper": "~2.6|~3.0.0",
|
||||
"symfony/expression-language": "~2.4|~3.0.0"
|
||||
"symfony/finder": "~2.7|~3.0",
|
||||
"symfony/form": "~2.7|~3.0",
|
||||
"symfony/http-kernel": "~2.7|~3.0",
|
||||
"symfony/locale": "~2.7|~3.0",
|
||||
"symfony/routing": "~2.7|~3.0",
|
||||
"symfony/templating": "~2.7|~3.0",
|
||||
"symfony/translation": "~2.7|~3.0",
|
||||
"symfony/yaml": "~2.7|~3.0",
|
||||
"symfony/security": "~2.7|~3.0",
|
||||
"symfony/stopwatch": "~2.7|~3.0",
|
||||
"symfony/console": "~2.7|~3.0",
|
||||
"symfony/var-dumper": "~2.7|~3.0",
|
||||
"symfony/expression-language": "~2.7|~3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/finder": "",
|
||||
|
@ -16,14 +16,14 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"symfony/http-kernel": "~2.6|~3.0.0",
|
||||
"symfony/twig-bridge": "~2.6|~3.0.0",
|
||||
"symfony/var-dumper": "~2.6|~3.0.0"
|
||||
"php": ">=5.5.9",
|
||||
"symfony/http-kernel": "~2.7|~3.0",
|
||||
"symfony/twig-bridge": "~2.7|~3.0",
|
||||
"symfony/var-dumper": "~2.7|~3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/config": "~2.3|~3.0.0",
|
||||
"symfony/dependency-injection": "~2.3|~3.0.0"
|
||||
"symfony/config": "~2.7|~3.0",
|
||||
"symfony/dependency-injection": "~2.7|~3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/config": "For service container configuration",
|
||||
|
@ -23,7 +23,7 @@ abstract class ServerCommand extends ContainerAwareCommand
|
||||
*/
|
||||
public function isEnabled()
|
||||
{
|
||||
if (version_compare(phpversion(), '5.4.0', '<') || defined('HHVM_VERSION')) {
|
||||
if (defined('HHVM_VERSION')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ class ServerRunCommand extends ContainerAwareCommand
|
||||
*/
|
||||
public function isEnabled()
|
||||
{
|
||||
if (PHP_VERSION_ID < 50400 || defined('HHVM_VERSION')) {
|
||||
if (defined('HHVM_VERSION')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -11,10 +11,6 @@
|
||||
|
||||
namespace Symfony\Bundle\FrameworkBundle\Command;
|
||||
|
||||
if (!defined('JSON_PRETTY_PRINT')) {
|
||||
define('JSON_PRETTY_PRINT', 128);
|
||||
}
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
|
@ -11,10 +11,6 @@
|
||||
|
||||
namespace Symfony\Bundle\FrameworkBundle\Console\Descriptor;
|
||||
|
||||
if (!defined('JSON_PRETTY_PRINT')) {
|
||||
define('JSON_PRETTY_PRINT', 128);
|
||||
}
|
||||
|
||||
use Symfony\Component\DependencyInjection\Alias;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Definition;
|
||||
|
@ -498,14 +498,7 @@ class Configuration implements ConfigurationInterface
|
||||
->validate()
|
||||
->ifTrue(function ($v) { return !isset($v['validation']['api']) || 'auto' === $v['validation']['api']; })
|
||||
->then(function ($v) {
|
||||
// This condition is duplicated in ValidatorBuilder. This
|
||||
// duplication is necessary in order to know the desired
|
||||
// API version already during container configuration
|
||||
// (to adjust service classes etc.)
|
||||
// See https://github.com/symfony/symfony/issues/11580
|
||||
$v['validation']['api'] = PHP_VERSION_ID < 50309
|
||||
? '2.4'
|
||||
: '2.5-bc';
|
||||
$v['validation']['api'] = '2.5-bc';
|
||||
|
||||
return $v;
|
||||
})
|
||||
|
@ -166,11 +166,7 @@ class CodeHelper extends Helper
|
||||
}
|
||||
|
||||
if (false !== $link = $this->getFileLink($file, $line)) {
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
$flags = ENT_QUOTES | ENT_SUBSTITUTE;
|
||||
} else {
|
||||
$flags = ENT_QUOTES;
|
||||
}
|
||||
$flags = ENT_QUOTES | ENT_SUBSTITUTE;
|
||||
|
||||
return sprintf('<a href="%s" title="Click to open this file" class="file_link">%s</a>', htmlspecialchars($link, $flags, $this->charset), $text);
|
||||
}
|
||||
|
@ -15,13 +15,6 @@ use Symfony\Bundle\FrameworkBundle\Console\Descriptor\JsonDescriptor;
|
||||
|
||||
class JsonDescriptorTest extends AbstractDescriptorTest
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
$this->markTestSkipped('Test skipped on PHP 5.3 as JSON_PRETTY_PRINT does not exist.');
|
||||
}
|
||||
}
|
||||
|
||||
protected function getDescriptor()
|
||||
{
|
||||
return new JsonDescriptor();
|
||||
|
@ -131,7 +131,7 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
|
||||
'static_method' => array('loadValidatorMetadata'),
|
||||
'translation_domain' => 'validators',
|
||||
'strict_email' => false,
|
||||
'api' => PHP_VERSION_ID < 50309 ? '2.4' : '2.5-bc',
|
||||
'api' => '2.5-bc',
|
||||
),
|
||||
'annotations' => array(
|
||||
'cache' => 'file',
|
||||
|
@ -295,11 +295,7 @@ abstract class FrameworkExtensionTest extends TestCase
|
||||
$this->assertEquals(array(new Reference('validator.mapping.cache.apc')), $calls[5][1]);
|
||||
$this->assertSame('setApiVersion', $calls[6][0]);
|
||||
|
||||
if (PHP_VERSION_ID < 50309) {
|
||||
$this->assertEquals(array(Validation::API_VERSION_2_4), $calls[6][1]);
|
||||
} else {
|
||||
$this->assertEquals(array(Validation::API_VERSION_2_5_BC), $calls[6][1]);
|
||||
}
|
||||
$this->assertEquals(array(Validation::API_VERSION_2_5_BC), $calls[6][1]);
|
||||
}
|
||||
|
||||
public function testFullyConfiguredValidationService()
|
||||
@ -448,11 +444,7 @@ abstract class FrameworkExtensionTest extends TestCase
|
||||
$this->assertSame('setApiVersion', $calls[5][0]);
|
||||
// no cache, no annotations
|
||||
|
||||
if (PHP_VERSION_ID < 50309) {
|
||||
$this->assertSame(array(Validation::API_VERSION_2_4), $calls[5][1]);
|
||||
} else {
|
||||
$this->assertSame(array(Validation::API_VERSION_2_5_BC), $calls[5][1]);
|
||||
}
|
||||
$this->assertSame(array(Validation::API_VERSION_2_5_BC), $calls[5][1]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -472,11 +464,7 @@ abstract class FrameworkExtensionTest extends TestCase
|
||||
$this->assertSame('setApiVersion', $calls[5][0]);
|
||||
// no cache, no annotations
|
||||
|
||||
if (PHP_VERSION_ID < 50309) {
|
||||
$this->assertSame(array(Validation::API_VERSION_2_4), $calls[5][1]);
|
||||
} else {
|
||||
$this->assertSame(array(Validation::API_VERSION_2_5_BC), $calls[5][1]);
|
||||
}
|
||||
$this->assertSame(array(Validation::API_VERSION_2_5_BC), $calls[5][1]);
|
||||
}
|
||||
|
||||
public function testFormsCanBeEnabledWithoutCsrfProtection()
|
||||
|
@ -16,35 +16,35 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"php": ">=5.5.9",
|
||||
"symfony/dependency-injection" : "~2.6,>=2.6.2",
|
||||
"symfony/config" : "~2.4",
|
||||
"symfony/event-dispatcher": "~2.5|~3.0.0",
|
||||
"symfony/http-foundation": "~2.4.9|~2.5,>=2.5.4|~3.0.0",
|
||||
"symfony/http-kernel": "~2.6|~3.0.0",
|
||||
"symfony/filesystem": "~2.3|~3.0.0",
|
||||
"symfony/routing": "~2.2|~3.0.0",
|
||||
"symfony/security-core": "~2.6|~3.0.0",
|
||||
"symfony/security-csrf": "~2.6|~3.0.0",
|
||||
"symfony/stopwatch": "~2.3|~3.0.0",
|
||||
"symfony/templating": "~2.1|~3.0.0",
|
||||
"symfony/translation": "~2.6|~3.0.0",
|
||||
"symfony/event-dispatcher": "~2.7|~3.0",
|
||||
"symfony/http-foundation": "~2.7|~3.0",
|
||||
"symfony/http-kernel": "~2.7|~3.0",
|
||||
"symfony/filesystem": "~2.7|~3.0",
|
||||
"symfony/routing": "~2.7|~3.0",
|
||||
"symfony/security-core": "~2.7|~3.0",
|
||||
"symfony/security-csrf": "~2.7|~3.0",
|
||||
"symfony/stopwatch": "~2.7|~3.0",
|
||||
"symfony/templating": "~2.7|~3.0",
|
||||
"symfony/translation": "~2.7|~3.0",
|
||||
"doctrine/annotations": "~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/browser-kit": "~2.4|~3.0.0",
|
||||
"symfony/console": "~2.4,>=2.4.8|~3.0.0",
|
||||
"symfony/css-selector": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/finder": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/locale": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/security": "~2.6|~3.0.0",
|
||||
"symfony/form": "~2.6|~3.0.0",
|
||||
"symfony/class-loader": "~2.1|~3.0.0",
|
||||
"symfony/expression-language": "~2.6|~3.0.0",
|
||||
"symfony/process": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/validator": "~2.5|~3.0.0",
|
||||
"symfony/yaml": "~2.0,>=2.0.5|~3.0.0"
|
||||
"symfony/browser-kit": "~2.7|~3.0",
|
||||
"symfony/console": "~2.7|~3.0",
|
||||
"symfony/css-selector": "~2.7|~3.0",
|
||||
"symfony/dom-crawler": "~2.7|~3.0",
|
||||
"symfony/finder": "~2.7|~3.0",
|
||||
"symfony/locale": "~2.7|~3.0",
|
||||
"symfony/security": "~2.7|~3.0",
|
||||
"symfony/form": "~2.7|~3.0",
|
||||
"symfony/class-loader": "~2.7|~3.0",
|
||||
"symfony/expression-language": "~2.7|~3.0",
|
||||
"symfony/process": "~2.7|~3.0",
|
||||
"symfony/validator": "~2.7|~3.0",
|
||||
"symfony/yaml": "~2.7|~3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/console": "For using the console commands",
|
||||
|
@ -30,10 +30,6 @@ class SecurityRoutingIntegrationTest extends WebTestCase
|
||||
*/
|
||||
public function testRoutingErrorIsExposedWhenNotProtected($config)
|
||||
{
|
||||
if (defined('PHP_WINDOWS_VERSION_BUILD') && PHP_VERSION_ID < 50309) {
|
||||
$this->markTestSkipped('Test hangs on Windows & PHP due to https://bugs.php.net/bug.php?id=60120 fixed in http://svn.php.net/viewvc?view=revision&revision=318366');
|
||||
}
|
||||
|
||||
$client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config));
|
||||
$client->insulate();
|
||||
$client->request('GET', '/unprotected_resource');
|
||||
@ -46,10 +42,6 @@ class SecurityRoutingIntegrationTest extends WebTestCase
|
||||
*/
|
||||
public function testRoutingErrorIsNotExposedForProtectedResourceWhenLoggedInWithInsufficientRights($config)
|
||||
{
|
||||
if (defined('PHP_WINDOWS_VERSION_BUILD') && PHP_VERSION_ID < 50309) {
|
||||
$this->markTestSkipped('Test hangs on Windows & PHP due to https://bugs.php.net/bug.php?id=60120 fixed in http://svn.php.net/viewvc?view=revision&revision=318366');
|
||||
}
|
||||
|
||||
$client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config));
|
||||
$client->insulate();
|
||||
|
||||
|
@ -16,25 +16,25 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"symfony/security": "~2.6|~3.0.0",
|
||||
"symfony/http-kernel": "~2.2|~3.0.0"
|
||||
"php": ">=5.5.9",
|
||||
"symfony/security": "~2.7|~3.0",
|
||||
"symfony/http-kernel": "~2.7|~3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/browser-kit": "~2.4|~3.0.0",
|
||||
"symfony/console": "~2.3|~3.0.0",
|
||||
"symfony/css-selector": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/dependency-injection": "~2.3|~3.0.0",
|
||||
"symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/form": "~2.4|~3.0.0",
|
||||
"symfony/framework-bundle": "~2.6|~3.0.0",
|
||||
"symfony/http-foundation": "~2.3|~3.0.0",
|
||||
"symfony/twig-bundle": "~2.2|~3.0.0",
|
||||
"symfony/twig-bridge": "~2.2,>=2.2.6|~3.0.0",
|
||||
"symfony/process": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/validator": "~2.5|~3.0.0",
|
||||
"symfony/yaml": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/expression-language": "~2.6|~3.0.0",
|
||||
"symfony/browser-kit": "~2.7|~3.0",
|
||||
"symfony/console": "~2.7|~3.0",
|
||||
"symfony/css-selector": "~2.7|~3.0",
|
||||
"symfony/dependency-injection": "~2.7|~3.0",
|
||||
"symfony/dom-crawler": "~2.7|~3.0",
|
||||
"symfony/form": "~2.7|~3.0",
|
||||
"symfony/framework-bundle": "~2.7|~3.0",
|
||||
"symfony/http-foundation": "~2.7|~3.0",
|
||||
"symfony/twig-bundle": "~2.7|~3.0",
|
||||
"symfony/twig-bridge": "~2.7|~3.0",
|
||||
"symfony/process": "~2.7|~3.0",
|
||||
"symfony/validator": "~2.7|~3.0",
|
||||
"symfony/yaml": "~2.7|~3.0",
|
||||
"symfony/expression-language": "~2.7|~3.0",
|
||||
"doctrine/doctrine-bundle": "~1.2",
|
||||
"twig/twig": "~1.12"
|
||||
},
|
||||
|
@ -16,19 +16,19 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"symfony/twig-bridge": "~2.6|~3.0.0",
|
||||
"symfony/http-foundation": "~2.5|~3.0.0",
|
||||
"symfony/http-kernel": "~2.1|~3.0.0"
|
||||
"php": ">=5.5.9",
|
||||
"symfony/twig-bridge": "~2.7|~3.0",
|
||||
"symfony/http-foundation": "~2.7|~3.0",
|
||||
"symfony/http-kernel": "~2.7|~3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/stopwatch": "~2.2|~3.0.0",
|
||||
"symfony/dependency-injection": "~2.2|~3.0.0",
|
||||
"symfony/expression-language": "~2.4|~3.0.0",
|
||||
"symfony/config": "~2.2|~3.0.0",
|
||||
"symfony/routing": "~2.1|~3.0.0",
|
||||
"symfony/templating": "~2.1|~3.0.0",
|
||||
"symfony/framework-bundle": "~2.1|~3.0.0"
|
||||
"symfony/stopwatch": "~2.7|~3.0",
|
||||
"symfony/dependency-injection": "~2.7|~3.0",
|
||||
"symfony/expression-language": "~2.7|~3.0",
|
||||
"symfony/config": "~2.7|~3.0",
|
||||
"symfony/routing": "~2.7|~3.0",
|
||||
"symfony/templating": "~2.7|~3.0",
|
||||
"symfony/framework-bundle": "~2.7|~3.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "Symfony\\Bundle\\TwigBundle\\": "" }
|
||||
|
@ -16,16 +16,16 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"symfony/http-kernel": "~2.4|~3.0.0",
|
||||
"symfony/routing": "~2.2|~3.0.0",
|
||||
"symfony/twig-bridge": "~2.2|~3.0.0"
|
||||
"php": ">=5.5.9",
|
||||
"symfony/http-kernel": "~2.7|~3.0",
|
||||
"symfony/routing": "~2.7|~3.0",
|
||||
"symfony/twig-bridge": "~2.7|~3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/config": "~2.2|~3.0.0",
|
||||
"symfony/console": "~2.3|~3.0.0",
|
||||
"symfony/dependency-injection": "~2.2|~3.0.0",
|
||||
"symfony/stopwatch": "~2.2|~3.0.0"
|
||||
"symfony/config": "~2.7|~3.0",
|
||||
"symfony/console": "~2.7|~3.0",
|
||||
"symfony/dependency-injection": "~2.7|~3.0",
|
||||
"symfony/stopwatch": "~2.7|~3.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "Symfony\\Bundle\\WebProfilerBundle\\": "" }
|
||||
|
@ -16,12 +16,12 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0"
|
||||
"php": ">=5.5.9",
|
||||
"symfony/dom-crawler": "~2.7|~3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/process": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/css-selector": "~2.0,>=2.0.5|~3.0.0"
|
||||
"symfony/process": "~2.7|~3.0",
|
||||
"symfony/css-selector": "~2.7|~3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/process": ""
|
||||
|
@ -43,10 +43,7 @@ class ClassCollectionLoader
|
||||
|
||||
self::$loaded[$name] = true;
|
||||
|
||||
$declared = array_merge(get_declared_classes(), get_declared_interfaces());
|
||||
if (function_exists('get_declared_traits')) {
|
||||
$declared = array_merge($declared, get_declared_traits());
|
||||
}
|
||||
$declared = array_merge(get_declared_classes(), get_declared_interfaces(), get_declared_traits());
|
||||
|
||||
if ($adaptive) {
|
||||
// don't include already declared classes
|
||||
|
@ -11,14 +11,6 @@
|
||||
|
||||
namespace Symfony\Component\ClassLoader;
|
||||
|
||||
if (!defined('SYMFONY_TRAIT')) {
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
define('SYMFONY_TRAIT', T_TRAIT);
|
||||
} else {
|
||||
define('SYMFONY_TRAIT', 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ClassMapGenerator.
|
||||
*
|
||||
@ -117,7 +109,7 @@ class ClassMapGenerator
|
||||
break;
|
||||
case T_CLASS:
|
||||
case T_INTERFACE:
|
||||
case SYMFONY_TRAIT:
|
||||
case T_TRAIT:
|
||||
// Find the classname
|
||||
while (($t = $tokens[++$i]) && is_array($t)) {
|
||||
if (T_STRING === $t[0]) {
|
||||
|
@ -107,7 +107,7 @@ class DebugClassLoader
|
||||
if ($file = $this->classFinder->findFile($class)) {
|
||||
require $file;
|
||||
|
||||
if (!class_exists($class, false) && !interface_exists($class, false) && (!function_exists('trait_exists') || !trait_exists($class, false))) {
|
||||
if (!class_exists($class, false) && !interface_exists($class, false) && !trait_exists($class, false)) {
|
||||
if (false !== strpos($class, '/')) {
|
||||
throw new \RuntimeException(sprintf('Trying to autoload a class with an invalid name "%s". Be careful that the namespace separator is "\" in PHP, not "/".', $class));
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ class DebugUniversalClassLoader extends UniversalClassLoader
|
||||
if ($file = $this->findFile($class)) {
|
||||
require $file;
|
||||
|
||||
if (!class_exists($class, false) && !interface_exists($class, false) && (!function_exists('trait_exists') || !trait_exists($class, false))) {
|
||||
if (!class_exists($class, false) && !interface_exists($class, false) && !trait_exists($class, false)) {
|
||||
throw new \RuntimeException(sprintf('The autoloader expected class "%s" to be defined in file "%s". The file was found but the class was not in it, the class name or namespace probably has a typo.', $class, $file));
|
||||
}
|
||||
}
|
||||
|
@ -22,12 +22,6 @@ class ClassCollectionLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testTraitDependencies()
|
||||
{
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
$this->markTestSkipped('Requires PHP > 5.4');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
require_once __DIR__.'/Fixtures/deps/traits.php';
|
||||
|
||||
$r = new \ReflectionClass('Symfony\Component\ClassLoader\ClassCollectionLoader');
|
||||
@ -100,12 +94,6 @@ class ClassCollectionLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testClassWithTraitsReordering(array $classes)
|
||||
{
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
$this->markTestSkipped('Requires PHP > 5.4');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
require_once __DIR__.'/Fixtures/ClassesWithParents/ATrait.php';
|
||||
require_once __DIR__.'/Fixtures/ClassesWithParents/BTrait.php';
|
||||
require_once __DIR__.'/Fixtures/ClassesWithParents/CTrait.php';
|
||||
@ -148,12 +136,6 @@ class ClassCollectionLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testFixClassWithTraitsOrdering()
|
||||
{
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
$this->markTestSkipped('Requires PHP > 5.4');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
require_once __DIR__.'/Fixtures/ClassesWithParents/CTrait.php';
|
||||
require_once __DIR__.'/Fixtures/ClassesWithParents/F.php';
|
||||
require_once __DIR__.'/Fixtures/ClassesWithParents/G.php';
|
||||
|
@ -102,18 +102,15 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
|
||||
'ClassMap\\SomeParent' => realpath(__DIR__).'/Fixtures/classmap/SomeParent.php',
|
||||
'ClassMap\\SomeClass' => realpath(__DIR__).'/Fixtures/classmap/SomeClass.php',
|
||||
)),
|
||||
);
|
||||
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
$data[] = array(__DIR__.'/Fixtures/php5.4', array(
|
||||
array(__DIR__.'/Fixtures/php5.4', array(
|
||||
'TFoo' => __DIR__.'/Fixtures/php5.4/traits.php',
|
||||
'CFoo' => __DIR__.'/Fixtures/php5.4/traits.php',
|
||||
'Foo\\TBar' => __DIR__.'/Fixtures/php5.4/traits.php',
|
||||
'Foo\\IBar' => __DIR__.'/Fixtures/php5.4/traits.php',
|
||||
'Foo\\TFooBar' => __DIR__.'/Fixtures/php5.4/traits.php',
|
||||
'Foo\\CBar' => __DIR__.'/Fixtures/php5.4/traits.php',
|
||||
));
|
||||
}
|
||||
)),
|
||||
);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
@ -17,10 +17,10 @@
|
||||
],
|
||||
"minimum-stability": "dev",
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/finder": "~2.0,>=2.0.5|~3.0.0"
|
||||
"symfony/finder": "~2.7|~3.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "Symfony\\Component\\ClassLoader\\": "" }
|
||||
|
@ -16,8 +16,8 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"symfony/filesystem": "~2.3|~3.0.0"
|
||||
"php": ">=5.5.9",
|
||||
"symfony/filesystem": "~2.7|~3.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "Symfony\\Component\\Config\\": "" }
|
||||
|
@ -229,10 +229,6 @@ class TextDescriptor extends Descriptor
|
||||
*/
|
||||
private function formatDefaultValue($default)
|
||||
{
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
return str_replace('\/', '/', json_encode($default));
|
||||
}
|
||||
|
||||
return json_encode($default, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
|
||||
|
@ -16,11 +16,11 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/event-dispatcher": "~2.1|~3.0.0",
|
||||
"symfony/process": "~2.1|~3.0.0",
|
||||
"symfony/event-dispatcher": "~2.7|~3.0",
|
||||
"symfony/process": "~2.7|~3.0",
|
||||
"psr/log": "~1.0"
|
||||
},
|
||||
"suggest": {
|
||||
|
@ -20,7 +20,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "Symfony\\Component\\CssSelector\\": "" }
|
||||
|
@ -162,7 +162,7 @@ class DebugClassLoader
|
||||
|
||||
ErrorHandler::unstackErrors();
|
||||
|
||||
$exists = class_exists($class, false) || interface_exists($class, false) || (function_exists('trait_exists') && trait_exists($class, false));
|
||||
$exists = class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false);
|
||||
|
||||
if ('\\' === $class[0]) {
|
||||
$class = substr($class, 1);
|
||||
|
@ -357,12 +357,6 @@ class ErrorHandler
|
||||
$type &= $level | $this->screamedErrors;
|
||||
|
||||
if ($type && ($log || $throw)) {
|
||||
if (PHP_VERSION_ID < 50400 && isset($context['GLOBALS']) && ($this->scopedErrors & $type)) {
|
||||
$e = $context; // Whatever the signature of the method,
|
||||
unset($e['GLOBALS'], $context); // $context is always a reference in 5.3
|
||||
$context = $e;
|
||||
}
|
||||
|
||||
if ($throw) {
|
||||
if (($this->scopedErrors & $type) && class_exists('Symfony\Component\Debug\Exception\ContextErrorException')) {
|
||||
// Checking for class existence is a work around for https://bugs.php.net/42098
|
||||
@ -371,14 +365,6 @@ class ErrorHandler
|
||||
$throw = new \ErrorException($this->levels[$type].': '.$message, 0, $type, $file, $line);
|
||||
}
|
||||
|
||||
if (PHP_VERSION_ID <= 50407 && (PHP_VERSION_ID >= 50400 || PHP_VERSION_ID <= 50317)) {
|
||||
// Exceptions thrown from error handlers are sometimes not caught by the exception
|
||||
// handler and shutdown handlers are bypassed before 5.4.8/5.3.18.
|
||||
// We temporarily re-enable display_errors to prevent any blank page related to this bug.
|
||||
|
||||
$throw->errorHandlerCanary = new ErrorHandlerCanary();
|
||||
}
|
||||
|
||||
throw $throw;
|
||||
}
|
||||
|
||||
@ -401,7 +387,7 @@ class ErrorHandler
|
||||
$e['stack'] = debug_backtrace(true); // Provide object
|
||||
}
|
||||
} elseif ($trace) {
|
||||
$e['stack'] = debug_backtrace(PHP_VERSION_ID >= 50306 ? DEBUG_BACKTRACE_IGNORE_ARGS : false);
|
||||
$e['stack'] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
|
||||
}
|
||||
}
|
||||
|
||||
@ -658,30 +644,3 @@ class ErrorHandler
|
||||
static::handleFatalError();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Private class used to work around https://bugs.php.net/54275
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class ErrorHandlerCanary
|
||||
{
|
||||
private static $displayErrors = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
if (null === self::$displayErrors) {
|
||||
self::$displayErrors = ini_set('display_errors', 1);
|
||||
}
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
if (null !== self::$displayErrors) {
|
||||
ini_set('display_errors', self::$displayErrors);
|
||||
self::$displayErrors = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -441,6 +441,6 @@ EOF;
|
||||
$str = iconv($charset, 'UTF-8', $str);
|
||||
}
|
||||
|
||||
return htmlspecialchars($str, ENT_QUOTES | (PHP_VERSION_ID >= 50400 ? ENT_SUBSTITUTE : 0), 'UTF-8');
|
||||
return htmlspecialchars($str, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
|
||||
}
|
||||
}
|
||||
|
@ -191,6 +191,6 @@ class ClassNotFoundFatalErrorHandler implements FatalErrorHandlerInterface
|
||||
*/
|
||||
private function classExists($class)
|
||||
{
|
||||
return class_exists($class, false) || interface_exists($class, false) || (function_exists('trait_exists') && trait_exists($class, false));
|
||||
return class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false);
|
||||
}
|
||||
}
|
||||
|
@ -16,12 +16,12 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"php": ">=5.5.9",
|
||||
"psr/log": "~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/http-kernel": "~2.2|~3.0.0",
|
||||
"symfony/http-foundation": "~2.1|~3.0.0"
|
||||
"symfony/http-kernel": "~2.7|~3.0",
|
||||
"symfony/http-foundation": "~2.7|~3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/http-foundation": "",
|
||||
|
@ -16,12 +16,12 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/yaml": "~2.1|~3.0.0",
|
||||
"symfony/config": "~2.2|~3.0.0",
|
||||
"symfony/expression-language": "~2.6|~3.0.0"
|
||||
"symfony/yaml": "~2.7|~3.0",
|
||||
"symfony/config": "~2.7|~3.0",
|
||||
"symfony/expression-language": "~2.7|~3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/yaml": "",
|
||||
|
@ -581,15 +581,7 @@ class Crawler extends \SplObjectStorage
|
||||
|
||||
$html = '';
|
||||
foreach ($this->getNode(0)->childNodes as $child) {
|
||||
if (PHP_VERSION_ID >= 50306) {
|
||||
// node parameter was added to the saveHTML() method in PHP 5.3.6
|
||||
// @see http://php.net/manual/en/domdocument.savehtml.php
|
||||
$html .= $child->ownerDocument->saveHTML($child);
|
||||
} else {
|
||||
$document = new \DOMDocument('1.0', 'UTF-8');
|
||||
$document->appendChild($document->importNode($child, true));
|
||||
$html .= rtrim($document->saveHTML());
|
||||
}
|
||||
$html .= $child->ownerDocument->saveHTML($child);
|
||||
}
|
||||
|
||||
return $html;
|
||||
|
@ -16,10 +16,10 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/css-selector": "~2.3|~3.0.0"
|
||||
"symfony/css-selector": "~2.7|~3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/css-selector": ""
|
||||
|
@ -16,13 +16,13 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/dependency-injection": "~2.6|~3.0.0",
|
||||
"symfony/expression-language": "~2.6|~3.0.0",
|
||||
"symfony/config": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/stopwatch": "~2.3|~3.0.0",
|
||||
"symfony/dependency-injection": "~2.7|~3.0",
|
||||
"symfony/expression-language": "~2.7|~3.0",
|
||||
"symfony/config": "~2.7|~3.0",
|
||||
"symfony/stopwatch": "~2.7|~3.0",
|
||||
"psr/log": "~1.0"
|
||||
},
|
||||
"suggest": {
|
||||
|
@ -336,10 +336,6 @@ class Parser
|
||||
|
||||
$node = new Node\GetAttrNode($node, $arg, $arguments, $type);
|
||||
} elseif ('[' === $token->value) {
|
||||
if ($node instanceof Node\GetAttrNode && Node\GetAttrNode::METHOD_CALL === $node->attributes['type'] && PHP_VERSION_ID < 50400) {
|
||||
throw new SyntaxError('Array calls on a method call is only supported on PHP 5.4+', $token->cursor);
|
||||
}
|
||||
|
||||
$this->stream->next();
|
||||
$arg = $this->parseExpression();
|
||||
$this->stream->expect(Token::PUNCTUATION_TYPE, ']');
|
||||
|
@ -16,7 +16,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "Symfony\\Component\\ExpressionLanguage\\": "" }
|
||||
|
@ -16,7 +16,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "Symfony\\Component\\Filesystem\\": "" }
|
||||
|
@ -16,7 +16,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "Symfony\\Component\\Finder\\": "" }
|
||||
|
@ -61,17 +61,12 @@ class DateTimeToStringTransformer extends BaseDateTimeTransformer
|
||||
*
|
||||
* @throws UnexpectedTypeException if a timezone is not a string
|
||||
*/
|
||||
public function __construct($inputTimezone = null, $outputTimezone = null, $format = 'Y-m-d H:i:s', $parseUsingPipe = null)
|
||||
public function __construct($inputTimezone = null, $outputTimezone = null, $format = 'Y-m-d H:i:s', $parseUsingPipe = true)
|
||||
{
|
||||
parent::__construct($inputTimezone, $outputTimezone);
|
||||
|
||||
$this->generateFormat = $this->parseFormat = $format;
|
||||
|
||||
// The pipe in the parser pattern only works as of PHP 5.3.7
|
||||
// See http://bugs.php.net/54316
|
||||
$this->parseUsingPipe = null === $parseUsingPipe
|
||||
? PHP_VERSION_ID >= 50307
|
||||
: $parseUsingPipe;
|
||||
$this->parseUsingPipe = $parseUsingPipe || null === $parseUsingPipe;
|
||||
|
||||
// See http://php.net/manual/en/datetime.createfromformat.php
|
||||
// The character "|" in the format makes sure that the parts of a date
|
||||
|
@ -73,11 +73,7 @@ class DefaultCsrfProvider implements CsrfProviderInterface
|
||||
*/
|
||||
protected function getSessionId()
|
||||
{
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
if (PHP_SESSION_NONE === session_status()) {
|
||||
session_start();
|
||||
}
|
||||
} elseif (!session_id()) {
|
||||
if (PHP_SESSION_NONE === session_status()) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
|
@ -30,6 +30,7 @@ class DateTimeToStringTransformerTest extends DateTimeTestCase
|
||||
array('H:i:00', '16:05:00', '1970-01-01 16:05:00 UTC'),
|
||||
array('H:i', '16:05', '1970-01-01 16:05:00 UTC'),
|
||||
array('H', '16', '1970-01-01 16:00:00 UTC'),
|
||||
array('Y-z', '2010-33', '2010-02-03 00:00:00 UTC'),
|
||||
|
||||
// different day representations
|
||||
array('Y-m-j', '2010-02-3', '2010-02-03 00:00:00 UTC'),
|
||||
@ -59,11 +60,6 @@ class DateTimeToStringTransformerTest extends DateTimeTestCase
|
||||
array('U', '1265213106', '2010-02-03 16:05:06 UTC'),
|
||||
);
|
||||
|
||||
// This test will fail < 5.3.9 - see https://bugs.php.net/51994
|
||||
if (PHP_VERSION_ID >= 50309) {
|
||||
$data[] = array('Y-z', '2010-33', '2010-02-03 00:00:00 UTC');
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@ -111,10 +107,6 @@ class DateTimeToStringTransformerTest extends DateTimeTestCase
|
||||
*/
|
||||
public function testReverseTransformUsingPipe($format, $input, $output)
|
||||
{
|
||||
if (PHP_VERSION_ID < 50307) {
|
||||
$this->markTestSkipped('Pipe usage requires PHP 5.3.7 or newer.');
|
||||
}
|
||||
|
||||
$reverseTransformer = new DateTimeToStringTransformer('UTC', 'UTC', $format, true);
|
||||
|
||||
$output = new \DateTime($output);
|
||||
|
@ -51,10 +51,6 @@ class DefaultCsrfProviderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
session_id('touti');
|
||||
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
$this->markTestSkipped('This test requires PHP >= 5.4');
|
||||
}
|
||||
|
||||
$this->assertSame(PHP_SESSION_NONE, session_status());
|
||||
|
||||
$token = $this->provider->generateCsrfToken('foo');
|
||||
|
@ -16,19 +16,19 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"symfony/event-dispatcher": "~2.1|~3.0.0",
|
||||
"symfony/intl": "~2.3|~3.0.0",
|
||||
"symfony/options-resolver": "~2.1|~3.0.0",
|
||||
"symfony/property-access": "~2.3|~3.0.0"
|
||||
"php": ">=5.5.9",
|
||||
"symfony/event-dispatcher": "~2.7|~3.0",
|
||||
"symfony/intl": "~2.7|~3.0",
|
||||
"symfony/options-resolver": "~2.7|~3.0",
|
||||
"symfony/property-access": "~2.7|~3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/collections": "~1.0",
|
||||
"symfony/validator": "~2.6|~3.0.0",
|
||||
"symfony/http-foundation": "~2.2|~3.0.0",
|
||||
"symfony/http-kernel": "~2.4|~3.0.0",
|
||||
"symfony/security-csrf": "~2.4|~3.0.0",
|
||||
"symfony/translation": "~2.0,>=2.0.5|~3.0.0"
|
||||
"symfony/validator": "~2.7|~3.0",
|
||||
"symfony/http-foundation": "~2.7|~3.0",
|
||||
"symfony/http-kernel": "~2.7|~3.0",
|
||||
"symfony/security-csrf": "~2.7|~3.0",
|
||||
"symfony/translation": "~2.7|~3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/validator": "For form validation.",
|
||||
|
@ -120,7 +120,7 @@ class JsonResponse extends Response
|
||||
}
|
||||
|
||||
if (JSON_ERROR_NONE !== json_last_error()) {
|
||||
throw new \InvalidArgumentException($this->transformJsonError());
|
||||
throw new \InvalidArgumentException(json_last_error_msg());
|
||||
}
|
||||
|
||||
return $this->update();
|
||||
@ -172,31 +172,4 @@ class JsonResponse extends Response
|
||||
|
||||
return $this->setContent($this->data);
|
||||
}
|
||||
|
||||
private function transformJsonError()
|
||||
{
|
||||
if (function_exists('json_last_error_msg')) {
|
||||
return json_last_error_msg();
|
||||
}
|
||||
|
||||
switch (json_last_error()) {
|
||||
case JSON_ERROR_DEPTH:
|
||||
return 'Maximum stack depth exceeded.';
|
||||
|
||||
case JSON_ERROR_STATE_MISMATCH:
|
||||
return 'Underflow or the modes mismatch.';
|
||||
|
||||
case JSON_ERROR_CTRL_CHAR:
|
||||
return 'Unexpected control character found.';
|
||||
|
||||
case JSON_ERROR_SYNTAX:
|
||||
return 'Syntax error, malformed JSON.';
|
||||
|
||||
case JSON_ERROR_UTF8:
|
||||
return 'Malformed UTF-8 characters, possibly incorrectly encoded.';
|
||||
|
||||
default:
|
||||
return 'Unknown error.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,12 +16,7 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
|
||||
*
|
||||
* @see http://php.net/sessionhandler
|
||||
*/
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
class NativeSessionHandler extends \SessionHandler
|
||||
{
|
||||
}
|
||||
} else {
|
||||
class NativeSessionHandler
|
||||
{
|
||||
}
|
||||
|
||||
class NativeSessionHandler extends \SessionHandler
|
||||
{
|
||||
}
|
||||
|
@ -101,11 +101,7 @@ class NativeSessionStorage implements SessionStorageInterface
|
||||
session_cache_limiter(''); // disable by default because it's managed by HeaderBag (if used)
|
||||
ini_set('session.use_cookies', 1);
|
||||
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
session_register_shutdown();
|
||||
} else {
|
||||
register_shutdown_function('session_write_close');
|
||||
}
|
||||
session_register_shutdown();
|
||||
|
||||
$this->setMetadataBag($metaBag);
|
||||
$this->setOptions($options);
|
||||
@ -131,15 +127,10 @@ class NativeSessionStorage implements SessionStorageInterface
|
||||
return true;
|
||||
}
|
||||
|
||||
if (PHP_VERSION_ID >= 50400 && \PHP_SESSION_ACTIVE === session_status()) {
|
||||
if (\PHP_SESSION_ACTIVE === session_status()) {
|
||||
throw new \RuntimeException('Failed to start the session: already started by PHP.');
|
||||
}
|
||||
|
||||
if (PHP_VERSION_ID < 50400 && !$this->closed && isset($_SESSION) && session_id()) {
|
||||
// not 100% fool-proof, but is the most reliable way to determine if a session is active in PHP 5.3
|
||||
throw new \RuntimeException('Failed to start the session: already started by PHP ($_SESSION is set).');
|
||||
}
|
||||
|
||||
if (ini_get('session.use_cookies') && headers_sent($file, $line)) {
|
||||
throw new \RuntimeException(sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.', $file, $line));
|
||||
}
|
||||
@ -150,10 +141,6 @@ class NativeSessionStorage implements SessionStorageInterface
|
||||
}
|
||||
|
||||
$this->loadSession();
|
||||
if (!$this->saveHandler->isWrapper() && !$this->saveHandler->isSessionHandlerInterface()) {
|
||||
// This condition matches only PHP 5.3 with internal save handlers
|
||||
$this->saveHandler->setActive(true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -213,11 +200,6 @@ class NativeSessionStorage implements SessionStorageInterface
|
||||
{
|
||||
session_write_close();
|
||||
|
||||
if (!$this->saveHandler->isWrapper() && !$this->saveHandler->isSessionHandlerInterface()) {
|
||||
// This condition matches only PHP 5.3 with internal save handlers
|
||||
$this->saveHandler->setActive(false);
|
||||
}
|
||||
|
||||
$this->closed = true;
|
||||
$this->started = false;
|
||||
}
|
||||
@ -363,24 +345,12 @@ class NativeSessionStorage implements SessionStorageInterface
|
||||
if (!$saveHandler instanceof AbstractProxy && $saveHandler instanceof \SessionHandlerInterface) {
|
||||
$saveHandler = new SessionHandlerProxy($saveHandler);
|
||||
} elseif (!$saveHandler instanceof AbstractProxy) {
|
||||
$saveHandler = PHP_VERSION_ID >= 50400 ?
|
||||
new SessionHandlerProxy(new \SessionHandler()) : new NativeProxy();
|
||||
$saveHandler = new SessionHandlerProxy(new \SessionHandler());
|
||||
}
|
||||
$this->saveHandler = $saveHandler;
|
||||
|
||||
if ($this->saveHandler instanceof \SessionHandlerInterface) {
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
session_set_save_handler($this->saveHandler, false);
|
||||
} else {
|
||||
session_set_save_handler(
|
||||
array($this->saveHandler, 'open'),
|
||||
array($this->saveHandler, 'close'),
|
||||
array($this->saveHandler, 'read'),
|
||||
array($this->saveHandler, 'write'),
|
||||
array($this->saveHandler, 'destroy'),
|
||||
array($this->saveHandler, 'gc')
|
||||
);
|
||||
}
|
||||
session_set_save_handler($this->saveHandler, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -43,10 +43,6 @@ class PhpBridgeSessionStorage extends NativeSessionStorage
|
||||
}
|
||||
|
||||
$this->loadSession();
|
||||
if (!$this->saveHandler->isWrapper() && !$this->saveHandler->isSessionHandlerInterface()) {
|
||||
// This condition matches only PHP 5.3 + internal save handlers
|
||||
$this->saveHandler->setActive(true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -25,11 +25,6 @@ abstract class AbstractProxy
|
||||
*/
|
||||
protected $wrapper = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $active = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
@ -72,32 +67,7 @@ abstract class AbstractProxy
|
||||
*/
|
||||
public function isActive()
|
||||
{
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
return $this->active = \PHP_SESSION_ACTIVE === session_status();
|
||||
}
|
||||
|
||||
return $this->active;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the active flag.
|
||||
*
|
||||
* Has no effect under PHP 5.4+ as status is detected
|
||||
* automatically in isActive()
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @param bool $flag
|
||||
*
|
||||
* @throws \LogicException
|
||||
*/
|
||||
public function setActive($flag)
|
||||
{
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
throw new \LogicException('This method is disabled in PHP 5.4.0+');
|
||||
}
|
||||
|
||||
$this->active = (bool) $flag;
|
||||
return \PHP_SESSION_ACTIVE === session_status();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -28,13 +28,8 @@ class NativeFileSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$storage = new NativeSessionStorage(array('name' => 'TESTING'), new NativeFileSessionHandler(sys_get_temp_dir()));
|
||||
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
$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('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'));
|
||||
|
@ -27,14 +27,7 @@ class NativeSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$handler = new NativeSessionHandler();
|
||||
|
||||
// note for PHPUnit optimisers - the use of assertTrue/False
|
||||
// here is deliberate since the tests do not require the classes to exist - drak
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
$this->assertFalse($handler instanceof \SessionHandler);
|
||||
$this->assertTrue($handler instanceof NativeSessionHandler);
|
||||
} else {
|
||||
$this->assertTrue($handler instanceof \SessionHandler);
|
||||
$this->assertTrue($handler instanceof NativeSessionHandler);
|
||||
}
|
||||
$this->assertTrue($handler instanceof \SessionHandler);
|
||||
$this->assertTrue($handler instanceof NativeSessionHandler);
|
||||
}
|
||||
}
|
||||
|
@ -165,34 +165,8 @@ class NativeSessionStorageTest extends \PHPUnit_Framework_TestCase
|
||||
$storage->setSaveHandler(new \stdClass());
|
||||
}
|
||||
|
||||
public function testSetSaveHandler53()
|
||||
public function testSetSaveHandler()
|
||||
{
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
$this->markTestSkipped('Test skipped, for PHP 5.3 only.');
|
||||
}
|
||||
|
||||
ini_set('session.save_handler', 'files');
|
||||
$storage = $this->getStorage();
|
||||
$storage->setSaveHandler();
|
||||
$this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy', $storage->getSaveHandler());
|
||||
$storage->setSaveHandler(null);
|
||||
$this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy', $storage->getSaveHandler());
|
||||
$storage->setSaveHandler(new NativeSessionHandler());
|
||||
$this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy', $storage->getSaveHandler());
|
||||
$storage->setSaveHandler(new SessionHandlerProxy(new NullSessionHandler()));
|
||||
$this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy', $storage->getSaveHandler());
|
||||
$storage->setSaveHandler(new NullSessionHandler());
|
||||
$this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy', $storage->getSaveHandler());
|
||||
$storage->setSaveHandler(new NativeProxy());
|
||||
$this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy', $storage->getSaveHandler());
|
||||
}
|
||||
|
||||
public function testSetSaveHandler54()
|
||||
{
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
$this->markTestSkipped('Test skipped, for PHP 5.4 only.');
|
||||
}
|
||||
|
||||
ini_set('session.save_handler', 'files');
|
||||
$storage = $this->getStorage();
|
||||
$storage->setSaveHandler();
|
||||
@ -212,7 +186,7 @@ class NativeSessionStorageTest extends \PHPUnit_Framework_TestCase
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
*/
|
||||
public function testStartedOutside()
|
||||
public function testStarted()
|
||||
{
|
||||
$storage = $this->getStorage();
|
||||
|
||||
@ -222,10 +196,8 @@ class NativeSessionStorageTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
session_start();
|
||||
$this->assertTrue(isset($_SESSION));
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
// this only works in PHP >= 5.4 where session_status is available
|
||||
$this->assertTrue($storage->getSaveHandler()->isActive());
|
||||
}
|
||||
$this->assertTrue($storage->getSaveHandler()->isActive());
|
||||
|
||||
// PHP session might have started, but the storage driver has not, so false is correct here
|
||||
$this->assertFalse($storage->isStarted());
|
||||
|
||||
|
@ -59,36 +59,8 @@ class PhpBridgeSessionStorageTest extends \PHPUnit_Framework_TestCase
|
||||
return $storage;
|
||||
}
|
||||
|
||||
public function testPhpSession53()
|
||||
public function testPhpSession()
|
||||
{
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
$this->markTestSkipped('Test skipped, for PHP 5.3 only.');
|
||||
}
|
||||
|
||||
$storage = $this->getStorage();
|
||||
|
||||
$this->assertFalse(isset($_SESSION));
|
||||
$this->assertFalse($storage->getSaveHandler()->isActive());
|
||||
|
||||
session_start();
|
||||
$this->assertTrue(isset($_SESSION));
|
||||
// in PHP 5.3 we cannot reliably tell if a session has started
|
||||
$this->assertFalse($storage->getSaveHandler()->isActive());
|
||||
// PHP session might have started, but the storage driver has not, so false is correct here
|
||||
$this->assertFalse($storage->isStarted());
|
||||
|
||||
$key = $storage->getMetadataBag()->getStorageKey();
|
||||
$this->assertFalse(isset($_SESSION[$key]));
|
||||
$storage->start();
|
||||
$this->assertTrue(isset($_SESSION[$key]));
|
||||
}
|
||||
|
||||
public function testPhpSession54()
|
||||
{
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
$this->markTestSkipped('Test skipped, for PHP 5.4 only.');
|
||||
}
|
||||
|
||||
$storage = $this->getStorage();
|
||||
|
||||
$this->assertFalse(isset($_SESSION));
|
||||
|
@ -85,56 +85,18 @@ class AbstractProxyTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($this->proxy->isWrapper());
|
||||
}
|
||||
|
||||
public function testIsActivePhp53()
|
||||
{
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
$this->markTestSkipped('Test skipped, for PHP 5.3 only.');
|
||||
}
|
||||
|
||||
$this->assertFalse($this->proxy->isActive());
|
||||
}
|
||||
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @preserveGlobalState disabled
|
||||
*/
|
||||
public function testIsActivePhp54()
|
||||
public function testIsActive()
|
||||
{
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
$this->markTestSkipped('Test skipped, for PHP 5.4 only.');
|
||||
}
|
||||
|
||||
$this->assertFalse($this->proxy->isActive());
|
||||
session_start();
|
||||
$this->assertTrue($this->proxy->isActive());
|
||||
}
|
||||
|
||||
public function testSetActivePhp53()
|
||||
{
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
$this->markTestSkipped('Test skipped, for PHP 5.3 only.');
|
||||
}
|
||||
|
||||
$this->proxy->setActive(true);
|
||||
$this->assertTrue($this->proxy->isActive());
|
||||
$this->proxy->setActive(false);
|
||||
$this->assertFalse($this->proxy->isActive());
|
||||
}
|
||||
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @preserveGlobalState disabled
|
||||
* @expectedException \LogicException
|
||||
*/
|
||||
public function testSetActivePhp54()
|
||||
{
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
$this->markTestSkipped('Test skipped, for PHP 5.4 only.');
|
||||
}
|
||||
|
||||
$this->proxy->setActive(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @preserveGlobalState disabled
|
||||
@ -147,30 +109,13 @@ class AbstractProxyTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(session_name(), $this->proxy->getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \LogicException
|
||||
*/
|
||||
public function testNameExceptionPhp53()
|
||||
{
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
$this->markTestSkipped('Test skipped, for PHP 5.3 only.');
|
||||
}
|
||||
|
||||
$this->proxy->setActive(true);
|
||||
$this->proxy->setName('foo');
|
||||
}
|
||||
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @preserveGlobalState disabled
|
||||
* @expectedException \LogicException
|
||||
*/
|
||||
public function testNameExceptionPhp54()
|
||||
public function testNameException()
|
||||
{
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
$this->markTestSkipped('Test skipped, for PHP 5.4 only.');
|
||||
}
|
||||
|
||||
session_start();
|
||||
$this->proxy->setName('foo');
|
||||
}
|
||||
@ -187,30 +132,13 @@ class AbstractProxyTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(session_id(), $this->proxy->getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \LogicException
|
||||
*/
|
||||
public function testIdExceptionPhp53()
|
||||
{
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
$this->markTestSkipped('Test skipped, for PHP 5.3 only.');
|
||||
}
|
||||
|
||||
$this->proxy->setActive(true);
|
||||
$this->proxy->setId('foo');
|
||||
}
|
||||
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @preserveGlobalState disabled
|
||||
* @expectedException \LogicException
|
||||
*/
|
||||
public function testIdExceptionPhp54()
|
||||
public function testIdException()
|
||||
{
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
$this->markTestSkipped('Test skipped, for PHP 5.4 only.');
|
||||
}
|
||||
|
||||
session_start();
|
||||
$this->proxy->setId('foo');
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ class SessionHandlerProxyTest extends \PHPUnit_Framework_TestCase
|
||||
$this->proxy = null;
|
||||
}
|
||||
|
||||
public function testOpen()
|
||||
public function testOpenTrue()
|
||||
{
|
||||
$this->mock->expects($this->once())
|
||||
->method('open')
|
||||
@ -53,11 +53,7 @@ class SessionHandlerProxyTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->assertFalse($this->proxy->isActive());
|
||||
$this->proxy->open('name', 'id');
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
$this->assertTrue($this->proxy->isActive());
|
||||
} else {
|
||||
$this->assertFalse($this->proxy->isActive());
|
||||
}
|
||||
$this->assertFalse($this->proxy->isActive());
|
||||
}
|
||||
|
||||
public function testOpenFalse()
|
||||
|
@ -16,10 +16,10 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/expression-language": "~2.4|~3.0.0"
|
||||
"symfony/expression-language": "~2.7|~3.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "Symfony\\Component\\HttpFoundation\\": "" },
|
||||
|
@ -60,12 +60,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
|
||||
$this->isCollected = false;
|
||||
}
|
||||
|
||||
$trace = PHP_VERSION_ID >= 50306 ? DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS : true;
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
$trace = debug_backtrace($trace, 7);
|
||||
} else {
|
||||
$trace = debug_backtrace($trace);
|
||||
}
|
||||
$trace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS, 7);
|
||||
|
||||
$file = $trace[0]['file'];
|
||||
$line = $trace[0]['line'];
|
||||
|
@ -107,11 +107,7 @@ class HIncludeFragmentRenderer extends RoutableFragmentRenderer
|
||||
}
|
||||
$renderedAttributes = '';
|
||||
if (count($attributes) > 0) {
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
$flags = ENT_QUOTES | ENT_SUBSTITUTE;
|
||||
} else {
|
||||
$flags = ENT_QUOTES;
|
||||
}
|
||||
$flags = ENT_QUOTES | ENT_SUBSTITUTE;
|
||||
foreach ($attributes as $attribute => $value) {
|
||||
$renderedAttributes .= sprintf(
|
||||
' %s="%s"',
|
||||
|
@ -181,15 +181,11 @@ class ControllerResolverTest extends \PHPUnit_Framework_TestCase
|
||||
$request->attributes->set('foobar', 'foobar');
|
||||
$controller = array(new self(), 'controllerMethod3');
|
||||
|
||||
if (PHP_VERSION_ID === 50316) {
|
||||
$this->markTestSkipped('PHP 5.3.16 has a major bug in the Reflection sub-system');
|
||||
} else {
|
||||
try {
|
||||
$resolver->getArguments($request, $controller);
|
||||
$this->fail('->getArguments() throws a \RuntimeException exception if it cannot determine the argument value');
|
||||
} catch (\Exception $e) {
|
||||
$this->assertInstanceOf('\RuntimeException', $e, '->getArguments() throws a \RuntimeException exception if it cannot determine the argument value');
|
||||
}
|
||||
try {
|
||||
$resolver->getArguments($request, $controller);
|
||||
$this->fail('->getArguments() throws a \RuntimeException exception if it cannot determine the argument value');
|
||||
} catch (\Exception $e) {
|
||||
$this->assertInstanceOf('\RuntimeException', $e, '->getArguments() throws a \RuntimeException exception if it cannot determine the argument value');
|
||||
}
|
||||
|
||||
$request = Request::create('/');
|
||||
|
@ -16,28 +16,28 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"symfony/event-dispatcher": "~2.5.9|~2.6,>=2.6.2|~3.0.0",
|
||||
"symfony/http-foundation": "~2.5,>=2.5.4|~3.0.0",
|
||||
"symfony/debug": "~2.6|~3.0.0",
|
||||
"php": ">=5.5.9",
|
||||
"symfony/event-dispatcher": "~2.7|~3.0",
|
||||
"symfony/http-foundation": "~2.7|~3.0",
|
||||
"symfony/debug": "~2.7|~3.0",
|
||||
"psr/log": "~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/browser-kit": "~2.3|~3.0.0",
|
||||
"symfony/class-loader": "~2.1|~3.0.0",
|
||||
"symfony/config": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/console": "~2.3|~3.0.0",
|
||||
"symfony/css-selector": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/dependency-injection": "~2.2|~3.0.0",
|
||||
"symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/expression-language": "~2.4|~3.0.0",
|
||||
"symfony/finder": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/process": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/routing": "~2.2|~3.0.0",
|
||||
"symfony/stopwatch": "~2.3|~3.0.0",
|
||||
"symfony/templating": "~2.2|~3.0.0",
|
||||
"symfony/translation": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/var-dumper": "~2.6|~3.0.0"
|
||||
"symfony/browser-kit": "~2.7|~3.0",
|
||||
"symfony/class-loader": "~2.7|~3.0",
|
||||
"symfony/config": "~2.7|~3.0",
|
||||
"symfony/console": "~2.7|~3.0",
|
||||
"symfony/css-selector": "~2.7|~3.0",
|
||||
"symfony/dependency-injection": "~2.7|~3.0",
|
||||
"symfony/dom-crawler": "~2.7|~3.0",
|
||||
"symfony/expression-language": "~2.7|~3.0",
|
||||
"symfony/finder": "~2.7|~3.0",
|
||||
"symfony/process": "~2.7|~3.0",
|
||||
"symfony/routing": "~2.7|~3.0",
|
||||
"symfony/stopwatch": "~2.7|~3.0",
|
||||
"symfony/templating": "~2.7|~3.0",
|
||||
"symfony/translation": "~2.7|~3.0",
|
||||
"symfony/var-dumper": "~2.7|~3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/browser-kit": "",
|
||||
|
@ -53,37 +53,10 @@ class JsonBundleReader implements BundleReaderInterface
|
||||
'The resource bundle "%s/%s.json" contains invalid JSON: %s',
|
||||
$path,
|
||||
$locale,
|
||||
self::getLastJsonError()
|
||||
json_last_error_msg()
|
||||
));
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string The last error message created by {@link json_decode()}
|
||||
*
|
||||
* @link http://de2.php.net/manual/en/function.json-last-error-msg.php#113243
|
||||
*/
|
||||
private static function getLastJsonError()
|
||||
{
|
||||
if (function_exists('json_last_error_msg')) {
|
||||
return json_last_error_msg();
|
||||
}
|
||||
|
||||
static $errors = array(
|
||||
JSON_ERROR_NONE => null,
|
||||
JSON_ERROR_DEPTH => 'Maximum stack depth exceeded',
|
||||
JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch',
|
||||
JSON_ERROR_CTRL_CHAR => 'Unexpected control character found',
|
||||
JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON',
|
||||
JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded',
|
||||
);
|
||||
|
||||
$error = json_last_error();
|
||||
|
||||
return array_key_exists($error, $errors)
|
||||
? $errors[$error]
|
||||
: sprintf('Unknown error (%s)', $error);
|
||||
}
|
||||
}
|
||||
|
@ -35,14 +35,8 @@ class JsonBundleWriter implements BundleWriterInterface
|
||||
}
|
||||
});
|
||||
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
// Use JSON_PRETTY_PRINT so that we can see what changed in Git diffs
|
||||
file_put_contents(
|
||||
$path.'/'.$locale.'.json',
|
||||
json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)."\n"
|
||||
);
|
||||
} else {
|
||||
file_put_contents($path.'/'.$locale.'.json', json_encode($data)."\n");
|
||||
}
|
||||
$contents = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)."\n";
|
||||
|
||||
file_put_contents($path.'/'.$locale.'.json', $contents);
|
||||
}
|
||||
}
|
||||
|
@ -187,8 +187,7 @@ class IntlDateFormatter
|
||||
/**
|
||||
* Format the date/time value (timestamp) as a string.
|
||||
*
|
||||
* @param int|\DateTime $timestamp The timestamp to format. \DateTime objects
|
||||
* are supported as of PHP 5.3.4.
|
||||
* @param int|\DateTime $timestamp The timestamp to format.
|
||||
*
|
||||
* @return string|bool The formatted value or false if formatting failed.
|
||||
*
|
||||
@ -200,20 +199,16 @@ class IntlDateFormatter
|
||||
{
|
||||
// intl allows timestamps to be passed as arrays - we don't
|
||||
if (is_array($timestamp)) {
|
||||
$message = PHP_VERSION_ID >= 50304 ?
|
||||
'Only integer Unix timestamps and DateTime objects are supported' :
|
||||
'Only integer Unix timestamps are supported';
|
||||
$message = 'Only integer Unix timestamps and DateTime objects are supported';
|
||||
|
||||
throw new MethodArgumentValueNotImplementedException(__METHOD__, 'timestamp', $timestamp, $message);
|
||||
}
|
||||
|
||||
// behave like the intl extension
|
||||
$argumentError = null;
|
||||
if (PHP_VERSION_ID < 50304 && !is_int($timestamp)) {
|
||||
$argumentError = 'datefmt_format: takes either an array or an integer timestamp value ';
|
||||
} elseif (PHP_VERSION_ID >= 50304 && !is_int($timestamp) && !$timestamp instanceof \DateTime) {
|
||||
if (!is_int($timestamp) && !$timestamp instanceof \DateTime) {
|
||||
$argumentError = 'datefmt_format: takes either an array or an integer timestamp value or a DateTime object';
|
||||
if (PHP_VERSION_ID >= 50500 && !is_int($timestamp)) {
|
||||
if (!is_int($timestamp)) {
|
||||
$argumentError = sprintf('datefmt_format: string \'%s\' is not numeric, which would be required for it to be a valid date', $timestamp);
|
||||
}
|
||||
}
|
||||
@ -227,7 +222,7 @@ class IntlDateFormatter
|
||||
}
|
||||
|
||||
// As of PHP 5.3.4, IntlDateFormatter::format() accepts DateTime instances
|
||||
if (PHP_VERSION_ID >= 50304 && $timestamp instanceof \DateTime) {
|
||||
if ($timestamp instanceof \DateTime) {
|
||||
$timestamp = $timestamp->getTimestamp();
|
||||
}
|
||||
|
||||
@ -375,10 +370,7 @@ class IntlDateFormatter
|
||||
return $this->timeZoneId;
|
||||
}
|
||||
|
||||
// In PHP 5.5 default timezone depends on `date_default_timezone_get()` method
|
||||
if (PHP_VERSION_ID >= 50500) {
|
||||
return date_default_timezone_get();
|
||||
}
|
||||
return date_default_timezone_get();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -540,16 +532,7 @@ class IntlDateFormatter
|
||||
public function setTimeZoneId($timeZoneId)
|
||||
{
|
||||
if (null === $timeZoneId) {
|
||||
// In PHP 5.5 if $timeZoneId is null it fallbacks to `date_default_timezone_get()` method
|
||||
if (PHP_VERSION_ID >= 50500) {
|
||||
$timeZoneId = date_default_timezone_get();
|
||||
} else {
|
||||
// TODO: changes were made to ext/intl in PHP 5.4.4 release that need to be investigated since it will
|
||||
// use ini's date.timezone when the time zone is not provided. As a not well tested workaround, uses UTC.
|
||||
// See the first two items of the commit message for more information:
|
||||
// https://github.com/php/php-src/commit/eb346ef0f419b90739aadfb6cc7b7436c5b521d9
|
||||
$timeZoneId = getenv('TZ') ?: 'UTC';
|
||||
}
|
||||
$timeZoneId = date_default_timezone_get();
|
||||
|
||||
$this->unitializedTimeZoneId = true;
|
||||
}
|
||||
|
@ -839,9 +839,7 @@ class NumberFormatter
|
||||
*
|
||||
* @param mixed $value The value to be converted
|
||||
*
|
||||
* @return int|float The converted value
|
||||
*
|
||||
* @see https://bugs.php.net/bug.php?id=59597 Bug #59597
|
||||
* @return int|false The converted value
|
||||
*/
|
||||
private function getInt64Value($value)
|
||||
{
|
||||
@ -849,30 +847,6 @@ class NumberFormatter
|
||||
return false;
|
||||
}
|
||||
|
||||
if (PHP_INT_SIZE !== 8 && ($value > self::$int32Range['positive'] || $value <= self::$int32Range['negative'])) {
|
||||
// Bug #59597 was fixed on PHP 5.3.14 and 5.4.4
|
||||
// The negative PHP_INT_MAX was being converted to float
|
||||
if (
|
||||
$value == self::$int32Range['negative'] &&
|
||||
((PHP_VERSION_ID < 50400 && PHP_VERSION_ID >= 50314) || PHP_VERSION_ID >= 50404)
|
||||
) {
|
||||
return (int) $value;
|
||||
}
|
||||
|
||||
return (float) $value;
|
||||
}
|
||||
|
||||
if (PHP_INT_SIZE === 8) {
|
||||
// Bug #59597 was fixed on PHP 5.3.14 and 5.4.4
|
||||
// A 32 bit integer was being generated instead of a 64 bit integer
|
||||
if (
|
||||
($value > self::$int32Range['positive'] || $value < self::$int32Range['negative']) &&
|
||||
(PHP_VERSION_ID < 50314 || (PHP_VERSION_ID >= 50400 && PHP_VERSION_ID < 50404))
|
||||
) {
|
||||
$value = (-2147483648 - ($value % -2147483648)) * ($value / abs($value));
|
||||
}
|
||||
}
|
||||
|
||||
return (int) $value;
|
||||
}
|
||||
|
||||
|
@ -34,10 +34,6 @@ class JsonBundleWriterTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
$this->markTestSkipped('This test requires at least PHP 5.4.0.');
|
||||
}
|
||||
|
||||
$this->writer = new JsonBundleWriter();
|
||||
$this->directory = sys_get_temp_dir().'/JsonBundleWriterTest/'.rand(1000, 9999);
|
||||
$this->filesystem = new Filesystem();
|
||||
@ -47,10 +43,6 @@ class JsonBundleWriterTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
protected function tearDown()
|
||||
{
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->filesystem->remove($this->directory);
|
||||
}
|
||||
|
||||
|
@ -37,12 +37,7 @@ abstract class AbstractIntlDateFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$formatter = $this->getDateFormatter('en', IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT);
|
||||
|
||||
// In PHP 5.5 default timezone depends on `date_default_timezone_get()` method
|
||||
if (PHP_VERSION_ID >= 50500) {
|
||||
$this->assertEquals(date_default_timezone_get(), $formatter->getTimeZoneId());
|
||||
} else {
|
||||
$this->assertNull($formatter->getTimeZoneId());
|
||||
}
|
||||
$this->assertEquals(date_default_timezone_get(), $formatter->getTimeZoneId());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -60,6 +55,8 @@ abstract class AbstractIntlDateFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function formatProvider()
|
||||
{
|
||||
$dateTime = new \DateTime('@0');
|
||||
|
||||
$formatData = array(
|
||||
/* general */
|
||||
array('y-M-d', 0, '1970-1-1'),
|
||||
@ -236,22 +233,16 @@ abstract class AbstractIntlDateFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
array('zzz', 0, 'GMT'),
|
||||
array('zzzz', 0, 'GMT'),
|
||||
array('zzzzz', 0, 'GMT'),
|
||||
|
||||
// general, DateTime
|
||||
array('y-M-d', $dateTime, '1970-1-1'),
|
||||
array("EEE, MMM d, ''yy", $dateTime, "Thu, Jan 1, '70"),
|
||||
array('h:mm a', $dateTime, '12:00 AM'),
|
||||
array('yyyyy.MMMM.dd hh:mm aaa', $dateTime, '01970.January.01 12:00 AM'),
|
||||
array("yyyy.MM.dd 'at' HH:mm:ss zzz", $dateTime, '1970.01.01 at 00:00:00 GMT'),
|
||||
array('K:mm a, z', $dateTime, '0:00 AM, GMT'),
|
||||
);
|
||||
|
||||
// As of PHP 5.3.4, IntlDateFormatter::format() accepts DateTime instances
|
||||
if (PHP_VERSION_ID >= 50304) {
|
||||
$dateTime = new \DateTime('@0');
|
||||
|
||||
/* general, DateTime */
|
||||
$formatData[] = array('y-M-d', $dateTime, '1970-1-1');
|
||||
$formatData[] = array("EEE, MMM d, ''yy", $dateTime, "Thu, Jan 1, '70");
|
||||
$formatData[] = array('h:mm a', $dateTime, '12:00 AM');
|
||||
$formatData[] = array('yyyyy.MMMM.dd hh:mm aaa', $dateTime, '01970.January.01 12:00 AM');
|
||||
|
||||
$formatData[] = array("yyyy.MM.dd 'at' HH:mm:ss zzz", $dateTime, '1970.01.01 at 00:00:00 GMT');
|
||||
$formatData[] = array('K:mm a, z', $dateTime, '0:00 AM, GMT');
|
||||
}
|
||||
|
||||
return $formatData;
|
||||
}
|
||||
|
||||
@ -269,22 +260,8 @@ abstract class AbstractIntlDateFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function formatErrorProvider()
|
||||
{
|
||||
// With PHP 5.5 IntlDateFormatter accepts empty values ('0')
|
||||
if (PHP_VERSION_ID >= 50500) {
|
||||
return array(
|
||||
array('y-M-d', 'foobar', 'datefmt_format: string \'foobar\' is not numeric, which would be required for it to be a valid date: U_ILLEGAL_ARGUMENT_ERROR'),
|
||||
);
|
||||
}
|
||||
|
||||
$message = 'datefmt_format: takes either an array or an integer timestamp value : U_ILLEGAL_ARGUMENT_ERROR';
|
||||
|
||||
if (PHP_VERSION_ID >= 50304) {
|
||||
$message = 'datefmt_format: takes either an array or an integer timestamp value or a DateTime object: U_ILLEGAL_ARGUMENT_ERROR';
|
||||
}
|
||||
|
||||
return array(
|
||||
array('y-M-d', '0', $message),
|
||||
array('y-M-d', 'foobar', $message),
|
||||
array('y-M-d', 'foobar', 'datefmt_format: string \'foobar\' is not numeric, which would be required for it to be a valid date: U_ILLEGAL_ARGUMENT_ERROR'),
|
||||
);
|
||||
}
|
||||
|
||||
@ -324,16 +301,12 @@ abstract class AbstractIntlDateFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
array(0, 'Europe/Dublin', '1970-01-01 01:00:00'),
|
||||
array(0, 'Europe/Warsaw', '1970-01-01 01:00:00'),
|
||||
array(0, 'Pacific/Fiji', '1970-01-01 12:00:00'),
|
||||
array(0, 'Foo/Bar', '1970-01-01 00:00:00'),
|
||||
array(0, 'Foo/Bar', '1970-01-01 00:00:00'),
|
||||
array(0, 'UTC+04:30', '1970-01-01 00:00:00'),
|
||||
array(0, 'UTC+04:AA', '1970-01-01 00:00:00'),
|
||||
);
|
||||
|
||||
// As of PHP 5.5, intl ext no longer fallbacks invalid time zones to UTC
|
||||
if (PHP_VERSION_ID < 50500) {
|
||||
// When time zone not exists, uses UTC by default
|
||||
$data[] = array(0, 'Foo/Bar', '1970-01-01 00:00:00');
|
||||
$data[] = array(0, 'UTC+04:30', '1970-01-01 00:00:00');
|
||||
$data[] = array(0, 'UTC+04:AA', '1970-01-01 00:00:00');
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@ -341,11 +314,7 @@ abstract class AbstractIntlDateFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$formatter = $this->getDefaultDateFormatter('zzzz');
|
||||
|
||||
if (PHP_VERSION_ID >= 50500) {
|
||||
$formatter->setTimeZone('GMT+03:00');
|
||||
} else {
|
||||
$formatter->setTimeZoneId('GMT+03:00');
|
||||
}
|
||||
$formatter->setTimeZone('GMT+03:00');
|
||||
|
||||
$this->assertEquals('GMT+03:00', $formatter->format(0));
|
||||
}
|
||||
@ -354,11 +323,7 @@ abstract class AbstractIntlDateFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$formatter = $this->getDefaultDateFormatter('zzzz');
|
||||
|
||||
if (PHP_VERSION_ID >= 50500) {
|
||||
$formatter->setTimeZone('GMT+00:30');
|
||||
} else {
|
||||
$formatter->setTimeZoneId('GMT+00:30');
|
||||
}
|
||||
$formatter->setTimeZone('GMT+00:30');
|
||||
|
||||
$this->assertEquals('GMT+00:30', $formatter->format(0));
|
||||
}
|
||||
@ -367,11 +332,7 @@ abstract class AbstractIntlDateFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$formatter = $this->getDefaultDateFormatter('zzzz');
|
||||
|
||||
if (PHP_VERSION_ID >= 50500) {
|
||||
$formatter->setTimeZone('Pacific/Fiji');
|
||||
} else {
|
||||
$formatter->setTimeZoneId('Pacific/Fiji');
|
||||
}
|
||||
$formatter->setTimeZone('Pacific/Fiji');
|
||||
|
||||
$this->assertEquals('Fiji Standard Time', $formatter->format(0));
|
||||
}
|
||||
@ -387,35 +348,8 @@ abstract class AbstractIntlDateFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function testFormatWithTimezoneFromEnvironmentVariable()
|
||||
{
|
||||
if (PHP_VERSION_ID >= 50500) {
|
||||
$this->markTestSkipped('IntlDateFormatter in PHP 5.5 no longer depends on TZ environment.');
|
||||
}
|
||||
|
||||
$tz = getenv('TZ');
|
||||
putenv('TZ=Europe/London');
|
||||
|
||||
$formatter = $this->getDateFormatter('en', IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT);
|
||||
$formatter->setPattern('yyyy-MM-dd HH:mm:ss');
|
||||
|
||||
$this->assertEquals(
|
||||
$this->getDateTime(0, 'Europe/London')->format('Y-m-d H:i:s'),
|
||||
$formatter->format(0)
|
||||
);
|
||||
|
||||
$this->assertEquals('Europe/London', getenv('TZ'));
|
||||
|
||||
// Restores TZ.
|
||||
putenv('TZ='.$tz);
|
||||
}
|
||||
|
||||
public function testFormatWithTimezoneFromPhp()
|
||||
{
|
||||
if (PHP_VERSION_ID < 50500) {
|
||||
$this->markTestSkipped('Only in PHP 5.5 IntlDateFormatter depends on default timezone (`date_default_timezone_get()`).');
|
||||
}
|
||||
|
||||
$tz = date_default_timezone_get();
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
@ -843,11 +777,7 @@ abstract class AbstractIntlDateFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$formatter = $this->getDefaultDateFormatter();
|
||||
|
||||
if (PHP_VERSION_ID >= 50500) {
|
||||
$formatter->setTimeZone($timeZoneId);
|
||||
} else {
|
||||
$formatter->setTimeZoneId($timeZoneId);
|
||||
}
|
||||
$formatter->setTimeZone($timeZoneId);
|
||||
|
||||
$this->assertEquals($expectedTimeZoneId, $formatter->getTimeZoneId());
|
||||
}
|
||||
|
@ -56,12 +56,7 @@ class IntlDateFormatterTest extends AbstractIntlDateFormatterTest
|
||||
$formatter->format($localtime);
|
||||
} catch (\Exception $e) {
|
||||
$this->assertInstanceOf('Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException', $e);
|
||||
|
||||
if (PHP_VERSION_ID >= 50304) {
|
||||
$this->assertStringEndsWith('Only integer Unix timestamps and DateTime objects are supported. Please install the "intl" extension for full localization capabilities.', $e->getMessage());
|
||||
} else {
|
||||
$this->assertStringEndsWith('Only integer Unix timestamps are supported. Please install the "intl" extension for full localization capabilities.', $e->getMessage());
|
||||
}
|
||||
$this->assertStringEndsWith('Only integer Unix timestamps and DateTime objects are supported. Please install the "intl" extension for full localization capabilities.', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -687,13 +687,7 @@ abstract class AbstractNumberFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$parsedValue = $formatter->parse('-2,147,483,648', NumberFormatter::TYPE_INT64);
|
||||
|
||||
// Bug #59597 was fixed on PHP 5.3.14 and 5.4.4
|
||||
// The negative PHP_INT_MAX was being converted to float
|
||||
if ((PHP_VERSION_ID < 50400 && PHP_VERSION_ID >= 50314) || PHP_VERSION_ID >= 50404) {
|
||||
$this->assertInternalType('int', $parsedValue);
|
||||
} else {
|
||||
$this->assertInternalType('float', $parsedValue);
|
||||
}
|
||||
$this->assertInternalType('int', $parsedValue);
|
||||
|
||||
$this->assertEquals(-2147483648, $parsedValue);
|
||||
}
|
||||
@ -744,24 +738,12 @@ abstract class AbstractNumberFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
$parsedValue = $formatter->parse('2,147,483,648', NumberFormatter::TYPE_INT64);
|
||||
$this->assertInternalType('integer', $parsedValue);
|
||||
|
||||
// Bug #59597 was fixed on PHP 5.3.14 and 5.4.4
|
||||
// A 32 bit integer was being generated instead of a 64 bit integer
|
||||
if (PHP_VERSION_ID < 50314 || (PHP_VERSION_ID >= 50400 && PHP_VERSION_ID < 50404)) {
|
||||
$this->assertEquals(-2147483648, $parsedValue, '->parse() TYPE_INT64 does not use true 64 bit integers, using only the 32 bit range (PHP < 5.3.14 and PHP < 5.4.4).');
|
||||
} else {
|
||||
$this->assertEquals(2147483648, $parsedValue, '->parse() TYPE_INT64 uses true 64 bit integers (PHP >= 5.3.14 and PHP >= 5.4.4).');
|
||||
}
|
||||
$this->assertEquals(2147483648, $parsedValue, '->parse() TYPE_INT64 uses true 64 bit integers (PHP >= 5.3.14 and PHP >= 5.4.4).');
|
||||
|
||||
$parsedValue = $formatter->parse('-2,147,483,649', NumberFormatter::TYPE_INT64);
|
||||
$this->assertInternalType('integer', $parsedValue);
|
||||
|
||||
// Bug #59597 was fixed on PHP 5.3.14 and 5.4.4
|
||||
// A 32 bit integer was being generated instead of a 64 bit integer
|
||||
if (PHP_VERSION_ID < 50314 || (PHP_VERSION_ID >= 50400 && PHP_VERSION_ID < 50404)) {
|
||||
$this->assertEquals(2147483647, $parsedValue, '->parse() TYPE_INT64 does not use true 64 bit integers, using only the 32 bit range (PHP < 5.3.14 and PHP < 5.4.4).');
|
||||
} else {
|
||||
$this->assertEquals(-2147483649, $parsedValue, '->parse() TYPE_INT64 uses true 64 bit integers (PHP >= 5.3.14 and PHP >= 5.4.4).');
|
||||
}
|
||||
$this->assertEquals(-2147483649, $parsedValue, '->parse() TYPE_INT64 uses true 64 bit integers (PHP >= 5.3.14 and PHP >= 5.4.4).');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -24,10 +24,10 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/filesystem": "~2.1|~3.0.0"
|
||||
"symfony/filesystem": "~2.7|~3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-intl": "to use the component with locales other than \"en\""
|
||||
|
@ -16,8 +16,8 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"symfony/intl": "~2.3|~3.0.0"
|
||||
"php": ">=5.5.9",
|
||||
"symfony/intl": "~2.7|~3.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "Symfony\\Component\\Locale\\": "" }
|
||||
|
@ -16,7 +16,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "Symfony\\Component\\OptionsResolver\\": "" }
|
||||
|
@ -16,7 +16,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "Symfony\\Component\\Process\\": "" }
|
||||
|
@ -16,7 +16,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "Symfony\\Component\\PropertyAccess\\": "" }
|
||||
|
@ -16,13 +16,13 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/config": "~2.2|~3.0.0",
|
||||
"symfony/http-foundation": "~2.3|~3.0.0",
|
||||
"symfony/yaml": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/expression-language": "~2.4|~3.0.0",
|
||||
"symfony/config": "~2.7|~3.0",
|
||||
"symfony/http-foundation": "~2.7|~3.0",
|
||||
"symfony/yaml": "~2.7|~3.0",
|
||||
"symfony/expression-language": "~2.7|~3.0",
|
||||
"doctrine/annotations": "~1.0",
|
||||
"doctrine/common": "~2.2",
|
||||
"psr/log": "~1.0"
|
||||
|
@ -16,8 +16,8 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"symfony/security-core": "~2.4|~3.0.0"
|
||||
"php": ">=5.5.9",
|
||||
"symfony/security-core": "~2.7|~3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/common": "~2.2",
|
||||
|
@ -34,10 +34,6 @@ class BCryptPasswordEncoder extends BasePasswordEncoder
|
||||
*/
|
||||
public function __construct($cost)
|
||||
{
|
||||
if (!function_exists('password_hash')) {
|
||||
throw new \RuntimeException('To use the BCrypt encoder, you need to upgrade to PHP 5.5 or install the "ircmaxell/password-compat" via Composer.');
|
||||
}
|
||||
|
||||
$cost = (int) $cost;
|
||||
if ($cost < 4 || $cost > 31) {
|
||||
throw new \InvalidArgumentException('Cost must be in the range of 4-31.');
|
||||
|
@ -64,11 +64,7 @@ class Pbkdf2PasswordEncoder extends BasePasswordEncoder
|
||||
throw new \LogicException(sprintf('The algorithm "%s" is not supported.', $this->algorithm));
|
||||
}
|
||||
|
||||
if (function_exists('hash_pbkdf2')) {
|
||||
$digest = hash_pbkdf2($this->algorithm, $raw, $salt, $this->iterations, $this->length, true);
|
||||
} else {
|
||||
$digest = $this->hashPbkdf2($this->algorithm, $raw, $salt, $this->iterations, $this->length);
|
||||
}
|
||||
$digest = hash_pbkdf2($this->algorithm, $raw, $salt, $this->iterations, $this->length, true);
|
||||
|
||||
return $this->encodeHashAsBase64 ? base64_encode($digest) : bin2hex($digest);
|
||||
}
|
||||
@ -80,24 +76,4 @@ class Pbkdf2PasswordEncoder extends BasePasswordEncoder
|
||||
{
|
||||
return !$this->isPasswordTooLong($raw) && $this->comparePasswords($encoded, $this->encodePassword($raw, $salt));
|
||||
}
|
||||
|
||||
private function hashPbkdf2($algorithm, $password, $salt, $iterations, $length = 0)
|
||||
{
|
||||
// Number of blocks needed to create the derived key
|
||||
$blocks = ceil($length / strlen(hash($algorithm, null, true)));
|
||||
$digest = '';
|
||||
|
||||
for ($i = 1; $i <= $blocks; $i++) {
|
||||
$ib = $block = hash_hmac($algorithm, $salt.pack('N', $i), $password, true);
|
||||
|
||||
// Iterations
|
||||
for ($j = 1; $j < $iterations; $j++) {
|
||||
$ib ^= ($block = hash_hmac($algorithm, $block, $password, true));
|
||||
}
|
||||
|
||||
$digest .= $ib;
|
||||
}
|
||||
|
||||
return substr($digest, 0, $this->length);
|
||||
}
|
||||
}
|
||||
|
@ -47,8 +47,6 @@ class BCryptPasswordEncoderTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testResultLength()
|
||||
{
|
||||
$this->skipIfPhpVersionIsNotSupported();
|
||||
|
||||
$encoder = new BCryptPasswordEncoder(self::VALID_COST);
|
||||
$result = $encoder->encodePassword(self::PASSWORD, null);
|
||||
$this->assertEquals(60, strlen($result));
|
||||
@ -56,21 +54,12 @@ class BCryptPasswordEncoderTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testValidation()
|
||||
{
|
||||
$this->skipIfPhpVersionIsNotSupported();
|
||||
|
||||
$encoder = new BCryptPasswordEncoder(self::VALID_COST);
|
||||
$result = $encoder->encodePassword(self::PASSWORD, null);
|
||||
$this->assertTrue($encoder->isPasswordValid($result, self::PASSWORD, null));
|
||||
$this->assertFalse($encoder->isPasswordValid($result, 'anotherPassword', null));
|
||||
}
|
||||
|
||||
private function skipIfPhpVersionIsNotSupported()
|
||||
{
|
||||
if (PHP_VERSION_ID < 50307) {
|
||||
$this->markTestSkipped('Requires PHP >= 5.3.7');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\Security\Core\Exception\BadCredentialsException
|
||||
*/
|
||||
|
@ -43,9 +43,7 @@ final class SecureRandom implements SecureRandomInterface
|
||||
$this->logger = $logger;
|
||||
|
||||
// determine whether to use OpenSSL
|
||||
if (defined('PHP_WINDOWS_VERSION_BUILD') && PHP_VERSION_ID < 50304) {
|
||||
$this->useOpenSsl = false;
|
||||
} elseif (!function_exists('openssl_random_pseudo_bytes')) {
|
||||
if (!function_exists('openssl_random_pseudo_bytes')) {
|
||||
if (null !== $this->logger) {
|
||||
$this->logger->notice('It is recommended that you enable the "openssl" extension for random number generation.');
|
||||
}
|
||||
|
@ -16,23 +16,21 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/event-dispatcher": "~2.1|~3.0.0",
|
||||
"symfony/expression-language": "~2.6|~3.0.0",
|
||||
"symfony/http-foundation": "~2.4|~3.0.0",
|
||||
"symfony/translation": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/validator": "~2.5,>=2.5.5|~3.0.0",
|
||||
"psr/log": "~1.0",
|
||||
"ircmaxell/password-compat": "1.0.*"
|
||||
"symfony/event-dispatcher": "~2.7|~3.0",
|
||||
"symfony/expression-language": "~2.7|~3.0",
|
||||
"symfony/http-foundation": "~2.7|~3.0",
|
||||
"symfony/translation": "~2.7|~3.0",
|
||||
"symfony/validator": "~2.7|~3.0",
|
||||
"psr/log": "~1.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/event-dispatcher": "",
|
||||
"symfony/http-foundation": "",
|
||||
"symfony/validator": "For using the user password constraint",
|
||||
"symfony/expression-language": "For using the expression voter",
|
||||
"ircmaxell/password-compat": "For using the BCrypt password encoder in PHP <5.5"
|
||||
"symfony/expression-language": "For using the expression voter"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "Symfony\\Component\\Security\\Core\\": "" }
|
||||
|
@ -52,10 +52,6 @@ class NativeSessionTokenStorageTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testStoreTokenInClosedSessionWithExistingSessionId()
|
||||
{
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
$this->markTestSkipped('This test requires PHP 5.4 or later.');
|
||||
}
|
||||
|
||||
session_id('foobar');
|
||||
|
||||
$this->assertSame(PHP_SESSION_NONE, session_status());
|
||||
|
@ -108,11 +108,7 @@ class NativeSessionTokenStorage implements TokenStorageInterface
|
||||
|
||||
private function startSession()
|
||||
{
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
if (PHP_SESSION_NONE === session_status()) {
|
||||
session_start();
|
||||
}
|
||||
} elseif (!session_id()) {
|
||||
if (PHP_SESSION_NONE === session_status()) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user