-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(php): Add Retry Strategy & cache for the PHP client #95
feat(php): Add Retry Strategy & cache for the PHP client #95
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not review all the Retry Strategy because it's code from for the existing client, but the rest is looking good !
Can you add php to playground.sh
pls ?
"guzzlehttp/psr7": "^2.0", | ||
"psr/http-message": "^1.0", | ||
"psr/log": "^1.0 || ^2.0 || ^3.0", | ||
"psr/simple-cache": "^1.0 || ^2.0 || ^3.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you pin the last version for all deps pls ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this has been recently set this way on the PHP repo to ensure the compatibility with latest PHP versions : https://github.com/algolia/algoliasearch-client-php/pull/696/files . So I'd keep it this way for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we keep having issue with support for old version of software maybe now is a good time to get rid of them and force clients to update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With PHP, multiple version (from 7.4 to 8.1) are coexisting, that's why we have such config in the composer.json . We can discuss it later with some PHP experts but for now, as it's not really related to the retry strategy itself, I would postpone this potential decision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added to APIC-271
/** @var array Hash of readable and writable stream types */ | ||
private static $readWriteHash = [ | ||
'read' => [ | ||
'r' => true, 'w+' => true, 'r+' => true, 'x+' => true, 'c+' => true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be factorized to an array converted to an associative array ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'http' => 80, | ||
'https' => 443, | ||
'ftp' => 21, | ||
'gopher' => 70, | ||
'nntp' => 119, | ||
'news' => 119, | ||
'telnet' => 23, | ||
'tn3270' => 23, | ||
'imap' => 143, | ||
'pop' => 110, | ||
'ldap' => 389, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is overkill, we only need http
and https
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working nicely ! A next step could be to add dotenv, like the other playgrounds
🧭 What and Why
🎟 JIRA Ticket: APIC-238
Changes included: