New! Our new Issues homepage has the latest issue ticket changes. Follow the latest progress of eZ Publish!


News

[Webinar] Bridging the Gap Between Commerce and Content

Join us on October 24th, 2018 at 10:00am ET/ 3:00pm CET as eZ's Product Marketing Manager, Amit takes us on a tour of eZ Commerce.

What you'll learn: Live demo of eZ Commerce and its new features. Learn about the limitations of commerce solutions on the market possess and how a unified solution can be ideal for complex B2B projects. Who should attend: CMO, CTO/CIO, Marketer/Editors.

You can register here.

Support Open Source and eZ Platform, join Hacktoberfest 2018

Hacktoberfest is open to anyone in the open source ecosystem. You can sign up any time between October 1st and October 31st. What do you have to do? Sign up, and make five pull requests (PRs) between October 1st - 31st in any timezone, on any public repository.

Of course we welcome you to search for issues on our issue tracker, work on a solution, and make a pull request on one of our repo's on GitHub.

eZ Platform 2.3.1 released

eZ Platform 2.3.1 has been released, fixing several bugs. Check out the release notes to find out which bugs. As always, update your current installation using Composer, or download the release from our developer hub.

In Other News:

Resources

Discover eZ Platform v2.3

Last week we presented eZ Platform 2.3, the latest Fast Track release. The recording of this webinar is available on our YouTube channel.

Looking for a bundle compatible with eZ Platform? Check out: https://ezplatform.com/Bundles.

Social Media

Follow us on Twitter, Facebook, LinkedIn, Google+, or YouTube, and join our Community for any help with eZ Platform or community-related questions.

Find eZ at These Events

For more events, make sure to check out this list.

Each week we publish a roundup of highlights from the eZ ecosystem. If you have any news or events to share, please contact me.

(Lead image credit: Kmeron, CC)

10/19/2018 10:13 am   ez.no/About-eZ/Blog   Mirror   Link  

Symfony's security system has always been flexible. But over the past few years, it's also become increasingly easy to tap into that power: by creating Guard authenticators and voters for complex authorization rules.

But, we can do more. For example, Symfony security users are so flexible, they can be confusing to set up. And creating a Guard authenticator, while clear and powerful, requires some work. Can we have both flexibility and rapid development? I think so - thanks to two new commands added to MakerBundle.

make:user

Contributed by
Ryan Weaver
in #250.

Ready to start your security system? First you need a user. But, does your entity need to be saved to the database? And is your app responsible for checking passwords? MakerBundle 1.7 will guide you through these decisions and generate exactly what you need:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
$ php bin/console make:user

The name of the security user class (e.g. User) [User]:
> User

Do you want to store user data in the database (via Doctrine)? (yes/no) [yes]:
> yes

Enter a property name that will be the unique "display" name for the user
(e.g. email, username, uuid) [email]:
> email

Will this app need to hash/check user passwords? Choose No if passwords
are not needed or will be checked/hashed by some other system (e.g. a single sign-on server).
Does this app need to hash/check user passwords? (yes/no) [yes]:
> yes

created: src/Entity/User.php
created: src/Repository/UserRepository.php
updated: src/Entity/User.php
updated: config/packages/security.yaml

That's it! Depending on your answers, the command will create a User class/entity and update your security.yaml file to configure a secure password encoder (if needed) and a user provider. The generated code has clear comments so you can continue updating everything for your needs.

make:auth

Contributed by
Nicolas Philippe
in #266.

Now that you have a User class, it's time to let your users log in. Want a complete form login system in one command? In MakerBundle 1.8, it's no problem. The new make:auth command can create an entire form authentication system, or an empty authenticator, based on your answers:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
$ php bin/console make:auth

What style of authentication do you want? [Empty authenticator]:
[0] Empty authenticator
[1] Login form authenticator
> 1

The class name of the authenticator to create (e.g. AppCustomAuthenticator):
> LoginFormAuthenticator

Choose a name for the controller class (e.g. SecurityController) [SecurityController]:

created: src/Security/LoginFormAuthenticator.php
updated: config/packages/security.yaml
created: src/Controller/SecurityController.php
created: templates/security/login.html.twig

