New! Checkout our new GitHub homepage! Follow the latest activity of eZ Publish Developers on GitHub.com


Contributed by
Anthony Martin
in #30027.

PHP defines lots of config options related to sessions. In Symfony we define them under the framework.session.* options so you don't have to change your PHP.ini to configure those values.

In Symfony 4.3 we added two new config options related to session IDs:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# config/packages/framework.yaml
framework:
    session:
        # configures the length of the string used for the session ID
        # integer; default = 32; valid values = from 22 to 256 (both inclusive)
        sid_length: 64

        # configures the number of bits in encoded session ID character
        # integer; default = 4; valid values: 4, 5, or 6.
        sid_bits_per_character: 4

These new options are related to the session.sid_length PHP option and the session.sid_bits_per_character PHP option respectively, where you can find more details about them.


Be trained by Symfony experts - 2019-02-18 Clichy - 2019-02-18 Clichy - 2019-02-20 Clichy
02/15/2019 06:32 am   Symfony Blog   Mirror   Link  

Contributed by
Webnet team
in #28635.

The forms created with the Symfony Form component translate their labels and help messages automatically. However, the translations cannot contain any custom parameters because in the templates, the trans() Twig filter is called without passing any parameters.

In Symfony 4.3 we improved the translation of Symfony Forms allowing to define custom translation parameters using three new config options: label_translation_parameters, help_translation_parameters, and attr_translation_parameters (this one is useful to translate placeholder and title):

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;

class OrderType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('comment', TextType::class, [
            'label' => 'Comment for the order of %company%',
            'label_translation_parameters' => [
                '%company%' => 'Acme Ltd.',
            ],

            'help' => 'The address of %company% is %address%',
            'help_translation_parameters' => [
                '%company%' => 'Acme Ltd.',
                '%address%' => '4 Form street, Symfonyville',
            ],
        ])
    }
}

Be trained by Symfony experts - 2019-02-18 Clichy - 2019-02-18 Clichy - 2019-02-20 Clichy
02/14/2019 05:03 am   Symfony Blog   Mirror   Link  

Contributed by
Imad Zairig
in #28477.

JSON is arguably the most used format in applications developed with Symfony. You probably make requests to JSON APIs and send/receive JSON payloads in your projects. That's why Symfony provides a JsonResponse class, a way to build JSON authentication, full JSON support in the Serializer component, a json() helper for controllers, etc.

In Symfony 4.3 we improved the Validator component to add a new Json constraint, which can be applied to properties and getters, and ensures that the given contents are valid JSON contents:

  • Annotations
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    // src/Entity/Book.php
    namespace App\Entity;
    
    use Symfony\Component\Validator\Constraints as Assert;
    
    class Book
    {
        /**
         * @Assert\Json(message = "This is not valid JSON")
         */
         protected $chapters;
    }
    
  • YAML
    1
    2
    3
    4
    5
    6
    # config/validator/validation.yaml
    App\Entity\Book:
        properties:
            chapters:
                - Json:
                    message: 'This is not valid JSON'
    
  • XML
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    <!-- config/validator/validation.xml -->
    <?xml version="1.0" encoding="UTF-8" ?>
    <constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
        <class name="App\Entity\Book">
             <property name="chapters">
                <constraint name="Json">
                    <option name="message">This is not valid JSON</option>
                </constraint>
            </property>
        </class>
    </constraint-mapping>
    
  • PHP
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    // src/Entity/Book.php
    namespace App\Entity;
    
    use Symfony\Component\Validator\Mapping\ClassMetadata;
    use Symfony\Component\Validator\Constraints as Assert;
    
    class Book
    {
        protected $chapters;
    
        public static function loadValidatorMetadata(ClassMetadata $metadata)
        {
            $metadata->addPropertyConstraint('chapters', new Assert\Json(array(
                'message' => 'This is not valid JSON',
            )));
        }
    }
    

Be trained by Symfony experts - 2019-02-18 Clichy - 2019-02-18 Clichy - 2019-02-20 Clichy
02/13/2019 04:36 am   Symfony Blog   Mirror   Link  
@ezecosystem
ezecosystem pushed to master in ezecosystem/Sylius Feb 12, 2019
2 commits to master
02/12/2019 12:05 am   eZecosystem @ GitHub   Mirror   Link  
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/phpunit Feb 11, 2019
2 commits to master
02/11/2019 12:29 pm   eZPublishLegacy @ GitHub   Mirror   Link  
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/ezpublish-kernel Feb 11, 2019
2 commits to master
02/11/2019 12:12 pm   eZPublishLegacy @ GitHub   Mirror   Link  
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/ezgpg Feb 11, 2019
1 commit to master
  • @brookinsconsulting 7b62c94
    Added: Added composer.json
