Items for the new 8.0 release of elastic/elasticsearch-php:
PSR-7 and PSR-18 standards (maybe using HTTPlug, not yet decided, see #990);If you have feedback or things that you would like to have in 8.0 version please comment, thanks!
Remove src/autoload.php and the corresponding entry from composer.json.
Unfortunately this currently prevents using the new Opcache preloading feature (PHP 7.4) with Symfony 4.4.
@hacfi yes, we will definitely remove the src/autoload.php. We introduced it only because a BC break case. Btw, can you give me more detail about the issue with Symfony 4.4? Thanks!
@ezimuel Symfony 4.4 introduced a new feature (see https://symfony.com/blog/new-in-symfony-4-4-preloading-symfony-applications-in-php-7-4) that makes use of PHP 7.4's opcache.preload= option. When you use any class of this package in your app the Elasticsearch\ classes will be preloaded automatically when the server starts. The problem is that when your application includes Composer's autoloader it will run vendor/elasticsearch/elasticsearch/src/autoload.php and throws some warnings that those classes have already been defined. If you want a reproducible test repo let me know and I'll set it up. I created a fork removing the autoload.php and it fixes the issue.
Just thought of a simple fix for that: call class_exists($alias, false) before you actually create the alias. That's also how it's fixed in another repo that has this issue: https://github.com/hoaproject/Consistency/pull/36/files
@hacfi thanks for the info. I'll provide a PR to fix this.
I implemented a first version of the HTTP transport layer for the next Elastic PHP clients: https://github.com/elastic/elastic-transport-php
Most helpful comment
I implemented a first version of the HTTP transport layer for the next Elastic PHP clients: https://github.com/elastic/elastic-transport-php