This creates the login route, controller and template as well as a Guard authenticator that handles the login submit, includes CSRF protection and redirects intelligently on success and error. Your authenticator class will have a few minor TODOs inside (usually just 1) that you'll need to finish. But, you won't need to modify any config files.

The result? A fully functional login system in minutes that you have full control over. Customize the template to match your look and update the code in your authenticator to add anything special you need during the login process.

You can also generate a "empty" authenticator to use for whatever other authentication you need. Want support to generate other kinds of authenticators? Just open a pull request!

Happy security!


Be trained by Symfony experts - 2018-10-17 Paris - 2018-10-22 Clichy - 2018-10-22 Clichy
10/17/2018 08:24 am   Symfony Blog   Mirror   Link  

The international Symfony conference is coming in less than 2 months, on December 6th and 7th in the fantastic Lisbon, Portugal. Pre-conference workshops at SymfonyCon Lisbon are organized on December 4th and 5th and all of them are almost sold out! If you want to get trained before the conference, you might secure your workshop ticket before there are all gone!

We’re very pleased to announce that we have added a new workshop to the list:

Discover the Sylius plugin development with Symfony 4.1, one-day workshop. You will be trained by Sylius Core Team Members Mateusz Zalewski & Łukasz Chruściel. Learn all about how to implement a reusable plugin for your Sylius-based e-commerce application that will be crafted to your needs. We will use the most recent Symfony version, fulfilling its conventions and recommended practices. Using BDD methodology, we will not forget about tests that will describe your custom business logic and ensure us that we write clean and shiny code. During the workshop, we will be aiming to make plugin usable with Symfony Flex to make installation and configuration more developer-friendly.

You can combo this one-day workshop with the others one-day workshops already online but there are only a few seats left for the following workshops. Registration for these workshops is not available on both pre-conference workshop days as the workshops might already be sold out on selected dates:

  • Writing Modern JavaScript with Symfony & Webpack Encore by Ryan Weaver - Symfony Core Team member & docs leader (one-day workshop). In this workshop, we'll use the Webpack Encore library from Symfony to quickly bootstrap a sophisticated asset setup, complete with minification, SASS processing, automatic versioning, Babel support and everything you need to start writing great JavaScript quickly. We'll also learn about using JavaScript modules, how to bootstrap a framework (like React) and other important modern practices. Give your assets a huge boost with Webpack Encore!

  • Symfony 4 Best practices by Nicolas Grekas - Symfony Core Team member (one-day workshop). 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! We'll build a demo app together so that you'll learn all the basic (and less basic) features that modern Symfony apps allow to build efficiently.

  • Symfony Messenger by Samuel Rozé - Symfony Core Team member and creator of the component (one-day workshop). The Messenger component just landed in Symfony 4.1. In this workshop, you will learn about: 1. Creating and handling messages as a strategy to decouple your application; 2. Configure the message routing and asynchronously handle your messages; 3. Discovering the bus middleware and creating your owns to add your custom logic; 4. An overview of using Messenger in the CQRS context (command and query buses); 5. Specifics of the AMQP and Enqueue adapters for your asynchronous processing; 6. How to customise and write your own adapters.

  • Building API-driven apps with API Platform by Kévin Dunglas - Symfony Core Team member (one-day workshop). After an overview of modern API patterns and formats (REST, Swagger, hypermedia, HATEOAS, JSON-LD, Hydra, Schema.org, GraphQL...), we'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, we'll discover how easy it is to use the client-side (JavaScript) toolkit.

  • Mastering OOP & Design Patterns by Hugo Hamon - lead dev at Dayuse.com, ex head of training at SensioLabs (two-day workshop). Object Oriented Design aka OOD is hard and not limited to designing just classes and interfaces. This workshop will help you better understand all the concepts and techniques to write cleaner, more robust and more testable object oriented code. You'll learn how to make your code respect the SOLID principles. You'll also discover the techniques to reduce the complexity of your code as well as making your classes thinner and more focused. You'll also learn how to recognize and leverage the power of design patterns (factory, adapter, composite, decorator, mediator, strategy, etc.) in order to make your code flexible, extensible, unit testable and less fragile.

    Check out the entire workshop schedule and get your combo workshop and conference ticket now! See you soon at the conference in Lisbon!