02/11/2019 12:08 pm   eZPublishLegacy @ GitHub   Mirror   Link  
@ezecosystem
ezecosystem pushed to master in ezecosystem/Sylius Feb 11, 2019
2 commits to master
02/11/2019 12:07 pm   eZecosystem @ GitHub   Mirror   Link  
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/ezauthorize Feb 11, 2019
1 commit to master
  • @brookinsconsulting eaa000b
    Added: Added composer.json
02/11/2019 12:05 pm   eZPublishLegacy @ GitHub   Mirror   Link  
@ezecosystem
ezecosystem pushed to master in ezecosystem/NovaeZEnhancedImageAssetBundle Feb 11, 2019
2 commits to master
  • @florianalexandre c35d7da
    feat: little refactoring to reduce overall size
  • @florianalexandre 6689217
    fix: issue in admin UI
02/11/2019 12:05 pm   eZecosystem @ GitHub   Mirror   Link  
@ezecosystem
ezecosystem pushed to master in ezecosystem/ezstudio-installer Feb 11, 2019
2 commits to master
02/11/2019 12:01 pm   eZecosystem @ GitHub   Mirror   Link  
@ezecosystem
ezecosystem pushed to master in ezecosystem/ezpublish-kernel Feb 11, 2019
2 commits to master
02/11/2019 12:00 pm   eZecosystem @ GitHub   Mirror   Link  
@ezecosystem
ezecosystem pushed to master in ezecosystem/docker-php Feb 11, 2019
1 commit to master
02/11/2019 11:57 am   eZecosystem @ GitHub   Mirror   Link  
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/ezecosystem Feb 11, 2019
2 commits to master
  • @brookinsconsulting 44c2b01
    Added: Added override settings to support full/video and pagelayout f…
  • @brookinsconsulting e9bcab6
    Added: Added full/video template for streaming video embed support (s…
  • 2 more commits »
02/11/2019 12:05 am   eZPublishLegacy @ GitHub   Mirror   Link  
@ezecosystem
ezecosystem pushed to master in ezecosystem/launchpad Feb 9, 2019
2 commits to master
02/09/2019 12:03 am   eZecosystem @ GitHub   Mirror   Link  
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/phpunit Feb 8, 2019
2 commits to master
02/08/2019 12:28 pm   eZPublishLegacy @ GitHub   Mirror   Link  
@ezecosystem
ezecosystem pushed to master in ezecosystem/Sylius Feb 8, 2019
1 commit to master
  • @pamil dda1309
    Change branch alias to "1.5-dev"
02/08/2019 12:07 pm   eZecosystem @ GitHub   Mirror   Link  
@ezecosystem
ezecosystem pushed to master in ezecosystem/ezplatform-com Feb 8, 2019
1 commit to master
02/08/2019 11:59 am   eZecosystem @ GitHub   Mirror   Link  
@ezecosystem
ezecosystem pushed to master in ezecosystem/developer-documentation Feb 8, 2019
2 commits to master
02/08/2019 11:57 am   eZecosystem @ GitHub   Mirror   Link  

Contributed by
Christian Flothmann
in #29999.

The PropertyAccess component allows to read/write properties from objects and arrays using a simple string notation. It's used by Symfony components like Forms, Security, Validator, Workflow and hundreds of other public projects.

In Symfony 4.3 we improved its performance refactoring the code of the ObjectNormalizer class. The trick was to add some shortcuts for cases where we know that we do not need to perform all checks.

Saving so many function calls in such a critical operation results in a 20% to 30% performance improvement for a non-trivial synthetic benchmark. You can expect even better improvements if your app deals with large objects and complex property paths.

Best of all? You don't need to make any change in your application code to benefit from this improvement. Upgrade to Symfony 4.3 when it's released at the end of May 2019 and that's all.


Be trained by Symfony experts - 2019-02-11 Clichy - 2019-02-11 Clichy - 2019-02-13 Clichy
02/08/2019 09:30 am   Symfony Blog   Mirror   Link  
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/phpunit Feb 8, 2019
2 commits to master
02/08/2019 12:34 am   eZPublishLegacy @ GitHub   Mirror   Link  
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/eep Feb 8, 2019
2 commits to master
  • @dougplant 1be0eed
    Merge pull request mugoweb#39 from benkmugo/master
  • @benkmugo c5dad94
    Adds support for eZ Find configurations using eZ Find's basicAuth
02/08/2019 12:04 am   eZPublishLegacy @ GitHub   Mirror   Link  
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/bcstateselect Feb 8, 2019
1 commit to master
  • @brookinsconsulting 2020da8
    Updated: Updated version number and copyright to reflect continued ma…
02/08/2019 12:00 am   eZPublishLegacy @ GitHub   Mirror   Link  
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/bcgooglesitemaps Feb 8, 2019
1 commit to master
  • @brookinsconsulting a18da09
    Updated: Added public and static text to ezinfo info function definit…
02/07/2019 11:59 pm   eZPublishLegacy @ GitHub   Mirror   Link  
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/bcgeneratestaticcache Feb 8, 2019
2 commits to master
02/07/2019 11:58 pm   eZPublishLegacy @ GitHub   Mirror   Link