Elasticsearch-php: 8.0 meta ticket

Created on 8 May 2020  路  6Comments  路  Source: elastic/elasticsearch-php

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;
  • [ ] redesign the async HTTP request API;
  • [ ] 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);
  • [ ] 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!

meta

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

All 6 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kabudu picture kabudu  路  4Comments

enumanc picture enumanc  路  5Comments

ls
ssanchezromero picture ssanchezromero  路  6Comments

adoerrES picture adoerrES  路  5Comments

paulhuisman picture paulhuisman  路  6Comments