Be trained by Symfony experts - 2018-10-17 Paris - 2018-10-22 Clichy - 2018-10-22 Clichy
10/16/2018 03:10 am   Symfony Blog   Mirror   Link  

This week development activity increased in preparation for the upcoming release of Symfony 4.2. We simplified form extensions to no longer require any configuration, improved the Finder component to allow reversing the previous sorting and added new features to the profiler to display logs context and allow to filter logs by level.

Symfony development highlights

This week, 80 pull requests were merged (57 in code and 23 in docs) and 89 issues were closed (68 in code and 21 in docs). Excluding merges, 45 authors made 5,430 additions and 4,171 deletions. See details for code and docs.

2.8 changelog:

  • 270f496: [Form] fixed multi-digit seconds fraction handling
  • 9fdc64b: [Process] fixed locking of pipe files on Windows
  • bad4867: [Console] fixed multiselect choice question defaults in non-interactive mode

3.4 changelog:

  • 2f0e5d7: [Security] do not deauthenticate user when the first refreshed user has changed
  • f9aac64: [FrameworkBundle] added missing cache prefix seed attribute to XSD
  • 60f6e91: [SecurityBundle] do not override custom access decision configs
  • f89ef42: [FrameworkBundle] setting missing default paths under BC layer

Master changelog:

  • d482f0a: [WebProfilerBundle] extracted server parameters into their own tab
  • c10d2c0: [WebServerBundle] added ability to display the current hostname address when binding to 0.0.0.0
  • 52b7239: [Form] simplified the form type extension registration
  • 51f39b9: [Cache] added CacheInterface::delete() + improve CacheTrait
  • 003499d: [OptionsResolver] passed Options argument to deprecation closure
  • dce8f08: [Asset] added different protocols to be allowed as asset base_url
  • 331a24e: [Security] added port in access_control
  • bc816da, d13141f: [Finder] added a way to inverse a previous sorting
  • ea0b807: [VarDumper] allowed to use a light theme out of the box
  • d3fac86: [OptionsResolver] added support for nesting options definition
  • 631d718: [Form] allowed additional http methods in form configuration
  • 722c816: [Validator] provided file basename for FileValidator constraint messages
  • 61d336b: [WebProfilerBundle] displayed the log context in the debug pages
  • 6de1577: [WebProfilerBundle] filter logs by level
  • 620094a: [Cache] added support for connecting to Redis clusters via DSN
  • 4a4fda5: [Process] addde "wait until callback" to process class
  • 9bec1fc: [Validator] deprecated checkMX and checkHost on Email validator

Newest issues and pull requests

They talked about us

Upcoming Symfony Events

Call to Action


