Merge branch '2.5' into 2.6
* 2.5: [Debug] fix error message on double exception Fix initialized() with aliased services Rename Symfony2 to Symfony compare version using PHP_VERSION_ID backport #12489 remove an unneeded check
This commit is contained in:
commit
18c4ac1f6e
@ -1,7 +1,7 @@
|
||||
CONTRIBUTORS
|
||||
============
|
||||
|
||||
Symfony2 is the result of the work of many people who made the code better
|
||||
Symfony is the result of the work of many people who made the code better
|
||||
(see http://symfony.com/contributors for more information):
|
||||
|
||||
- Fabien Potencier (fabpot)
|
||||
|
22
README.md
22
README.md
@ -1,10 +1,10 @@
|
||||
README
|
||||
======
|
||||
|
||||
What is Symfony2?
|
||||
What is Symfony?
|
||||
-----------------
|
||||
|
||||
Symfony2 is a PHP 5.3 full-stack web framework. It is written with speed and
|
||||
Symfony is a PHP 5.3 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.
|
||||
|
||||
@ -14,7 +14,7 @@ to high traffic ones like Dailymotion or Yahoo! Answers.
|
||||
Requirements
|
||||
------------
|
||||
|
||||
Symfony2 is only supported on PHP 5.3.3 and up.
|
||||
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:
|
||||
@ -28,35 +28,35 @@ work for you:
|
||||
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 Symfony2 (https://bugs.php.net/bug.php?id=62715)
|
||||
run Symfony (https://bugs.php.net/bug.php?id=62715)
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
The best way to install Symfony2 is to download the Symfony Standard Edition
|
||||
The best way to install Symfony is to download the Symfony Standard Edition
|
||||
available at [http://symfony.com/download][1].
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
The "[Quick Tour][2]" tutorial gives you a first feeling of the framework. If,
|
||||
like us, you think that Symfony2 can help speed up your development and take
|
||||
like us, you think that Symfony can help speed up your development and take
|
||||
the quality of your work to the next level, read the official
|
||||
[Symfony2 documentation][3].
|
||||
[Symfony documentation][3].
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
||||
Symfony2 is an open source, community-driven project. If you'd like to contribute,
|
||||
Symfony is an open source, community-driven project. If you'd like to contribute,
|
||||
please read the [Contributing Code][4] part of the documentation. If you're submitting
|
||||
a pull request, please follow the guidelines in the [Submitting a Patch][5] section
|
||||
and use [Pull Request Template][6].
|
||||
|
||||
Running Symfony2 Tests
|
||||
Running Symfony Tests
|
||||
----------------------
|
||||
|
||||
Information on how to run the Symfony2 test suite can be found in the
|
||||
[Running Symfony2 Tests][7] section.
|
||||
Information on how to run the Symfony test suite can be found in the
|
||||
[Running Symfony Tests][7] section.
|
||||
|
||||
[1]: http://symfony.com/download
|
||||
[2]: http://symfony.com/get_started
|
||||
|
@ -2,7 +2,7 @@ Doctrine Bridge
|
||||
===============
|
||||
|
||||
Provides integration for [Doctrine](http://www.doctrine-project.org/) with
|
||||
various Symfony2 components.
|
||||
various Symfony components.
|
||||
|
||||
Resources
|
||||
---------
|
||||
|
@ -1,7 +1,7 @@
|
||||
Monolog Bridge
|
||||
==============
|
||||
|
||||
Provides integration for Monolog with various Symfony2 components.
|
||||
Provides integration for Monolog with various Symfony components.
|
||||
|
||||
Resources
|
||||
---------
|
||||
|
@ -1,7 +1,7 @@
|
||||
Propel Bridge
|
||||
=============
|
||||
|
||||
Provides integration for Propel with various Symfony2 components.
|
||||
Provides integration for Propel with various Symfony components.
|
||||
|
||||
Resources
|
||||
---------
|
||||
|
@ -1,7 +1,7 @@
|
||||
ProxyManager Bridge
|
||||
===================
|
||||
|
||||
Provides integration for [ProxyManager][1] with various Symfony2 components.
|
||||
Provides integration for [ProxyManager][1] with various Symfony components.
|
||||
|
||||
Resources
|
||||
---------
|
||||
|
@ -2,7 +2,7 @@ Twig Bridge
|
||||
===========
|
||||
|
||||
Provides integration for [Twig](http://twig.sensiolabs.org/) with various
|
||||
Symfony2 components.
|
||||
Symfony components.
|
||||
|
||||
Resources
|
||||
---------
|
||||
|
@ -75,13 +75,13 @@ class TranslationExtensionTest extends \PHPUnit_Framework_TestCase
|
||||
return array(
|
||||
// trans tag
|
||||
array('{% trans %}Hello{% endtrans %}', 'Hello'),
|
||||
array('{% trans %}%name%{% endtrans %}', 'Symfony2', array('name' => 'Symfony2')),
|
||||
array('{% trans %}%name%{% endtrans %}', 'Symfony', array('name' => 'Symfony')),
|
||||
|
||||
array('{% trans from elsewhere %}Hello{% endtrans %}', 'Hello'),
|
||||
|
||||
array('{% trans %}Hello %name%{% endtrans %}', 'Hello Symfony2', array('name' => 'Symfony2')),
|
||||
array('{% trans with { \'%name%\': \'Symfony2\' } %}Hello %name%{% endtrans %}', 'Hello Symfony2'),
|
||||
array('{% set vars = { \'%name%\': \'Symfony2\' } %}{% trans with vars %}Hello %name%{% endtrans %}', 'Hello Symfony2'),
|
||||
array('{% trans %}Hello %name%{% endtrans %}', 'Hello Symfony', array('name' => 'Symfony')),
|
||||
array('{% trans with { \'%name%\': \'Symfony\' } %}Hello %name%{% endtrans %}', 'Hello Symfony'),
|
||||
array('{% set vars = { \'%name%\': \'Symfony\' } %}{% trans with vars %}Hello %name%{% endtrans %}', 'Hello Symfony'),
|
||||
|
||||
array('{% trans into "fr"%}Hello{% endtrans %}', 'Hello'),
|
||||
|
||||
@ -91,9 +91,9 @@ class TranslationExtensionTest extends \PHPUnit_Framework_TestCase
|
||||
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
||||
'There is 5 apples', array('count' => 5),),
|
||||
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
|
||||
'There is 5 apples (Symfony2)', array('count' => 5, 'name' => 'Symfony2'),),
|
||||
array('{% transchoice count with { \'%name%\': \'Symfony2\' } %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
|
||||
'There is 5 apples (Symfony2)', array('count' => 5),),
|
||||
'There is 5 apples (Symfony)', array('count' => 5, 'name' => 'Symfony'),),
|
||||
array('{% transchoice count with { \'%name%\': \'Symfony\' } %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
|
||||
'There is 5 apples (Symfony)', array('count' => 5),),
|
||||
array('{% transchoice count into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
||||
'There is no apples', array('count' => 0),),
|
||||
array('{% transchoice 5 into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
||||
@ -101,14 +101,14 @@ class TranslationExtensionTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
// trans filter
|
||||
array('{{ "Hello"|trans }}', 'Hello'),
|
||||
array('{{ name|trans }}', 'Symfony2', array('name' => 'Symfony2')),
|
||||
array('{{ hello|trans({ \'%name%\': \'Symfony2\' }) }}', 'Hello Symfony2', array('hello' => 'Hello %name%')),
|
||||
array('{% set vars = { \'%name%\': \'Symfony2\' } %}{{ hello|trans(vars) }}', 'Hello Symfony2', array('hello' => 'Hello %name%')),
|
||||
array('{{ name|trans }}', 'Symfony', array('name' => 'Symfony')),
|
||||
array('{{ hello|trans({ \'%name%\': \'Symfony\' }) }}', 'Hello Symfony', array('hello' => 'Hello %name%')),
|
||||
array('{% set vars = { \'%name%\': \'Symfony\' } %}{{ hello|trans(vars) }}', 'Hello Symfony', array('hello' => 'Hello %name%')),
|
||||
array('{{ "Hello"|trans({}, "messages", "fr") }}', 'Hello'),
|
||||
|
||||
// transchoice filter
|
||||
array('{{ "{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples"|transchoice(count) }}', 'There is 5 apples', array('count' => 5)),
|
||||
array('{{ text|transchoice(5, {\'%name%\': \'Symfony2\'}) }}', 'There is 5 apples (Symfony2)', array('text' => '{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%)')),
|
||||
array('{{ text|transchoice(5, {\'%name%\': \'Symfony\'}) }}', 'There is 5 apples (Symfony)', array('text' => '{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%)')),
|
||||
array('{{ "{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples"|transchoice(count, {}, "messages", "fr") }}', 'There is 5 apples', array('count' => 5)),
|
||||
);
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ use Symfony\Component\Process\PhpExecutableFinder;
|
||||
use Symfony\Component\Process\ProcessBuilder;
|
||||
|
||||
/**
|
||||
* Runs Symfony2 application using PHP built-in web server.
|
||||
* Runs Symfony application using PHP built-in web server.
|
||||
*
|
||||
* @author Michał Pipa <michal.pipa.xsolve@gmail.com>
|
||||
*/
|
||||
@ -83,12 +83,6 @@ EOF
|
||||
*/
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if (defined('HHVM_VERSION')) {
|
||||
$output->writeln('<error>This command is not supported on HHVM.</error>');
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
$documentRoot = $input->getOption('docroot');
|
||||
|
||||
if (null === $documentRoot) {
|
||||
|
@ -498,7 +498,7 @@ class Configuration implements ConfigurationInterface
|
||||
// API version already during container configuration
|
||||
// (to adjust service classes etc.)
|
||||
// See https://github.com/symfony/symfony/issues/11580
|
||||
$v['validation']['api'] = version_compare(PHP_VERSION, '5.3.9', '<')
|
||||
$v['validation']['api'] = PHP_VERSION_ID < 50309
|
||||
? '2.4'
|
||||
: '2.5-bc';
|
||||
|
||||
|
@ -17,7 +17,7 @@ class JsonDescriptorTest extends AbstractDescriptorTest
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
if (version_compare(phpversion(), '5.4.0', '<')) {
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
$this->markTestSkipped('Test skipped on PHP 5.3 as JSON_PRETTY_PRINT does not exist.');
|
||||
}
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
|
||||
'static_method' => array('loadValidatorMetadata'),
|
||||
'translation_domain' => 'validators',
|
||||
'strict_email' => false,
|
||||
'api' => version_compare(PHP_VERSION, '5.3.9', '<') ? '2.4' : '2.5-bc',
|
||||
'api' => PHP_VERSION_ID < 50309 ? '2.4' : '2.5-bc',
|
||||
),
|
||||
'annotations' => array(
|
||||
'cache' => 'file',
|
||||
|
@ -295,7 +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 (version_compare(PHP_VERSION, '5.3.9', '<')) {
|
||||
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]);
|
||||
@ -448,7 +448,7 @@ abstract class FrameworkExtensionTest extends TestCase
|
||||
$this->assertSame('setApiVersion', $calls[5][0]);
|
||||
// no cache, no annotations
|
||||
|
||||
if (version_compare(PHP_VERSION, '5.3.9', '<')) {
|
||||
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]);
|
||||
@ -472,7 +472,7 @@ abstract class FrameworkExtensionTest extends TestCase
|
||||
$this->assertSame('setApiVersion', $calls[5][0]);
|
||||
// no cache, no annotations
|
||||
|
||||
if (version_compare(PHP_VERSION, '5.3.9', '<')) {
|
||||
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]);
|
||||
|
@ -17,7 +17,7 @@ use Symfony\Component\Templating\TemplateReferenceInterface;
|
||||
|
||||
/**
|
||||
* FilesystemLoader extends the default Twig filesystem loader
|
||||
* to work with the Symfony2 paths and template references.
|
||||
* to work with the Symfony paths and template references.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!-- START of Symfony2 Web Debug Toolbar -->
|
||||
<!-- START of Symfony Web Debug Toolbar -->
|
||||
{% if 'normal' != position %}
|
||||
<div id="sfMiniToolbar-{{ token }}" class="sf-minitoolbar" data-no-turbolink>
|
||||
<a href="javascript:void(0);" title="Show Symfony toolbar" onclick="
|
||||
@ -45,4 +45,4 @@
|
||||
"></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<!-- END of Symfony2 Web Debug Toolbar -->
|
||||
<!-- END of Symfony Web Debug Toolbar -->
|
||||
|
@ -249,7 +249,7 @@ EOF
|
||||
} catch (\Exception $e) {
|
||||
// something nasty happened and we cannot throw an exception anymore
|
||||
if ($this->debug) {
|
||||
$title = sprintf('Exception thrown when handling an exception (%s: %s)', get_class($exception), $exception->getMessage());
|
||||
$title = sprintf('Exception thrown when handling an exception (%s: %s)', get_class($e), $e->getMessage());
|
||||
} else {
|
||||
$title = 'Whoops, looks like something went wrong.';
|
||||
}
|
||||
|
@ -360,6 +360,10 @@ class Container implements IntrospectableContainerInterface
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isset($this->aliases[$id])) {
|
||||
$id = $this->aliases[$id];
|
||||
}
|
||||
|
||||
return isset($this->services[$id]) || array_key_exists($id, $this->services);
|
||||
}
|
||||
|
||||
|
@ -305,6 +305,10 @@ class ContainerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($sc->initialized('foo'), '->initialized() returns true if service is loaded');
|
||||
$this->assertFalse($sc->initialized('foo1'), '->initialized() returns false if service is not loaded');
|
||||
$this->assertFalse($sc->initialized('bar'), '->initialized() returns false if a service is defined, but not currently loaded');
|
||||
$this->assertFalse($sc->initialized('alias'), '->initialized() returns false if an aliased service is not initialized');
|
||||
|
||||
$sc->set('bar', new \stdClass());
|
||||
$this->assertTrue($sc->initialized('alias'), '->initialized() returns true for alias if aliased service is initialized');
|
||||
}
|
||||
|
||||
public function testEnterLeaveCurrentScope()
|
||||
|
@ -1,7 +1,7 @@
|
||||
EventDispatcher Component
|
||||
=========================
|
||||
|
||||
The Symfony2 EventDispatcher component implements the Mediator pattern in a
|
||||
The Symfony EventDispatcher component implements the Mediator pattern in a
|
||||
simple and effective way to make your projects truly extensible.
|
||||
|
||||
```php
|
||||
|
@ -336,7 +336,7 @@ 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'] && version_compare(PHP_VERSION, '5.4.0', '<')) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ class FilePathsIteratorTest extends RealIteratorTestCase
|
||||
|
||||
public function getSubPathData()
|
||||
{
|
||||
$tmpDir = sys_get_temp_dir().'/symfony2_finder';
|
||||
$tmpDir = sys_get_temp_dir().'/symfony_finder';
|
||||
|
||||
return array(
|
||||
array(
|
||||
|
@ -18,7 +18,7 @@ abstract class RealIteratorTestCase extends IteratorTestCase
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
self::$tmpDir = realpath(sys_get_temp_dir()).DIRECTORY_SEPARATOR.'symfony2_finder';
|
||||
self::$tmpDir = realpath(sys_get_temp_dir()).DIRECTORY_SEPARATOR.'symfony_finder';
|
||||
|
||||
self::$files = array(
|
||||
'.git/',
|
||||
@ -74,7 +74,7 @@ abstract class RealIteratorTestCase extends IteratorTestCase
|
||||
* Without the call to setUpBeforeClass() property can be null.
|
||||
*/
|
||||
if (!self::$tmpDir) {
|
||||
self::$tmpDir = realpath(sys_get_temp_dir()).DIRECTORY_SEPARATOR.'symfony2_finder';
|
||||
self::$tmpDir = realpath(sys_get_temp_dir()).DIRECTORY_SEPARATOR.'symfony_finder';
|
||||
}
|
||||
|
||||
if (is_array($files)) {
|
||||
|
@ -14,7 +14,7 @@ namespace Symfony\Component\Form\Extension\Csrf\CsrfProvider;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
|
||||
/**
|
||||
* This provider uses a Symfony2 Session object to retrieve the user's
|
||||
* This provider uses a Symfony Session object to retrieve the user's
|
||||
* session ID.
|
||||
*
|
||||
* @see DefaultCsrfProvider
|
||||
|
@ -20,7 +20,7 @@ use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
use Symfony\Component\Validator\ValidatorInterface as LegacyValidatorInterface;
|
||||
|
||||
/**
|
||||
* Extension supporting the Symfony2 Validator component in forms.
|
||||
* Extension supporting the Symfony Validator component in forms.
|
||||
*
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
*/
|
||||
|
@ -49,7 +49,7 @@ class FormConfigTest extends \PHPUnit_Framework_TestCase
|
||||
array('9', true),
|
||||
// Contrary to the HTML4 spec, we allow names starting with an
|
||||
// underscore, since this is already a widely used practice in
|
||||
// Symfony2.
|
||||
// Symfony.
|
||||
// For root forms, leading underscores will be stripped from the
|
||||
// "id" attribute to produce valid HTML4.
|
||||
array('_', true),
|
||||
|
@ -15,7 +15,7 @@ use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler;
|
||||
|
||||
/**
|
||||
* Allows session to be started by PHP and managed by Symfony2
|
||||
* Allows session to be started by PHP and managed by Symfony
|
||||
*
|
||||
* @author Drak <drak@zikula.org>
|
||||
*/
|
||||
|
@ -136,7 +136,7 @@ class SessionTest extends \PHPUnit_Framework_TestCase
|
||||
return array(
|
||||
array('foo', 'bar', array('foo' => 'bar')),
|
||||
array('foo.bar', 'too much beer', array('foo.bar' => 'too much beer')),
|
||||
array('great', 'symfony2 is great', array('great' => 'symfony2 is great')),
|
||||
array('great', 'symfony is great', array('great' => 'symfony is great')),
|
||||
);
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ class SessionTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testGetIterator()
|
||||
{
|
||||
$attributes = array('hello' => 'world', 'symfony2' => 'rocks');
|
||||
$attributes = array('hello' => 'world', 'symfony' => 'rocks');
|
||||
foreach ($attributes as $key => $val) {
|
||||
$this->session->set($key, $val);
|
||||
}
|
||||
@ -215,7 +215,7 @@ class SessionTest extends \PHPUnit_Framework_TestCase
|
||||
public function testGetCount()
|
||||
{
|
||||
$this->session->set('hello', 'world');
|
||||
$this->session->set('symfony2', 'rocks');
|
||||
$this->session->set('symfony', 'rocks');
|
||||
|
||||
$this->assertCount(2, $this->session);
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ class NativeSessionStorageTest extends \PHPUnit_Framework_TestCase
|
||||
$options = array(
|
||||
'cookie_lifetime' => 123456,
|
||||
'cookie_path' => '/my/cookie/path',
|
||||
'cookie_domain' => 'symfony2.example.com',
|
||||
'cookie_domain' => 'symfony.example.com',
|
||||
'cookie_secure' => true,
|
||||
'cookie_httponly' => false,
|
||||
);
|
||||
|
@ -4,7 +4,7 @@ HttpKernel Component
|
||||
HttpKernel provides the building blocks to create flexible and fast HTTP-based
|
||||
frameworks.
|
||||
|
||||
``HttpKernelInterface`` is the core interface of the Symfony2 full-stack
|
||||
``HttpKernelInterface`` is the core interface of the Symfony full-stack
|
||||
framework:
|
||||
|
||||
```php
|
||||
@ -23,11 +23,11 @@ interface HttpKernelInterface
|
||||
|
||||
It takes a ``Request`` as an input and should return a ``Response`` as an
|
||||
output. Using this interface makes your code compatible with all frameworks
|
||||
using the Symfony2 components. And this will give you many cool features for
|
||||
using the Symfony components. And this will give you many cool features for
|
||||
free.
|
||||
|
||||
Creating a framework based on the Symfony2 components is really easy. Here is
|
||||
a very simple, but fully-featured framework based on the Symfony2 components:
|
||||
Creating a framework based on the Symfony components is really easy. Here is
|
||||
a very simple, but fully-featured framework based on the Symfony components:
|
||||
|
||||
```php
|
||||
$routes = new RouteCollection();
|
||||
@ -54,7 +54,7 @@ $kernel = new HttpKernel($dispatcher, $resolver);
|
||||
$kernel->handle($request)->send();
|
||||
```
|
||||
|
||||
This is all you need to create a flexible framework with the Symfony2
|
||||
This is all you need to create a flexible framework with the Symfony
|
||||
components.
|
||||
|
||||
Want to add an HTTP reverse proxy and benefit from HTTP caching and Edge Side
|
||||
|
@ -88,4 +88,4 @@ Once it is, the following steps have to be followed to build the .dat-file:
|
||||
|
||||
$ rm -rf build packagelist.txt
|
||||
|
||||
3. You can now move region.dat to replace the version bundled with Symfony2.
|
||||
3. You can now move region.dat to replace the version bundled with Symfony.
|
||||
|
@ -38,7 +38,7 @@ if ($argc > 3 || 2 === $argc && '-h' === $argv[1]) {
|
||||
bailout(<<<MESSAGE
|
||||
Usage: php update-icu-component.php <path/to/icu/source> <path/to/icu/build>
|
||||
|
||||
Updates the ICU data for Symfony2 to the latest version of ICU.
|
||||
Updates the ICU data for Symfony to the latest version of ICU.
|
||||
|
||||
If you downloaded the SVN repository before, you can pass the path to the
|
||||
repository source in the first optional argument.
|
||||
|
@ -51,7 +51,7 @@ class NativeSessionTokenStorageTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testStoreTokenInClosedSessionWithExistingSessionId()
|
||||
{
|
||||
if (version_compare(PHP_VERSION, '5.4', '<')) {
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
$this->markTestSkipped('This test requires PHP 5.4 or later.');
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ class NativeSessionTokenStorage implements TokenStorageInterface
|
||||
|
||||
private function startSession()
|
||||
{
|
||||
if (version_compare(PHP_VERSION, '5.4', '>=')) {
|
||||
if (PHP_VERSION_ID >= 50400) {
|
||||
if (PHP_SESSION_NONE === session_status()) {
|
||||
session_start();
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ class JsonFileDumperTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testDump()
|
||||
{
|
||||
if (version_compare(PHP_VERSION, '5.4.0', '<')) {
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
$this->markTestIncomplete('PHP below 5.4 doesn\'t support JSON pretty printing');
|
||||
}
|
||||
|
||||
|
@ -74,8 +74,8 @@ class IdentityTranslatorTest extends \PHPUnit_Framework_TestCase
|
||||
public function getTransTests()
|
||||
{
|
||||
return array(
|
||||
array('Symfony2 is great!', 'Symfony2 is great!', array()),
|
||||
array('Symfony2 is awesome!', 'Symfony2 is %what%!', array('%what%' => 'awesome')),
|
||||
array('Symfony is great!', 'Symfony is great!', array()),
|
||||
array('Symfony is awesome!', 'Symfony is %what%!', array('%what%' => 'awesome')),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -356,18 +356,18 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase
|
||||
public function getTransTests()
|
||||
{
|
||||
return array(
|
||||
array('Symfony2 est super !', 'Symfony2 is great!', 'Symfony2 est super !', array(), 'fr', ''),
|
||||
array('Symfony2 est awesome !', 'Symfony2 is %what%!', 'Symfony2 est %what% !', array('%what%' => 'awesome'), 'fr', ''),
|
||||
array('Symfony2 est super !', new String('Symfony2 is great!'), 'Symfony2 est super !', array(), 'fr', ''),
|
||||
array('Symfony est super !', 'Symfony is great!', 'Symfony est super !', array(), 'fr', ''),
|
||||
array('Symfony est awesome !', 'Symfony is %what%!', 'Symfony est %what% !', array('%what%' => 'awesome'), 'fr', ''),
|
||||
array('Symfony est super !', new String('Symfony is great!'), 'Symfony est super !', array(), 'fr', ''),
|
||||
);
|
||||
}
|
||||
|
||||
public function getFlattenedTransTests()
|
||||
{
|
||||
$messages = array(
|
||||
'symfony2' => array(
|
||||
'symfony' => array(
|
||||
'is' => array(
|
||||
'great' => 'Symfony2 est super!',
|
||||
'great' => 'Symfony est super!',
|
||||
),
|
||||
),
|
||||
'foo' => array(
|
||||
@ -379,7 +379,7 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
|
||||
return array(
|
||||
array('Symfony2 est super!', $messages, 'symfony2.is.great'),
|
||||
array('Symfony est super!', $messages, 'symfony.is.great'),
|
||||
array('Foo Bar Baz', $messages, 'foo.bar.baz'),
|
||||
array('Foo Baz', $messages, 'foo.baz'),
|
||||
);
|
||||
|
@ -1,3 +1,3 @@
|
||||
en{
|
||||
symfony{"Symfony 2 is great"}
|
||||
symfony{"Symfony is great"}
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
fr{
|
||||
symfony{"Symfony 2 est génial"}
|
||||
symfony{"Symfony est génial"}
|
||||
}
|
@ -21,7 +21,7 @@ class LegacyValidator2Dot5ApiTest extends Abstract2Dot5ApiTest
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
if (version_compare(PHP_VERSION, '5.3.9', '<')) {
|
||||
if (PHP_VERSION_ID < 50309) {
|
||||
$this->markTestSkipped('Not supported prior to PHP 5.3.9');
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ class LegacyValidatorLegacyApiTest extends AbstractLegacyApiTest
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
if (version_compare(PHP_VERSION, '5.3.9', '<')) {
|
||||
if (PHP_VERSION_ID < 50309) {
|
||||
$this->markTestSkipped('Not supported prior to PHP 5.3.9');
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ class ValidatorBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testDefaultApiVersion()
|
||||
{
|
||||
if (version_compare(PHP_VERSION, '5.3.9', '<')) {
|
||||
if (PHP_VERSION_ID < 50309) {
|
||||
// Old implementation on PHP < 5.3.9
|
||||
$this->assertInstanceOf('Symfony\Component\Validator\Validator', $this->builder->getValidator());
|
||||
} else {
|
||||
@ -135,7 +135,7 @@ class ValidatorBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testSetApiVersion24And25()
|
||||
{
|
||||
if (version_compare(PHP_VERSION, '5.3.9', '<')) {
|
||||
if (PHP_VERSION_ID < 50309) {
|
||||
$this->markTestSkipped('Not supported prior to PHP 5.3.9');
|
||||
}
|
||||
|
||||
|
@ -325,7 +325,7 @@ class ValidatorBuilder implements ValidatorBuilderInterface
|
||||
));
|
||||
}
|
||||
|
||||
if (version_compare(PHP_VERSION, '5.3.9', '<') && $apiVersion === Validation::API_VERSION_2_5_BC) {
|
||||
if (PHP_VERSION_ID < 50309 && $apiVersion === Validation::API_VERSION_2_5_BC) {
|
||||
throw new InvalidArgumentException(sprintf(
|
||||
'The Validator API that is compatible with both Symfony 2.4 '.
|
||||
'and Symfony 2.5 can only be used on PHP 5.3.9 and higher. '.
|
||||
@ -385,7 +385,7 @@ class ValidatorBuilder implements ValidatorBuilderInterface
|
||||
$apiVersion = $this->apiVersion;
|
||||
|
||||
if (null === $apiVersion) {
|
||||
$apiVersion = version_compare(PHP_VERSION, '5.3.9', '<')
|
||||
$apiVersion = PHP_VERSION_ID < 50309
|
||||
? Validation::API_VERSION_2_4
|
||||
: Validation::API_VERSION_2_5_BC;
|
||||
}
|
||||
|
Reference in New Issue
Block a user