eZecosystem / Mirror / Symfony Blog

Contributed by
Nicolas Grekas
in #28447 and #28446.

In PHP, setting the secure parameter to true in the setcookie() or session_set_cookie_params() functions make cookies to be sent only when the connection is secure and uses HTTPS.

In Symfony applications you can control this behavior with the framework.session.cookie_secure option, which is a boolean that defaults to false. In order to improve the application security, in Symfony 4.2 we made cookies secure automatically.

The new default value of the cookie_secure option is null, which makes cookies secure when the request is using HTTPS and doesn't modify them when the request uses HTTP. The new behavior is a good balance between making your app "safe by default" and not breaking any existing app.

Related to this, the cookie used in the Remember Me feature now inherits the default config used in the framework.session.cookie_* options, so the new auto-secure behavior also applies to it.

In Symfony 5.0, to be released in November 2019, the default value of the $secure argument of the Cookie class constructor will change from false to null. In addition, the default value of the $samesite argument will change from null to lax to use the new SameSite cookie configuration.


Be trained by Symfony experts - 2018-10-15 Paris - 2018-10-15 Paris - 2018-10-17 Paris
10/12/2018 05:13 am   Symfony Blog   Mirror   Link  

It’s with a great pleasure that we’ll meet the North American Symfony community in San Francisco during 2 great days of conference on October 11th and 12th. We have the pleasure to welcome 13 fabulous speakers at the Symfony Loves PHP conference, formerly called SymfonyLive USA! We changed our conference name and focus to enable both communities to meet and make sure our attendees will get the most out of Symfony and PHP latest news at the same place. We have the great pleasure to count among our great speakers several Symfony Core Team members and very well-known PHP community members, so this will be the right place to be if you want to learn all the latest with Symfony and PHP! We hope you’ll enjoy this new conference format and can’t wait to meet you there!

We’d like to address a particular thank you to all our amazing conference speakers for sharing their experience, best practices and real use cases with Symfony and PHP at the conference! We’d like to thank Fabien Potencier, Jeremy Mikola, Tugdual Saunier, Jonathan Johnson, Michael Cullum, Kristen Costagliola, Ryan Weaver, Cal Evans, Nicolas Grekas, Jonathan Wage, David Stokes, Samuel Roze and Jordi Boggiano, thank you very much for speaking at the conference!

We also would like to thank all our sponsors for their support and involvement with the conference:

Thanks again for teaming with us and pulling together an awesome conference experience for everyone!

Stay tuned as we have a great announce for the North American community coming next week! And of course enjoy the conference!


Be trained by Symfony experts - 2018-10-15 Paris - 2018-10-15 Paris - 2018-10-17 Paris
10/11/2018 10:04 am   Symfony Blog   Mirror   Link  

Contributed by
Christian Flothmann
in #24530.

Form type extensions allow you to modify any existing form field types. They are used to add a specific feature to a single form type (e.g. adding a "download" feature to the FileType field type) and to add a generic feature to several field types at once.

In Symfony 4.2 we've improved form type extensions to simplify their config and to allow them to extend multiple types.

Simpler configuration

In previous Symfony versions, Form type extensions define the getExtendedType() method to tell which form type they are extending:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
namespace App\Form\Extension;

use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\Extension\Core\Type\FileType;

class ImageTypeExtension extends AbstractTypeExtension
{
    // ...

    public function getExtendedType()
    {
        return FileType::class;
    }
}

Before using them, you had to register those classes as services and apply the form.type_extension service tag to them. Unfortunately, you also needed to repeat the extended form type in the service declaration:

1
2
3
4
5
6
7
8
# config/services.yaml
services:
    # ...

    App\Form\Extension\ImageTypeExtension:
        tags:
            - { name: form.type_extension,
                extended_type: Symfony\Component\Form\Extension\Core\Type\FileType }

This repetition is cumbersome, so we improved it and in Symfony 4.2, form type extensions no longer require any service configuration. First, replace the getExtendedType() method by a new static method called getExtendedTypes():

1
2
3
4
5
6
7
8
9
class ImageTypeExtension extends AbstractTypeExtension
{
    // ...

    public static function getExtendedTypes(): iterable
    {
        return [FileType::class];
    }
}

Second, if the app has enabled the service autoconfiguration feature, Symfony will apply the form.type_extension tag automatically to any service whose class implements FormTypeExtensionInterface::class.

Thanks to the new static method and the automatic tag, you no longer need to configure anything for your form type extensions. Creating the form type extension class is all you need to do.

Extending multiple form types

A side improvement provided by the new getExtendedTypes() method is that you can now extend multiple types with a single extension class, instead of having to create one extension class per form type.

The value returned by this method is of type iterable, so you can return a traditional array or be more creative if needed:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
class DateTimeExtension extends AbstractTypeExtension
{
    // ...

    public static function getExtendedTypes(): iterable
    {
        yield DateTimeType::class;
        yield DateType::class;
        yield TimeType::class;
    }
}

Not implementing the static getExtendedTypes() method when implementing FormTypeExtensionInterface is deprecated since Symfony 4.2. The method will be added to the interface in 5.0.


Be trained by Symfony experts - 2018-10-15 Paris - 2018-10-15 Paris - 2018-10-17 Paris
10/10/2018 06:01 am   Symfony Blog   Mirror   Link  

Last week, we announced the dates of the next edition of the French SymfonyLive conference, March 28-29. Today we're very pleased to announce that the conference website is now online! Early bird registration is open as well as the Call For Papers. You can start submit your talk proposals (in French) for the conference. CFP will be open until December 17th (included). We encourage you to submit several talk proposals to increase your chances of selection. All the CFP criteria are available on the conference website. All the talk proposals will be studied regardless of your ethnic origin, gender identity, religion, sexual orientation... You never spoke at a conference before? That's neither a criterion of selection. If you never spoke at a conference before and you are selected to speak at the conference, we'll help you and work with you on your talk, slides; we'll organize rehearsals... We have a speaker mentoring program for unexperienced and experienced speakers and we'd be pleased to help you with your talk!

Early bird registration is open until December 17th (included). You can register for the 2 days of conference on March 28-29 for 239€ (breakfast, lunch, food for both days and your free conference t-shirt are included)! We organize pre-conference workshops on March 26-27, the workshops' topics will be announced soon, stay tuned!

We are also very pleased to announce that all the videos from SymfonyLive Paris 2018 edition are now online on our YouTube channel. Watch all the talks from the last edition!

We can't wait to meet the French Symfony community at SymfonyLive Paris 2019! Stay tuned for more information about our pre-conference workshops soon!


La semaine dernière, nous avons annoncé les dates de la prochaine édition de la conférence SymfonyLive Paris, les 28 et 29 mars 2019. Aujourd'hui, nous sommes ravis de vous annoncer que le site de la conférence est désormais en ligne ! Les inscriptions early bird sont ouvertes ainsi que le Call For Papers. Vous pouvez dès à présent soumettre vos propositions de sujet (en français) pour la conférence. Le CFP est ouvert jusqu'au 17 décembre (inclus). Nous vous encourageons à soumettre plusieurs propositions de sujets pour augmenter vos chances de sélection. Tous les critères relatifs au CFP sont disponibles sur le site de la conférence. Toutes les propositions de sujet seront étudiées, peu importe votre origine ethnique, genre, religion, orientation sexuelle... Vous n'avez jamais été speaker ? Ce n'est pas non plus un critère de sélection ! Si vous n'avez jamais été speaker auparavant et que vous êtes choisi pour être speaker de la conférence, nous aurons le plaisir de vous aider à construire votre sujet, vos slides ; nous pourrons également organiser des répétitions... Nous avons créé un programme de mentoring pour aider tous les speakers (débutants et confirmés) et nous serions ravis de pouvoir vous aider si vous rencontrez la moindre difficulté avec votre sujet.

Les inscriptions early bird sont ouvertes jusqu'au 17 décembre (inclus). Vous pouvez vous inscrire pour les 2 journées de conférence des 28 et 29 mars pour 239€ (les petits-déjeuners, déjeuners et boissons pour chaque journée de conférence ainsi que votre t-shirt officiel de la conférence sont inclus) ! Nous organisons des formations pré-conférence les 26 et 27 mars, les sujets des formations seront annoncés très prochainement, ne les manquez pas !

Nous sommes également très heureux de vous annoncer que toutes les vidéos du SymfonyLive Paris 2018 sont désormais en ligne sur notre chaîne YouTube. Regardez dès à présent toutes les vidéos de la dernière édition de la conférence !

Nous avons hâte de retrouver la communauté francophone de Symfony au SymfonyLive Paris 2019 ! Restez à l'écoute pour ne pas manquer les informations sur nos formations pré-conférence !


Be trained by Symfony experts - 2018-10-10 Clichy - 2018-10-15 Paris - 2018-10-15 Paris
10/08/2018 08:21 am   Symfony Blog   Mirror   Link  

This week, Symfony 3.4.17 and 4.1.6 maintenance versions were released. Meanwhile, we continued deprecating features in preparation for the upcoming Symfony 4.2 version, such as simple_preauth and simple_form and the "--env" and "--no-debug" console options. Lastly, next week the Symfony Loves PHP USA 2018 conference will gather the American Symfony and PHP communities in San Francisco to learn about the latest and best developments with Symfony and PHP.

Symfony development highlights

2.8 changelog:

3.4 changelog:

  • 22aec24: [DependencyInjection] fixed error in dumped container
  • 8e1f381: [DependencyInjection] fixed dumping setters before their inlined instances
  • 636eb9e: [Finder] fixed root directory access for ftp/sftp wrapper

4.1 changelog:

  • 3ae327c: [FrameworkBundle] don't suggest hidden services in debug:container and debug:autowire commands
  • b1f462f: [Console] fixed clearing sections containing questions

Master changelog:

  • 9610d10: [Form] added a cause when a CSRF error has occurred
  • 38655bd: [Cache] added RedisClusterProxy to create lazy connections to Redis clusters
  • 3b604ff: [Validator] pre-check constraint validator dependencies
  • 104e922: [DependencyInjection] improved ServiceLocatorTagPass service matching
  • 679f8d9: [Translation] marked getFallbackLocales() as internal
  • 7cc7c71: [Security] deprecated simple_preauth and simple_form in favor of Guard
  • 64727c1: [FrameworkBundle] deprecated the "--env" and "--no-debug" console options
  • 5a0cad2: [Serializer] object class resolver
  • 3e7b029: [Serialized] allowed configuring the serialized name of properties through metadata
  • e0cb452: [WebServerBundle] deprecated relying on --env in server:start and server:run

Newest issues and pull requests

They talked about us

Upcoming Symfony Events

Call to Action


Be trained by Symfony experts - 2018-10-10 Clichy - 2018-10-15 Paris - 2018-10-15 Paris
10/07/2018 04:32 am   Symfony Blog   Mirror   Link  

The Symfony Translation component provides tools to internationalize your PHP applications. One of those tools is the transChoice() method to select a translation based on a number, which is ideal for taking care of pluralization.

However, that method uses a proprietary format to define the translations and it doesn't allow to select messages based on other conditions (for example the gender of a person).

Meanwhile, the MessageFormat created by the ICU project is a standard used in lots of applications and supports many more features. That's why Symfony 4.2 introduces an IntlMessageFormatter as a better replacement of transChoice().

The full MessageFormat format guide is intimidating at first because of all the features it supports. The following example selects the translation based on the gender and a number:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use Symfony\Component\Translation\Formatter\IntlMessageFormatter;