Be trained by Symfony experts - 2018-10-17 Paris - 2018-10-22 Clichy - 2018-10-22 Clichy
10/14/2018 03:09 am   Symfony Blog   Mirror   Link  

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  
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/ezpublish-legacy Oct 10, 2018
1 commit to master
  • @emodric 929df6b
    Fix warnings about continue inside switch on PHP 7.3 (#1387)
10/10/2018 12:11 pm   eZPublishLegacy @ GitHub   Mirror   Link  
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/ezplatform Oct 10, 2018
2 commits to master
  • @brookinsconsulting fd5cf30
    Merge remote-tracking branch 'upstream/master'
  • @andrerom db0c094
    [YMl] Add inline doc link for Memcached/Redis setups
10/10/2018 12:09 pm   eZPublishLegacy @ GitHub   Mirror   Link  
@ezecosystem
ezecosystem pushed to master in ezecosystem/ezplatform Oct 10, 2018
2 commits to master
  • @brookinsconsulting 668d364
    Merge remote-tracking branch 'upstream/master'
  • @andrerom db0c094
    [YMl] Add inline doc link for Memcached/Redis setups
10/10/2018 11:59 am   eZecosystem @ GitHub   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  
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/phpunit Oct 10, 2018
2 commits to master
  • @localheinz 2e5304d
    Fix: Run php-cs-fixer
  • @localheinz ece7b37
    Enhancement: Configure visibility_required fixer
10/10/2018 12:24 am   eZPublishLegacy @ GitHub   Mirror   Link  
@ezecosystem
ezecosystem pushed to master in ezecosystem/Sylius Oct 10, 2018
2 commits to master
10/10/2018 12:05 am   eZecosystem @ GitHub   Mirror   Link  
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/data_import Oct 10, 2018
1 commit to master
  • @peterkeung 682ef7d
    Give Administration Interface sidebar remote ID search box a unique ID
10/10/2018 12:01 am   eZPublishLegacy @ GitHub   Mirror   Link  
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/ezpublish-kernel Oct 9, 2018
2 commits to master
10/09/2018 12:11 pm   eZPublishLegacy @ GitHub   Mirror   Link  
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/ezpublish-api Oct 9, 2018
2 commits to master
10/09/2018 12:10 pm   eZPublishLegacy @ GitHub   Mirror   Link  
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/ezplatform Oct 9, 2018
2 commits to master
  • @brookinsconsulting e06976e
    Merge remote-tracking branch 'upstream/master'
  • @sunpietro f971658
    EZP-29675: Correct JMS translations config to exclude node_modules fo…
10/09/2018 12:09 pm   eZPublishLegacy @ GitHub   Mirror   Link  
@ezecosystem
ezecosystem pushed to master in ezecosystem/ezpublish-kernel Oct 9, 2018
2 commits to master
10/09/2018 11:59 am   eZecosystem @ GitHub   Mirror   Link  
@ezecosystem
ezecosystem pushed to master in ezecosystem/ezpublish-api Oct 9, 2018
2 commits to master
10/09/2018 11:59 am   eZecosystem @ GitHub   Mirror   Link  
@ezecosystem
ezecosystem pushed to master in ezecosystem/ezplatform-site-api Oct 9, 2018
2 commits to master
10/09/2018 11:59 am   eZecosystem @ GitHub   Mirror   Link  
@ezecosystem
ezecosystem pushed to master in ezecosystem/ezplatform Oct 9, 2018
2 commits to master
  • @brookinsconsulting 6dd4cfd
    Merge remote-tracking branch 'upstream/master'
  • @sunpietro f971658
    EZP-29675: Correct JMS translations config to exclude node_modules fo…
10/09/2018 11:59 am   eZecosystem @ GitHub   Mirror   Link  

Using the Right Debugging Tools

A while ago, we updated the MongoDB PHP driver's embedded C library to a new version. The C library handles most of the connection management and other low level tasks that the PHP driver needs to successfully talk to MongoDB deployments, especially in replicated environments where servers might disappear for maintenance or hardware failures.

After upgrading the C library from 1.12 to 1.13 we noticed that one of the PHP driver's tests was failing:

derick@singlemalt:~/dev/php/derickr-mongo-php-driver $ make test TESTS=tests/atlas.phpt
…
====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Atlas Connectivity Tests [tests/atlas.phpt]
=====================================================================

When running the test manually, we get:

derick@singlemalt:~/dev/php/mongodb-mongo-php-driver $ php tests/atlas.phpt
--TEST--
Atlas Connectivity Tests
--SKIPIF--
skip Atlas tests not wanted
--FILE--
PASS
mongo-php-driver/src/libmongoc/src/libmongoc/src/mongoc/mongoc-cluster.c:1852 mongoc_cluster_fetch_stream_single():
        precondition failed: scanner_node && !scanner_node->retired
Aborted

That was not good news.

The atlas.phpt test tests whether the PHP driver (through the C driver) can connect to a set of different deployments of Atlas, MongoDB's Database as a Service platform. The test makes sure we can talk to an Atlas replica set, a sharded cluster, a free tier replica set, as well as TLS 1.1 and TLS 1.2 specific deployments. The test started failing when connecting to the second provided URI (the sharded cluster).

At first I thought this was caused by the upgrade from version 1.12 to 1.13 of the C driver, but that didn't end up being the case. Let's see how we got to finding and fixing this bug.

First of all, I started GDB to see where it was failing:

derick@singlemalt:~/dev/php/mongodb-mongo-php-driver $ gdb --args php tests/atlas.phpt
GNU gdb (Debian 8.1-4+b1) 8.1
…
Reading symbols from php...done.
(gdb) run
Starting program: /usr/local/php/7.3dev/bin/php tests/atlas.phpt
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
--TEST--
Atlas Connectivity Tests
--FILE--
PASS
mongo-php-driver/src/libmongoc/src/libmongoc/src/mongoc/mongoc-cluster.c:1852 mongoc_cluster_fetch_stream_single():
        precondition failed: scanner_node && !scanner_node->retired

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.

This shows that the C driver bailed out due to a specific assertion on line 1852 of mongoc-cluster.c. This assertion reads:

BSON_ASSERT (scanner_node && !scanner_node->retired);

Which didn't really say a lot. The next thing to try is then to make a backtrace in GDB with the bt command. This revealed:

(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff41472f1 in __GI_abort () at abort.c:79
#2  0x00007ffff32cdcf1 in mongoc_cluster_fetch_stream_single (
        cluster=0x555556ba8e68, server_id=2, reconnect_ok=true, error=0x555556b95858)
        at mongo-php-driver/src/libmongoc/src/libmongoc/src/mongoc/mongoc-cluster.c:1852
#3  0x00007ffff32cd9df in _mongoc_cluster_stream_for_server (
        cluster=0x555556ba8e68, server_id=2, reconnect_ok=true, cs=0x0, reply=0x7fffffff9ee0, error=0x555556b95858)
        at mongo-php-driver/src/libmongoc/src/libmongoc/src/mongoc/mongoc-cluster.c:1762
