-
Notifications
You must be signed in to change notification settings - Fork 41
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
Include PHP Version to the USER-AGENT header when make a request to Omise API. #56
Conversation
lib/omise/res/OmiseApiResource.php
Outdated
@@ -250,7 +250,7 @@ private function _executeTest($url, $requestMethod, $key, $params = null) | |||
*/ | |||
private function genOptions($requestMethod, $userpwd, $params) | |||
{ | |||
$user_agent = "OmisePHP/".OMISE_PHP_LIB_VERSION; | |||
$user_agent = "OmisePHP/" . OMISE_PHP_LIB_VERSION . " PHP/" . phpversion(); |
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.
It seems that current coding convention does not have spaces between dot (.) used for concatenation. Does this matter?
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.
@iwat nice catch 👍 yah, usually I have 1 space between string concat in other plugin projects.
But better to not do it here for now, as you mentioned.
Will remove
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.
Note that the version string returned by phpversion() may include more information than expected: "5.5.9-1ubuntu4.17", for example. source
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.
noted 👌
👍 LGTM Unit test passed on 5.3, 5.5, 5.6, 7.0, 7.1. |
👍 |
1. Objective
Enhance Omise-PHP library, that Omise can provide an appropriate and better support on each of PHP environment by knowing PHP version from clients.
Related information:
Related issue(s): 🙅
2. Description of change
USER-AGENT
header when make a request to the Omise APIs.3. Quality assurance
🔧 Environments:
✏️ Details:
Try make any request to Omise API, at the requested log in Omise dashboard, you will see
PHP/x.y.z
appeared at theUSER AGENT
section.4. Impact of the change
No impact.
5. Priority of change
Normal.
6. Additional Notes