$translation = <<<'_TRANSLATION_'
{gender_of_host, select,
  female {{num_guests, plural, offset:1
      =0 {{host} does not give a party.}
      =1 {{host} invites {guest} to her party.}
      =2 {{host} invites {guest} and one other person to her party.}
     other {{host} invites {guest} as one of the # people invited to her party.}}}
  male   {{num_guests, plural, offset:1
      =0 {{host} does not give a party.}
      =1 {{host} invites {guest} to his party.}
      =2 {{host} invites {guest} and one other person to his party.}
     other {{host} invites {guest} as one of the # people invited to his party.}}}
  other {{num_guests, plural, offset:1
      =0 {{host} does not give a party.}
      =1 {{host} invites {guest} to their party.}
      =2 {{host} invites {guest} and one other person to their party.}
     other {{host} invites {guest} as one of the # people invited to their party.}}}}
_TRANSLATION_;

$message = (new IntlMessageFormatter())->format($translation, 'en', [
    'gender_of_host' => 'male',
    'num_guests' => 10,
    'host' => 'Jon',
    'guest' => 'Jane',
]);
// $message = 'Jon invites Jane as one of the 9 people invited to his party.'

The next step will be to deprecate the old way to select translations, deprecate the transChoice() method and maybe provide a script to convert the old format into the new one automatically.


Be trained by Symfony experts - 2018-10-10 Clichy - 2018-10-15 Paris - 2018-10-15 Paris
10/05/2018 09:23 am   Symfony Blog   Mirror   Link  

SymfonyLive Paris 2019 Conference Logo

The French SymfonyLive conference will be back next year in Paris on March 28th-29th. We’ll meet the French Symfony community in our favorite venue, the Cité Internationale Universitaire of Paris, for 2 days of conference, experience sharing, networking, meetings and fun! Next year will be the 11th edition of the conference in Paris, time is really flying!

Pre-conference workshops will be organized on March 26th-27th, several workshops will be offered.

Stay tuned as both the website and the registration will be online soon. The CFP will also open as soon as the website is online. If you already have talk proposals (in French) in mind, write them down to keep them for the CFP.

We can’t wait to meet the French community at SymfonyLive Paris 2019, next March 28th-29th.

Note: The entire conference will be held in French.


Les dates de la prochaine conférence francophone SymfonyLive sont annoncées : rendez-vous les 28 et 29 mars 2019 pour le SymfonyLive Paris 2019. Nous aurons le plaisir de rencontrer la communauté francophone de Symfony à la Cité Internationale Universitaire de Paris, lieu magnifique où nous avons l’habitude d’organiser la conférence de Paris, pour 2 jours de conférences, de partage de connaissances et d’expérience, de networking, de rencontres et aussi de fun ! Nous organiserons l’année prochaine la 11e édition de la conférence à Paris, le temps passe vraiment vite !

Les formations pré-conférence seront organisées les 26 et 27 mars, plusieurs formations seront proposées.

Le site de la conférence sera en ligne très prochainement et les inscriptions ainsi que le Call for Papers seront ouverts dès que le site sera en ligne. Si vous avez déjà des idées de sujet à soumettre, notez-les quelque part pour les garder pour le CFP.

Nous avons hâte de retrouver la communauté francophone de Symfony au SymfonyLive Paris 2019, les 28 et 29 mars prochains, pour une nouvelle édition de la conférence qui promet de belles surprises… Restez à l’écoute pour ne pas manquer les prochaines informations relatives à la conférence parisienne !

A très vite !

Note : L’intégralité de l'événement parisien se déroule en français.


Be trained by Symfony experts - 2018-10-10 Clichy - 2018-10-15 Paris - 2018-10-15 Paris
10/04/2018 03:59 am   Symfony Blog   Mirror   Link  

Introduced in November 2011, SensioLabsConnect is the social network for the Symfony community. It provides authentication for Symfony related services like SymfonyInsight and SymfonyCasts and it rewards users with badges for their actions (such as a badge for contributing to the docs, a badge for attending a conference, or a badge for being certified, etc.)

Today, SensioLabsConnect has more than 80,000 registered users and almost 300,000 badges have been awarded so far. Fun fact: 88 users have more than 12 years of Symfony history.

SensioLabs originally developed the service to gamify the community, and it worked really well. A few months ago, the Symfony project became an independent company. We've decided to rename SensioLabsConnect as SymfonyConnect to better reflect that Connect is the Symfony social network of choice.

All the existing features (and all your hard-earned badges) will remain the same, because we are only changing the name of the service. All previous links will keep working too, but you should update your bookmarks and links.

SensioLabs is still the main sponsor of the Symfony project, but now more focused on providing solutions based on Symfony and PHP. We are glad that they are an active part of the Symfony community and help us drive the project forward.

Time for Symfony to show that it can grow on its own.

Besides symfony.com, the Symfony family now includes:


Be trained by Symfony experts - 2018-10-10 Clichy - 2018-10-15 Paris - 2018-10-15 Paris
10/03/2018 08:47 am   Symfony Blog   Mirror   Link  

Symfony 4.1.6 has just been released. Here is a list of the most important changes:

  • bug #28604 [Finder] fixed root directory access for ftp/sftp wrapper (@DerDu)
  • bug #28688 [FWBundle] Throw if PropertyInfo is enabled, but the component isn't installed (@dunglas)
  • bug #28638 [Console] Fix clearing sections containing questions (@chalasr)
  • bug #28690 [FrameworkBundle] dont suggest hidden services in debug:container and debug:autow commands (@nicolas-grekas)
  • bug #28648 [PHPUnitBridge] Fix ClockMock microtime() format (@acasademont)
  • bug #28678 [DI] fix dumping setters before their inlined instances (@nicolas-grekas)
  • bug #28672 [DI] fix error in dumped container (@nicolas-grekas)
  • bug #28664 [Console] Don't return early as this bypasses the auto exit feature (@duncan3dc)

Want to upgrade to this new release? Fortunately, because Symfony protects backwards-compatibility very closely, this should be quite easy. Read our upgrade documentation to learn more.

Want to be notified whenever a new Symfony release is published? Or when a version is not maintained anymore? Or only when a security issue is fixed? Consider subscribing to the Symfony Roadmap Notifications.


Be trained by Symfony experts - 2018-10-10 Clichy - 2018-10-15 Paris - 2018-10-15 Paris
10/03/2018 08:29 am   Symfony Blog   Mirror   Link  

Symfony 3.4.17 has just been released. Here is a list of the most important changes:

  • bug #28604 [Finder] fixed root directory access for ftp/sftp wrapper (@DerDu)
  • bug #28688 [FWBundle] Throw if PropertyInfo is enabled, but the component isn't installed (@dunglas)
  • bug #28648 [PHPUnitBridge] Fix ClockMock microtime() format (@acasademont)
  • bug #28678 [DI] fix dumping setters before their inlined instances (@nicolas-grekas)
  • bug #28672 [DI] fix error in dumped container (@nicolas-grekas)
  • bug #28664 [Console] Don't return early as this bypasses the auto exit feature (@duncan3dc)

Want to upgrade to this new release? Fortunately, because Symfony protects backwards-compatibility very closely, this should be quite easy. Read our upgrade documentation to learn more.

Want to be notified whenever a new Symfony release is published? Or when a version is not maintained anymore? Or only when a security issue is fixed? Consider subscribing to the Symfony Roadmap Notifications.


Be trained by Symfony experts - 2018-10-10 Clichy - 2018-10-15 Paris - 2018-10-15 Paris
10/03/2018 07:50 am   Symfony Blog   Mirror   Link  

This week Symfony 2.8.46, 3.4.16 and 4.1.5 maintenance versions were released. Meanwhile, the upcoming Symfony 4.2 version added an Instantiator::instantiate() method to create and populate objects without calling their constructors and made cookies auto-secure. Lastly, a new Symfony Mailer component was introduced during the SymfonyLive London 2018 conference and will be published in the coming weeks.

Symfony development highlights

2.8 changelog:

  • c9bbc66: [HttpFoundation, Security] forward locale and format to subrequests
  • 2e85ef5: [TwigBundle] fixed caching of templates in src/Resources//views on cache warmup

3.4 changelog:

  • 2a605c2: [Cache] prevent getting older entries when the version key is evicted

4.1 changelog:

  • 0997ff5: [HttpFoundation] X-Accel-Mapping does not use HTTP key=value syntax

Master changelog:

  • 792ec82: [Form] deprecated the unused scale option
  • 31f8cb9: [Form] deprecated precision in IntegerToLocalizedStringTransformer
  • 9db435e: [Serializer] deprecated normalizers and encoders which don't implement the base interfaces
  • b36172c: [VarExporter] added Instantiator::instantiate() to create and populate objects without calling their constructor nor any other methods
  • 10df10c: [SecurityBundle] made remember-me cookies auto-secure and inherit their default config from framework session cookies
  • 60fac5c: [HttpFoundation] made cookies auto-secure when passing them $secure=null
  • e6deb09: [Cache] support configuring multiple Memcached servers in one DSN
  • 3cd411a: [Cache] added setCallbackWrapper() on adapters implementing CacheInterface for more flexibility
  • 3afe4e7: [BrowserKit] throw exception when request() wasn't called
  • 91add60: [Validator] added BC layer covering BicValidator without Intl

Newest issues and pull requests

They talked about us

Upcoming Symfony Events

Call to Action


Be trained by Symfony experts - 2018-10-10 Clichy - 2018-10-15 Paris - 2018-10-15 Paris
09/30/2018 03:35 am   Symfony Blog   Mirror   Link  

Contributed by
Nicolas Grekas
in #28231.

In Symfony applications, the VarDumper component provides a dump() function as a better alternative to PHP's var_dump() function. In Symfony 4.2, we're introducing a new VarExporter component to provide a better alternative to PHP's var_export() function.

The var_export() function outputs or returns a parsable string representation of a variable. It is similar to var_dump() with one exception: the returned representation is valid PHP code. Symfony's export() function is similar, but adds lots of useful features to it.

Consider the following example, where a simple array is exported:

1
2
$data = array(123, array('abc'));
$result = VarExporter::export($data);

The output is similar to what you'd expect when using var_export(), although export() generates valid and PSR-2 compliant PHP code:

1
2
3
4
5
6
7
8
<?php

return [
    123,
    [
        'abc',
    ],
];

The main difference is that export(), unlike var_export() preserves all the semantics associated with the serialization mechanism of PHP (__wakeup, __sleep, Serializable). Consider this example of a class implementing Serializable:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
class MySerializable implements \Serializable
{
    public function serialize()
    {
        return '123';
    }

    public function unserialize($data)
    {
        // do nothing
    }
}

$data = array(new MySerializable(), new MySerializable());
$result = VarExporter::export($data);

The result looks like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
<?php

return \Symfony\Component\VarExporter\Internal\Configurator::pop(
    \Symfony\Component\VarExporter\Internal\Registry::push([], [], [
        'C:50:"Symfony\\Component\\VarExporter\\Tests\\MySerializable":3:{123}',
    ]),
    null,
    [],
    [
        \Symfony\Component\VarExporter\Internal\Registry::$objects[0],
        \Symfony\Component\VarExporter\Internal\Registry::$objects[0],
    ],
    []
);

In addition to producing better results, if your application uses OPcache, Symfony's export() function is faster and more memory efficient than serialize() and even igbinary.

Finally, Symfony's export() function includes other improvements over var_export() and serialize():

  • The generated output can be re-indented without messing up with \r or \n in the data;

  • Missing classes throw a ReflectionException instead of being unserialized to PHP_Incomplete_Class objects;

  • References involving SplObjectStorage, ArrayObject or ArrayIterator

    instances are preserved;

  • Reflection*, IteratorIterator and RecursiveIteratorIterator classes

    throw an exception when being serialized.


Be trained by Symfony experts - 2018-10-1 Paris - 2018-10-1 Paris - 2018-10-3 Paris
09/27/2018 06:56 am   Symfony Blog   Mirror   Link  

Symfony added support for SameSite cookie attributes in Symfony 3.2 (November 2016). The SameSite attribute prevents the browser from sending cookies along with cross-site requests. In practice, this mitigates the risk of cross-origin information leakage and provides some protection against CSRF attacks.

In Symfony 4.2 we've made it easier to set this attribute in several parts of the framework.

SameSite attribute in "Remember Me"

Contributed by
Kévin Dunglas
in #27976.

The Remember Me feature now defines a new config option called samesite to set the value of this attribute in the cookie used by this feature:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# config/packages/security.yaml
security:
    # ...

    firewalls:
        main:
            # ...
            remember_me:
                # ...

                # possible values: 'strict', 'lax' and null
                samesite: 'strict'

SameSite attribute in sessions

Contributed by
Remon van de Kamp
in #28168.

Similarly, the cookies used to manage user sessions now define a new config option called cookie_samesite with the same possible values (strict, lax and null):

1
2
3
4
5
6
# config/packages/framework.yaml
framework:
    # ...
    session:
        # ...
        cookie_samesite: 'strict'

Be trained by Symfony experts - 2018-10-1 Paris - 2018-10-1 Paris - 2018-10-3 Paris
09/26/2018 06:28 am   Symfony Blog   Mirror   Link  

Using tables to display tabular contents in console commands are one of the most popular features of the Console component. In Symfony 4.2 we improved them with new features to display titles and set their maximum column width.

Adding titles to tables

Contributed by
Dany Maillard
in #26933.

In Symfony 4.2 tables can now display a title both at the top and the bottom of its contents with the setHeaderTitle() and setFooterTitle() methods, which is ideal for complex or paginated tables:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
use Symfony\Component\Console\Helper\Table;
 // ...

$table = new Table($output);
$table
    ->setHeaderTitle('Books')
    ->setFooterTitle('Page 1/2')
    ->setHeaders(['ISBN', 'Title', 'Author'])
    ->setRows([
        ['99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'],
        // ...
    ])
;
$table->render();

This is how the above example would look in your terminal:

1
2
3
4
5
6
7
8
+---------------+----------- Books --------+------------------+
| ISBN          | Title                    | Author           |
+---------------+--------------------------+------------------+
| 99921-58-10-7 | Divine Comedy            | Dante Alighieri  |
| 9971-5-0210-0 | A Tale of Two Cities     | Charles Dickens  |
| 960-425-059-0 | The Lord of the Rings    | J. R. R. Tolkien |
| 80-902734-1-6 | And Then There Were None | Agatha Christie  |
+---------------+--------- Page 1/2 -------+------------------+

Setting the max width of columns

Contributed by
Roland Franssen
in #28373.

The width defined with the setColumnWidth() method is considered the minimum column width. If the contents don't fit, the column width is increased up to the longest content length. In Symfony 4.2 we added a new setColumnMaxWidth() method to wrap long contents into multiple lines to maintain the column width.

1
2
3
4
5
6
7
// ...

// the first argument is the column position (starting from 0) and
// the second argument is the max length in characters
$table->setColumnMaxWidth(0, 5);
$table->setColumnMaxWidth(1, 10);
$table->render();

This example sets the max length of the first column to 5 characters and the max length of the second column to 10 characters. The give contents no longer fit into those columns, so they wrap into multiple lines:

1
2
3
4
5
6
7
8
+-------+------------+--------------------------------+
| ISBN  | Title      | Author                         |
+-------+------------+--------------------------------+
| 99921 | Divine Com | Dante Alighieri                |
| -58-1 | edy        |                                |
| 0-7   |            |                                |
|                (the rest of rows...)                |
+-------+------------+--------------------------------+

Be trained by Symfony experts - 2018-10-1 Paris - 2018-10-1 Paris - 2018-10-3 Paris
09/25/2018 03:06 am   Symfony Blog   Mirror   Link  

This week Symfony introduced SymfonyCasts, the best place to learn about Symfony, PHP and JavaScript. Meanwhile, the Validator component was decoupled from the Translator, and the lint commands were improved to support multiples files and directories. Lastly, the SymfonyLive London 2018 conference will take place next week.

Symfony development highlights

2.8 changelog:

  • 8d90df7: [Form] fixed DateTimeType html5 input format
  • a9004b3: [HttpFoundation] don't override StreamedResponse::setNotModified()
  • c75b1ed: [LDAP] used shut up operator on connection errors at ldap_start_tls
  • 4da7ab1: [PhpUnitBridge] provide debug_backtrace with proper args
  • 5a10f2d: [Form] forwarded false label option to nested types
  • 5d30df7: [HttpFoundation] allowed reuse of Session between requests if ID did not change
  • 2c8c6f7: [Console] fixed boxed table style with colspan

3.4 changelog:

  • c4c2981: [DependencyInjection] detect circular references with ChildDefinition parent
  • e0e5e83: [DependencyInjection] fixed infinite loop involving self-references in decorated services
  • 31e96f7: [MonologBridge] re-add option option to ignore empty context and extra data

Master changelog:

  • 48038fd: [Cache, Contracts] save the item or the trait does not have any effect
  • 1f98703: [Form, TwigBridge] fixed not displaying labels when value is false
  • 680f319: [PhpUnitBridge] enabled DebugClassLoader by default
  • cb13594: [FrameworkBundle] ignore backslashes in service ids when using debug:container and debug:autowiring
  • a1ca55b: [Validator] allow Validator without the translator component
  • bf4d011: [Validator] check the BIC country with symfony/intl
  • 4d6fc63: [Translation] added support for multiple files or directories in XliffLintCommand
  • a55853d: [Yaml] added support for multiple files or directories in LintCommand
  • 6856c02: [VarDumper] allow dd() to be called without arguments
  • 0d9154e: [Lock] added ZooKeeper data store
  • c51592c: [Debug] trigger a deprecation for new parameters not defined in sub classes
  • 85d335a: [VarDumper] added caster for MessageFormatter
  • 57a3413: [Form] fixed fail reverse transforming invalid RFC 3339 dates

Newest issues and pull requests

They talked about us

Upcoming Symfony Events

Call to Action


Be trained by Symfony experts - 2018-10-1 Paris - 2018-10-1 Paris - 2018-10-3 Paris
09/23/2018 03:06 am   Symfony Blog   Mirror   Link  

Contributed by
Jérémy Derussé
in #27456.

The Lock component was introduced in Symfony 3.4 to create and manage locks, a mechanism to provide exclusive access to a shared resource. Out of the box it supports different storages for local locks (files, semaphores) and distributed locks (Memcache, Redis). In Symfony 4.2 we've added a new PDO-based lock storage.

This makes sense because most Symfony applications already use MySQL/MariaDB or PostgreSQL for data persistence. However, this new storage doesn't rely on the built-in locking mechanisms of those databases (pg_advisory_lock_shared for PostgreSQL and GET_LOCK for MySQL/MariaDB) because they are not reliable enough. They depend on the TCP connection and require to fine-tune the database engine in order to not accept new connections after a reboot or to define a connection timeout greater than the maximum lock duration.

The new PdoStore class requires a PDO object, a Doctrine DBAL Connection object or a DSN (Data Source Name) string to configure the storage:

1
2
3
4
5
6
7
8
use Symfony\Component\Lock\Store\PdoStore;

// a PDO, a Doctrine DBAL connection or DSN for lazy connecting through PDO
$databaseConnectionOrDSN = 'mysql:host=127.0.0.1;dbname=lock';
$store = new PdoStore($databaseConnectionOrDSN, [
    'db_username' => 'myuser',
    'db_password' => 'mypassword'
]);

Then, create the table that stores the lock information. You can use the createTable() method of the PdoStore class to do that:

1
2
3
4
5
try {
    $store->createTable();
} catch (\PDOException $exception) {
    // the table could not be created for some reason
}

Now you can create and manage the PDO-based locks as explained in the docs for any other lock type.


Be trained by Symfony experts - 2018-09-24 Clichy - 2018-09-24 Clichy - 2018-09-26 Clichy
09/21/2018 04:04 am   Symfony Blog   Mirror   Link  

Contributed by
Nicolas Grekas
in #28234.

In modern Symfony applications, thanks to service autowiring and service autoconfiguration, there's no need to configure most (or any) of your services. However, in some edge-cases you may need to tell Symfony which exact service should be injected into other services.

This is solved with local binding which allows to bind services by type or name. For example, if you use YAML to configure services:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# config/services.yaml
services:
    _defaults:
        bind:
            # pass this value to any $adminEmail argument for any service
            # that's defined in this file (including controller arguments)
            $adminEmail: 'manager@example.com'

            # pass this service for any LoggerInterface type-hint for any
            # service that's defined in this file
            Psr\Log\LoggerInterface: '@monolog.logger.request'

In Symfony 4.2 we've improved this feature to allow binding services by type and name at the same time. This new feature allows a more precise binding because it only applies when both the argument type and the argument name match.

1
2
3
4
5
6
7
8
9
# config/services.yaml
services:
    _defaults:
        bind:
            # it works with scalar types too (string, int, array, etc.)
            string $adminEmail: 'manager@example.com'

            # but it's mostly used with classes
            Psr\Log\LoggerInterface $requestLogger: '@monolog.logger.request'

Be trained by Symfony experts - 2018-09-24 Clichy - 2018-09-24 Clichy - 2018-09-26 Clichy
09/20/2018 03:30 am   Symfony Blog   Mirror   Link  

We've been teasing it for the past 2 weeks and we loved your guesses! A lot of you somehow knew which long-time friend we were talking about.

As of today, we are extremely excited and honored to welcome SymfonyCasts to the Symfony family. And, you probably already know them as KnpUniversity. Its team, videos, and (sometimes) bad jokes are now SymfonyCasts!

What does that mean for the Symfony community? We hope a lot of good things!

What Does this All Mean?

It's no secret that video tutorials can be a huge way to make technology accessible to more people. And that's super important for the Symfony community. For that reason - just like other technologies - it makes sense for Symfony to have an official video platform: something we can promote across the community so that newcomers know about it & can use it. SymfonyCasts is a subscription service. But, keep reading: SymfonyCasts does something for free that almost no other video service does.

Oh, and SymfonyCasts wasn't acquired: it's still the same team making the same content that many of you already love. But, SymfonyCasts can now work more closely with Symfony: making sure their tutorials move in sync with the code and, most importantly, creating more Symfony tutorials!

The Symfony Docs & SymfonyCasts

What about the official written docs? Those are still the most important part of Symfony's documentation and that won't change. SymfonyCasts enhances the overall documentation by adding over 90 hours of video content. That's great!

But, it's even more than that. Don't prefer watching videos? Or, can't afford access to SymfonyCasts right now? No problem. One of SymfonyCasts' goals has always been to make its content accessible to everyone. To do that, the written script is available - for free - below every video, alongside expandable code blocks so that you can see the exact code being built.

If you're watching the video, English captions are also available. for the latest tutorials. Even more fun, you can click anywhere on the script to go straight to that part of the video. The videos are meant to be as accessible as possible.

SymfonyCasts Helps Support Symfony

Another reason we're excited is that, as part of the official family, SymfonyCasts now directly helps support the funding & development of Symfony. This is an important detail that helps to make sure the Symfony ecosystem can sustain itself far into the future.

But wait, there's more! SymfonyCasts will sponsor Ryan Weaver to work on the official Symfony documentation each Friday for (at least) the rest of 2018. He's got big plans for this time. Yep, SymfonyCasts is already helping to push the written documentation forward! Thank you Ryan and your team!

We are very pleased to add SymfonyCasts to the top nav of Symfony's website! We were missing official video tutorials about Symfony. But not anymore.

From Symfony with ❤


Be trained by Symfony experts - 2018-09-17 Cologne - 2018-09-24 Clichy - 2018-09-24 Clichy
09/17/2018 01:32 am   Symfony Blog   Mirror   Link  

This week Symfony introduced Symfony Panther, a new browser testing and web scraping library for PHP. Meanwhile, the SymfonyCon Lisbon 2018 conference announced its full schedule: part 1, part 2 and part 3.

Symfony development highlights

2.8 changelog:

  • 0417d6c: [Console] fixed corrupt error output for unknown multibyte short option
  • e40bb0f: [Validator] added Japanese translations

4.1 changelog:

  • a3e6e83: [FrameworkBundle] register the messenger data collector only when the profiler is enabled

Master changelog:

  • 8ab7077: [Messenger] throw an exception when the serializer component is not loaded

Newest issues and pull requests

They talked about us

Upcoming Symfony Events

Call to Action


Be trained by Symfony experts - 2018-09-17 Cologne - 2018-09-24 Clichy - 2018-09-24 Clichy
09/16/2018 03:18 am   Symfony Blog   Mirror   Link  

Contributed by
Colin O'Dell
in #28069.

In Symfony 4.2, the Validator component has introduced a new DivisibleBy constraint to check whether one number is a multiple of ("divisible by") some other number. It's mostly useful for enforcing specific increments on a number:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
// src/Entity/Item.php
namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;

class Item
{
    /**
     * @Assert\DivisibleBy(0.25)
     */
    protected $weight;

    /**
     * @Assert\DivisibleBy(
     *     value = 5,
     *     message = "This item requires to be stocked in multiples of 5 units."
     * )
     */
    protected $quantity;
}

These constraints ensure that the weight of the Item is provided in increments of 0.25 (e.g. 0.75 and 4.50 would be correct, but 0.18 or 7.32 wouldn't) and the quantity must be divisible by 5 (25 and 22620 would be correct but 12 or 123456 wouldn't).


Be trained by Symfony experts - 2018-09-17 Cologne - 2018-09-24 Clichy - 2018-09-24 Clichy
09/14/2018 03:52 am   Symfony Blog   Mirror   Link  

Symfony 4.2 will be released in November 2018. This is the first article of the series that shows the most important new features introduced by this Symfony version.


Contributed by
Viktor Novikov
in #27807.

In Symfony apps, functional tests use a PHP-based client provided by the BrowserKit component to simulate a browser and perform HTTP requests. In Symfony 4.2 we've introduced new helper methods in this client to simplify the action of clicking links and submitting forms.

First, the clickLink() helper clicks the first link that contains the given text (or the first clickable image whose alt attribute contains the given text):

1
2
3
4
5
6
7
8
// Before
$client->request('GET', '/');
$link = $crawler->selectLink('Login')->link();
$crawler = $client->click($link);

// After
$client->request('GET', '/');
$crawler = $client->clickLink('Login');

The previous way of dealing with links (with the selectLink() and click() methods) still works and you'll need to use it in more complex scenarios (for example when you need to access to some attribute of the link before clicking it).

The other new helper is called submitForm(), which finds the first form that contains a button with the given text (or id, value or name) and uses it to submit the given form field values:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
// Before
$client->request('GET', '/register');
$form = $crawler->selectButton('Sign Up')->form();
$crawler = $client->submit($form, [
    'name' => 'Jane Doe',
    'username' => 'jane',
    'password' => 'my safe password',
]);

// After
$client->request('GET', '/register');
$crawler = $client->submitForm('Sign Up', [
    'name' => 'Jane Doe',
    'username' => 'jane',
    'password' => 'my safe password',
]);

The previous way of dealing with forms (with the selectButton() and submit() methods) still works and you'll need to use it in more complex scenarios (for example when you need to access to some attribute of the form before submitting it).

Lastly, if you want to run your functional tests in a real browser instead of this simulated browser check out Symfony Panther, the latest addition to the Symfony ecosystem. One of its biggest advantages is that it uses the same API as BrowserKit, so these new helpers may be available in Panther soon.


Be trained by Symfony experts - 2018-09-17 Cologne - 2018-09-24 Clichy - 2018-09-24 Clichy
09/13/2018 04:46 am   Symfony Blog   Mirror   Link  

This week, Symfony 2.8.45, 3.4.15 and 4.1.4 maintenance versions were released. In addition, we improved performance of AbstractObjectNormalizer in the Serializer component and we improved RedisCluster performance in the Cache component. Finally, we added a new "auto" mode the for cookie_secure option and introduced a new VarExporter component.

Symfony development highlights

2.8 changelog:

  • b547855: [HttpFoundation] fixed unprepared BinaryFileResponse sends empty file

3.4 changelog:

  • 2041624: [PhpUnitBridge] keep compat with composer 1.0

4.1 changelog:

  • 8e984f8: [Cache] minor code update to leverage PHP 7.1
  • bc90da7: [Messenger] moved commands-specifics to a compiler pass in FrameworkBundle

Master changelog:

  • 93bb665: [Messenger] don't make EnvelopeItemInterface extend Serializable
  • 53ffa66: [Serializer] improved performance of AbstractObjectNormalizer
  • 74461cc: [FrameworkBundle] added new "auto" mode for framework.session.cookie_secure to turn it on when https is used
  • da0ef24: [VarExporter] added a new component to serialize values to plain PHP code
  • 9cc80ec: [Translator] used ICU parent locales as fallback locales
  • 4edbd60: [FrameworkBundle] deprecated Symfony\Bundle\FrameworkBundle\Controller\Controller
  • bedd7aa: [Messenger] only subscribe to a given bus from the MessageSubscriber
  • 6c539e1: [Messenger] added a --bus option to the messenger:consume-messages command
  • 7504535: [Messenger] allowed interfaces to be type-hinted as well
  • 8651758: [Messenger] removed the "obscure" message subscriber configuration
  • 501212b: [Serializer] added support for ignoring comments while XML encoding
  • c3ec061: [Cache] improved perf when using RedisCluster by reducing roundtrips to the servers
  • bc45a0e: [VarDumper] made RedisCaster handle RedisCluster and dump all options on all drivers

Newest issues and pull requests

They talked about us

Upcoming Symfony Events

Call to Action


Be trained by Symfony experts - 2018-09-10 Paris - 2018-09-13 Clichy - 2018-09-17 Cologne
09/02/2018 04:38 am   Symfony Blog   Mirror   Link  

All Symfony conferences come with pre-conference workshops. We organized them to enable the conference attendees to get trained on Symfony and its ecosystem just before the conference, during special workshops sessions at a very special price. The idea is to get the most out of the conference and enhance your Symfony skills before learning new tips and tricks from the speakers’ experience during the conference. We organize 4 different pre-conference workshops at SymfonyLive London 2018 on September 27th and they are almost all sold out!

If you are thinking on registering for a workshop, don’t wait any longer and book your combo ticket (workshop and conference) before there are no seats left anymore. Regular registration is open until September 3rd and the combo ticket is as low as £655! The workshop value at regular rate is £650. Benefit from this great deal until September 3rd, after that date, the combo ticket will increase to £767.

Here is the list of the pre-conference workshops offered:

During this workshop, you will discover the new practices recommended by the Symfony Core team. You will learn how to install third-party packages with Symfony Flex, configure your application with environment variables or exploit the new features of the dependency injection container. And much more!

API Platform has become a very popular framework to build advanced and modern API-driven web projects. After an overview of modern API patterns and formats (REST, Swagger, hypermedia, HATEOAS, JSON-LD, Hydra, Schema.org, GraphQL...), you'll learn how to use and extend the most popular features of the API Platform API component: Swagger documentation, pagination, validation, sorting, filtering, authentication, authorization, content negotiation, data model generation using the Schema.org vocabulary. Finally, you'll discover how easy it is to use the client-side (JavaScript) toolkit.

The Messenger component drastically simplifies the use of message buses and handling asynchronous operations using message queues such as RabbitMq. In this workshop, you will learn everything about how to use it from creating and handling messages as a strategy to decouple your application then configure the message routing and asynchronously handle your messages or how to customise and write your own adapters and much more!

Learn everything from writing good unit tests, through using test doubles (like stubs or mocks), to writing integration tests. Learn how to structure your project to benefit from a test-first design. Apply the right amount of testing on appropriate levels, write decoupled code, and run your tests in seconds, not hours. The result will look suspiciously close to the hexagonal architecture.

Pre-conference workshops have a limited number of seats, get yours now! Workshop tickets cannot be sold separately from the conference ticket.

If you are still considering joining the conference, have a look at the incredible speaker line-up and discover all the fabulous talks you’ll be able to attend on September 28th! If you still hesitate, watch all the talks from last year edition of the conference on Symfony YouTube channel and get an idea of what to expect.

Will you be there? If so hurry up to take your combo workshop and conference or conference ticket before the price change on September 3rd.

See you at the conference!


Be trained by Symfony experts - 2018-09-10 Paris - 2018-09-13 Clichy - 2018-09-17 Cologne
08/31/2018 04:35 am   Symfony Blog   Mirror   Link  

Symfony 4.1.4 has just been released. Here is a list of the most important changes:

  • bug #28278 [HttpFoundation] Fix unprepared BinaryFileResponse sends empty file (@wackymole)
  • bug #28284 [PhpUnitBridge] keep compat with composer 1.0 (@nicolas-grekas)
  • bug #28251 [HttpFoundation] Allow RedisCluster class for RedisSessionHandler (@michaelperrin)
  • bug #28241 [HttpKernel] fix forwarding trusted headers as server parameters (@nicolas-grekas)
  • bug #28220 [PropertyAccess] fix type error handling when writing values (@xabbuh)
  • bug #28249 [Cache] enable Memcached::OP _TC _NODELAY to fix perf of misses (@nicolas-grekas)
  • bug #28252 [DoctrineBridge] support toString as documented for UniqueEntityValidator (@dmaicher)
  • bug #28216 [FrameworkBundle] messag _bus alias public (@sroze)
  • bug #28113 [Form] Add help texts for checkboxes in horizontal bootstrap 4 forms (@apfelbox)
  • bug #28100 [Security] Call AccessListener after LogoutListener (@chalasr)
  • bug #28174 Remove the HTML5 validation from the profiler URL search form (@Soullivaneuh)
  • bug #28159 [DI] Fix autowire inner service (@hason)
  • bug #28060 [DI] Fix false-positive circular ref leading to wrong exceptions or infinite loops at runtime (@nicolas-grekas)
  • bug #28144 [HttpFoundation] fix false-positive ConflictingHeadersException (@nicolas-grekas)
  • bug #28152 [Translation] fix perf of lint:xliff command (@nicolas-grekas)
  • bug #28115 [Form] Remove extra .form-group wrapper around file widget in bootstrap 4 (@MrMitch)
  • bug #28120 [Routing] Fixed scheme redirecting for root path (@twoleds)
  • bug #28112 Fix CSS property typo (@AhmedAbdulrahman)
  • bug #28012 [PropertyInfo] Allow nested collections (@jderusse)
  • bug #28055 [PropertyInfo] Allow nested collections (@jderusse)
  • bug #28083 Remove the Expires header when calling Response::expire() (@javiereguiluz)

Want to upgrade to this new release? Fortunately, because Symfony protects backwards-compatibility very closely, this should be quite easy. Read our upgrade documentation to learn more.

Want to be notified whenever a new Symfony release is published? Or when a version is not maintained anymore? Or only when a security issue is fixed? Consider subscribing to the Symfony Roadmap Notifications.


Be trained by Symfony experts - 2018-08-28 Lille - 2018-08-28 Lille - 2018-08-29 Clichy
08/28/2018 01:19 am   Symfony Blog   Mirror   Link  

Symfony 3.4.15 has just been released. Here is a list of the most important changes:

  • bug #28278 [HttpFoundation] Fix unprepared BinaryFileResponse sends empty file (@wackymole)
  • bug #28284 [PhpUnitBridge] keep compat with composer 1.0 (@nicolas-grekas)
  • bug #28241 [HttpKernel] fix forwarding trusted headers as server parameters (@nicolas-grekas)
  • bug #28220 [PropertyAccess] fix type error handling when writing values (@xabbuh)
  • bug #28249 [Cache] enable Memcached::OP _TC _NODELAY to fix perf of misses (@nicolas-grekas)
  • bug #28252 [DoctrineBridge] support toString as documented for UniqueEntityValidator (@dmaicher)
  • bug #28100 [Security] Call AccessListener after LogoutListener (@chalasr)
  • bug #28060 [DI] Fix false-positive circular ref leading to wrong exceptions or infinite loops at runtime (@nicolas-grekas)
  • bug #28144 [HttpFoundation] fix false-positive ConflictingHeadersException (@nicolas-grekas)
  • bug #28012 [PropertyInfo] Allow nested collections (@jderusse)
  • bug #28055 [PropertyInfo] Allow nested collections (@jderusse)
  • bug #28083 Remove the Expires header when calling Response::expire() (@javiereguiluz)

Want to upgrade to this new release? Fortunately, because Symfony protects backwards-compatibility very closely, this should be quite easy. Read our upgrade documentation to learn more.

Want to be notified whenever a new Symfony release is published? Or when a version is not maintained anymore? Or only when a security issue is fixed? Consider subscribing to the Symfony Roadmap Notifications.


Be trained by Symfony experts - 2018-08-28 Lille - 2018-08-28 Lille - 2018-08-29 Clichy
08/28/2018 01:16 am   Symfony Blog   Mirror   Link  

Symfony 2.8.45 has just been released. Here is a list of the most important changes:

  • bug #28278 [HttpFoundation] Fix unprepared BinaryFileResponse sends empty file (@wackymole)
  • bug #28241 [HttpKernel] fix forwarding trusted headers as server parameters (@nicolas-grekas)
  • bug #28220 [PropertyAccess] fix type error handling when writing values (@xabbuh)
  • bug #28100 [Security] Call AccessListener after LogoutListener (@chalasr)
  • bug #28144 [HttpFoundation] fix false-positive ConflictingHeadersException (@nicolas-grekas)
  • bug #28055 [PropertyInfo] Allow nested collections (@jderusse)
  • bug #28083 Remove the Expires header when calling Response::expire() (@javiereguiluz)

Want to upgrade to this new release? Fortunately, because Symfony protects backwards-compatibility very closely, this should be quite easy. Read our upgrade documentation to learn more.

Want to be notified whenever a new Symfony release is published? Or when a version is not maintained anymore? Or only when a security issue is fixed? Consider subscribing to the Symfony Roadmap Notifications.


Be trained by Symfony experts - 2018-08-28 Lille - 2018-08-28 Lille - 2018-08-29 Clichy
08/27/2018 12:44 pm   Symfony Blog   Mirror   Link  

This week, Symfony added support to autowire by type and parameter name. In addition, the schedule for the first day and second day of the SymfonyCon Lisbon 2018 conference was announced.

Symfony development highlights

2.8 changelog:

  • e18bf6e: [PropertyAccess] fix type error handling when writing values
  • 2554ad0: [HttpKernel] fixed forwarding trusted headers as server parameters

3.4 changelog:

  • d446b6a: [DoctrineBridge] support __toString as documented for UniqueEntityValidator
  • 8860b66: [Cache] enable Memcached::OPT_TCP_NODELAY to fix perf of misses

Master changelog:

  • 6a4de22: [Validator] fixed precision issue regarding floats and DivisibleBy constraint
  • d8e2af3: [DependencyInjection] allow autowiring by type + parameter name
  • f03a54e: [DomCrawler] added a way to filter direct children
  • b959d85: improved support for anonymous classes
  • e675597: [PhpUnnitBridge] mock date() in ClockMock
  • 9ef362e: [Serializer] XmlEncoder doesn't ignore PI nodes while encoding

Newest issues and pull requests

They talked about us

Upcoming Symfony Events

Call to Action


Be trained by Symfony experts - 2018-08-28 Lille - 2018-08-28 Lille - 2018-08-29 Clichy
08/26/2018 03:11 am   Symfony Blog   Mirror   Link  

We announced last Monday the first part of the conference schedule for SymfonyCon Lisbon 2018. We’re now very happy to announce the second part of the schedule. Discover the conference schedule! We’re extremely pleased to welcome the following speakers (in alphabetical order) and their talks at the conference. Please meet:

  • Pedro Magalhães, PHP Developer and Contributor, will present a talk entitled “Changing PHP”. PHP releases a new minor version every year. Major versions happen when there are enough changes that justify to do so. Who is making those changes and how does that process work? What is the process to get an RFC to vote and the subsequent merge of the code? If you are intrigued by PHP internals, this talk is for you.

  • Ciaran McNulty, PHP professional since the late 90s and lead maintainer of PhpSpec, will be speaking about “Behat Best Practices with Symfony”. In this talk Ciaran will explain the BDD process, and show the best practices for using Behat including: writing good scenarios, driving service development from scenarios, fast UI testing, and using Behat and the Symfony2Extension.

  • Jeremy Mikola, Contributor to various projects in the Symfony2 ecosystem and JeoPHPardy presenter, will be talking about “Bulletproof MongoDB”. This talk will examine how the driver monitors connections to a cluster and look at how we can tune its behavior to meet an application's unique needs, and much more! He will also present the now famous "JeoPHPardy" at the end of the first day of the conference!

  • Fabien Potencier, Symfony founder and project lead, will be on stage for the opening Keynote on Thursday morning! Stay tuned for more details to be announced soon.

  • Samuel Roze, Core Team member of Symfony and ApiPlatform, creator of ContinuousPipe and Tolerance, will give a talk about “Symfony Messenger: 6 months already and more to come”. The Messenger component brings asynchronous processing to Symfony: using message bus(es) you are able to decouple your application and route some (or all) of these "messages" to transports such as the built-in AMQP transport. More than 6 months after merging the new Messenger component in Symfony, Samuel, creator of the component, will explore the different use cases it has been used for so far and how it will continue to involve in order to facilitate even more.

  • Michelle Sanver, big advocate of Open Source and diversity in tech and Symfony CARE team member, will present a talk about “Using the Workflow component for e-commerce”. They got the task to make an order API, from open order, to delivered, with payments in between and after. This is a real happy use case story where she will show you how they did this, and how much more straightforward it was for them to build an otherwise complex system using the workflow component.

  • Miro Svrtan, PHP developer since 1999 now Senior developer, will be speaking about “When testing makes no sense”. If you look at the stage of any conference in the PHP world, people are preaching testing,testing,testing ... If you on the other hand look at the community, the percentage of people writing tests is really low. This talk will explore that fuzzy line when you have to shift your mind from one side to the other: in both directions.

  • Diana Ungaro Arnos, Tech Lead, PHPSP and PHPWomenBR member, information security enthusiast, will be talking about “Security: handling user access with Symfony the right way”. Take a look at the Symfony's Security component powerful tools and see how to use them to handle user access the right way.

The conference is coming in about in less than 4 months, will you be there? Join us today, take your ticket!

The last speakers and talks will be announced very soon, stay tuned!

See you at the conference!


Be trained by Symfony experts - 2018-08-28 Lille - 2018-08-28 Lille - 2018-08-29 Clichy
08/24/2018 01:27 am   Symfony Blog   Mirror   Link  

The international Symfony conference will be organized from December 6th to 8th at the Lisbon Marriott Hotel, in the great city of Lisbon, Portugal! Never been to Portugal before? Discover the home of Pastel de Nata, Fado, Azulejos (Tiles), kilometers of white sand beaches and much more, you’ll love all of them especially in December.

Ready to join us? Find out the conference schedule! We’re extremely pleased to announce the first part of the selected speakers (in alphabetical order) and their talks:

  • Jordi Boggiano, Composer PHP lead and Co-founder of Packagist, will be speaking about "the Building global web apps with multi-region hosting". This session will explore various setups and case studies from his attempts at hosting sites used by global audiences.

  • Denis Brumann, will be talking about “The patterns behind Doctrine”. How does Doctrine talk to your database? What are Data Mapper, Unit Of Work, and Identity Map? These are the questions he wants to answer in this talk.

  • David Buchmann, Symfony CMF member, will present a talk about “Going crazy with HTTP: Caching pages of logged in users”. You know how HTTP caching works but need more? In this talk we look into ways to cache personalized content.

  • Nicole Cordes, TYPO3 Active Contributor, will be speaking about “How static PHP analyzer changed the way I look at code”. Get an introduction to the world of static PHP code analyzers.

  • Frank de Jonge, Maintainer of Flysystem and Creator of EventSauce, will give a talk about “File storage for modern PHP applications”. In this talk we'll explore how filesystem abstraction and general coding guidelines can improve our application's and make them future proof!

  • Christian Flothmann, Symfony Documentation and Core Team member, co-maintainer FOSRestBundle and Christopher Hertel, Core Member of jæm3l EE, will be talking about “Using Symfony Forms with Rich Domain Models”. In this talk we will discuss the different aspects of a rich domain model that makes it hard to use it in conjunction with the Form component. We will then look at the possibilities to hook into the data flow of the form handling and discover how we can modify it to interact seamlessly with our model.

  • Daniel Gomes will present a talk about “Building Apps for Immutable Servers”. In this talk, he will explain the differences between Snowflake and Immutable Servers and also what considerations you should have while developing your App.

  • Lukas Kahwe Smith, involved in PEAR, PHP internals, Doctrine and Symfony, especially the CMF initiative, lead of the Symfony diversity initiative, will give a talk about “One year diversity initiative”. Last year in Cluj the diversity initiative was announced by Fabien. This talk aims to give an overview how those efforts were organized, what was done as part of the initiative and what progress was made.

SymfonyCon Lisbon is a 5-day event: 2-day pre-conference workshops on December 4th and 5th, 2-day conference on December 6th and 7th and one hackday on December 8th. There are 3 tracks per day, one Symfony advanced track (both days), one Symfony beginner track (both days), one PHP track (only on Thursday December 6th), one Unconference track (only on Friday December 7th).

What a great line-up! And there are more to come! More speakers and talks to be announced very soon, stay tuned!

It’s time to take your ticket and secure your seat for the conference. Register now for 299€ for the 2 days of conference and the hackday.

See you at the conference!


Be trained by Symfony experts - 2018-08-22 Paris - 2018-08-27 Clichy - 2018-08-27 Clichy
08/20/2018 10:16 am   Symfony Blog   Mirror   Link  

This week, the upcoming Symfony 4.2 version added a new DivisibleBy constraint and enabled logger autoconfiguration. Meanwhile, the SymfonyLive USA conference was rebranded as Symfony Loves PHP USA Conference and announced its full schedule.

Symfony development highlights

3.4 changelog:

  • 37c39fb: [Yaml] clean up unused code
  • 1757c9c: [PhpUnitBridge] added missing stderr redirection

4.1 changelog:

  • 68a9a07: [Form] added help texts for checkboxes in horizontal bootstrap 4 forms

Master changelog:

  • 0934464: [DependencyInjection, FrameworkBundle] added LoggerAwareInterface to auto configuration
  • 9f4615a: [Validator] added a DivisibleBy constraint for testing divisibility

Newest issues and pull requests

They talked about us

Upcoming Symfony Events

Call to Action


Be trained by Symfony experts - 2018-08-22 Paris - 2018-08-27 Clichy - 2018-08-27 Clichy
08/19/2018 03:04 am   Symfony Blog   Mirror   Link