#4  0x00007ffff32cdbe6 in mongoc_cluster_stream_for_server (
        cluster=0x555556ba8e68, server_id=2, reconnect_ok=true, cs=0x0, reply=0x7fffffff9ee0, error=0x555556b95858)
        at mongo-php-driver/src/libmongoc/src/libmongoc/src/mongoc/mongoc-cluster.c:1826
#5  0x00007ffff32ddb0a in _mongoc_cursor_fetch_stream (cursor=0x555556b95700)
        at mongo-php-driver/src/libmongoc/src/libmongoc/src/mongoc/mongoc-cursor.c:647
#6  0x00007ffff32e12a0 in _prime (cursor=0x555556b95700)
        at mongo-php-driver/src/libmongoc/src/libmongoc/src/mongoc/mongoc-cursor-find.c:40
#7  0x00007ffff32df22c in _call_transition (cursor=0x555556b95700)
        at mongo-php-driver/src/libmongoc/src/libmongoc/src/mongoc/mongoc-cursor.c:1146
#8  0x00007ffff32df54b in mongoc_cursor_next (cursor=0x555556b95700, bson=0x7fffffffa038)
        at mongo-php-driver/src/libmongoc/src/libmongoc/src/mongoc/mongoc-cursor.c:1214
#9  0x00007ffff332511c in phongo_cursor_advance_and_check_for_error (cursor=0x555556b95700)
        at mongo-php-driver/php_phongo.c:742
#10 0x00007ffff33253d9 in phongo_execute_query (
        client=0x555556ba8e60, namespace=0x7fffeaeb5d58 "test.test", zquery=0x7ffff38201c0, options=0x0,
        server_id=1, return_value=0x7ffff38200f0, return_value_used=1)
        at mongo-php-driver/php_phongo.c:810
#11 0x00007ffff3342cc3 in zim_Manager_executeQuery (execute_data=0x7ffff3820160, return_value=0x7ffff38200f0)
        at mongo-php-driver/src/MongoDB/Manager.c:492
#12 0x0000555555e41d16 in execute_internal (execute_data=0x7ffff3820160, return_value=0x7ffff38200f0)
        at /home/derick/dev/php/php-src.git/Zend/zend_execute.c:2328
…

At first glance, I couldn't really see anything wrong with this backtrace, and was still puzzled why it would abort. I decided to go for a lunch time walk and have a look at it again. I always find that walks are good for clearing my mind.

After the walk, and a cuppa tea, I looked at the backtrace again, and noticed the following curiosity:

#4  0x00007ffff32cdbe6 in mongoc_cluster_stream_for_server (
        cluster=0x555556ba8e68, server_id=2, reconnect_ok=true, cs=0x0, reply=0x7fffffff9ee0, error=0x555556b95858)
        at mongo-php-driver/src/libmongoc/src/libmongoc/src/mongoc/mongoc-cluster.c:1826

vs:

