elasticsearch-php icon indicating copy to clipboard operation
elasticsearch-php copied to clipboard

8.0 meta ticket

Open ezimuel opened this issue 4 years ago • 7 comments

To-do list

Items for the new 8.0 release of elastic/elasticsearch-php:

  • [x] redesign the HTTP transport layer using PSR-7 and PSR-18 standards (maybe using HTTPlug, not yet decided, see #990);
  • [x] redesign the endpoint code generator;
  • [x] redesign the async HTTP request API;
  • [x] refactor the endpoint code generator for managing multiple URLs for paths;
  • [ ] add helper function to escape query (see #620);
  • [ ] redesign the API doc generation (we are using the Sami library that is not supported anymore);
  • [x] redesign the YAML test runner using PHPUnit 9:
    • [ ] collects test for each endpoint (use of different testsuite of PHPUnit);
    • [ ] support all the features of YAML integration test (see Test Suite specifications);
    • [ ] Add a HTTP request/response output log for debugging;

If you have feedback or things that you would like to have in 8.0 version please comment, thanks!

ezimuel avatar May 08 '20 20:05 ezimuel

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 avatar May 20 '20 00:05 hacfi

@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 avatar May 20 '20 14:05 ezimuel

@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.

hacfi avatar May 20 '20 16:05 hacfi

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 avatar May 20 '20 16:05 hacfi

@hacfi thanks for the info. I'll provide a PR to fix this.

ezimuel avatar May 21 '20 05:05 ezimuel

I implemented a first version of the HTTP transport layer for the next Elastic PHP clients: https://github.com/elastic/elastic-transport-php

ezimuel avatar Feb 11 '21 11:02 ezimuel

Can you add the tasks to the project https://github.com/elastic/elasticsearch-php/projects/2 ?

Then, what can we do to move this along? Every time I look at NewRelic and see GuzzleHttp\Ring it makes me sigh.

joshua-bn avatar Aug 31 '21 20:08 joshua-bn