#10 0x00007ffff33253d9 in phongo_execute_query (
        client=0x555556ba8e60, namespace=0x7fffeaeb5d58 "test.test", zquery=0x7ffff38201c0, options=0x0,
        server_id=1, return_value=0x7ffff38200f0, return_value_used=1)
        at mongo-php-driver/php_phongo.c:810

In frame #10 the server_id variable is 1, whereas in frame #4 later on, the server_id variable is 2. These should have been the same.

The server ID is determined by the C driver when selecting a server to send a read or write operation to, and refers to a specific server's connection ID. The PHP driver uses this server ID when executing the query through the phongo_execute_query function, which calls the C driver's mongoc_collection_find_with_opts. The latter accepts as 3rd argument a bson_t value with options to use while executing a query. These options include the pre-selected server ID, so that the C driver does not attempt to reselect a server:

cursor = mongoc_collection_find_with_opts(collection, query->filter, query->opts,
        phongo_read_preference_from_zval(zreadPreference TSRMLS_CC));

I decided to investigate which options the PHP driver was sending to mongoc_collection_find_with_opts. A while ago I developed a GDB helper function, about which I wrote in pretty-printing BSON. I sourced this helper within my GDB instance, and switched to frame #10 to inspect the value of the query options:

(gdb) source ~/dev/php/mongodb-mongo-php-driver/src/libmongoc/.gdbinit
(gdb) frame 10

The function call uses the options from the query struct query->opts, so I used the printbson helper function to display its contents:

(gdb) printbson query->opts

Which showed:

$11 = "!\000\000\000\020serverId\000\002\000\000\000\020serverId\000\001", '\000' 
INLINE (len=33)
{
        'serverId' : NumberInt("2"),
        'serverId' : NumberInt("1")
}

There are not supposed to be two conflicting serverId elements. Unlike PHP's arrays, bson_t values can have the same key appear multiple times. Although the C driver had selected server ID 1 for this query, server 2 was used because it was the first serverId element in the options struct. But why where there two values in the first place?

If you look at the PHP test, you see the following:

executeQuery('test.test', $query));
                …
        } catch(Exception $e) {
                …
        }
}
?>

From this follows that we create the Query object, assign it to $query, and then use the same variable for each iteration. Somehow, we were not resetting the query options back to default before we used them, resulting in a duplicate serverId field. Once we figured out the problem, creating the fix was easy enough: Make sure we use a clean query->opts struct before we pass it to the mongoc_collection_find_with_opts function.

Debugging this issue was made lot easier by having the right debugging tools, and this case shows that spending time on writing the GDB helper function printbson earlier in the year paid off. With this bug fixed, we could release a new patch version of the MongoDB Driver for PHP.

Happy hacking!

10/09/2018 04:26 am   derickrethans.nl   Mirror   Link  
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/LegacyBridge Oct 8, 2018
1 commit to master
  • @SalvatorePollaci f7421ce
    Purge Url Alias Path Cache Items on Content Publish (#162)
10/08/2018 12:19 pm   eZPublishLegacy @ GitHub   Mirror   Link  
@ezecosystem
ezecosystem pushed to master in ezecosystem/Sylius Oct 8, 2018
2 commits to master
  • @pamil 52833ef
    Merge pull request #9798 from SyliusBot/crowdin/master-2018-10-08-04-27
  • 593bc18
    [Translations] Updated translations from Crowdin
10/08/2018 12:05 pm   eZecosystem @ GitHub   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  
@ezecosystem
ezecosystem pushed to master in ezecosystem/Sylius Oct 7, 2018
2 commits to master
  • @lchrusciel 298b77b
    Merge pull request #9789 from adrienlucas/autoconfigure-fixtures
  • @adrienlucas d5e5699
    [FixtureBundle] Add autoconfiguration for instance of FixtureInterface
10/07/2018 12:05 am   eZecosystem @ GitHub   Mirror   Link  
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/TagsBundle Oct 6, 2018
2 commits to master
10/06/2018 12:30 pm   eZPublishLegacy @ GitHub   Mirror   Link  
@ezecosystem
ezecosystem pushed to master in ezecosystem/TagsBundle Oct 6, 2018
2 commits to master
10/06/2018 12:06 pm   eZecosystem @ GitHub   Mirror   Link