mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 16:15:49 +03:00
[GH-ISSUE #746] PHP7: dependency on "aws/aws-sdk-php": "^2.4.9" #281
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#281
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nacc on GitHub (Mar 17, 2016).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/746
Hello,
I'm working on migrating Ubuntu 16.04 to a PHP7.0 only base. But I'm hitting a bit of an issue with php-monolog & aws-sdk-for-php & symfony. Symfony (2.7.9, which is currently in Debian/Ubuntu) depends on php-monolog. But php-monolog depends on, as mentioned in $subject, "aws/aws-sdk-php":"^2.4.9", which as I understand it is >= 2.4.9 << 3.0.0.
That being said, that implies the usage of https://github.com/aws/aws-sdk-php/tree/2.8 as the latest release of a compatible AWS SDK (2.8.27). That, in turn, based up on composer.json, depends on "guzzle/guzzle": "~3.7". Except that not only is guzzle (aka guzzle3, afaict) deprecated/EOL, but also it doesn't successfully test with PHP7 (curl issues, etc.).
While I understand this is not really a monolog issue in and of itself, I would appreciate any guidance you could provide on how we might approach this (the Monolog tests themselves explicitly throw RuntimeExceptions when invoked against v3 of the AWS SDK).
@stof commented on GitHub (Mar 17, 2016):
There is no such dependency in Monolog's composer.json. There is only a dev requirement on
aws/aws-sdk-php(used to run the complete Monolog testsuite).@nacc commented on GitHub (Mar 17, 2016):
@stof: Thank you for the clarification, you're right. However, the way Debian/Ubuntu generate package dependencies given composer.json is require-dev become Build-Depends. I see that the Build-Depends is for the tests, but also src/Monolog/Handler/DynamoDbHandler.php explicitly checks for 2.x of the API and errors out at runtime, which does seem to make it a runtime dependency in practice too?
So if we wanted to move to v3 of the AWS SDK, could we simply remove the Dynamo support? Or is there a version that is compatible with v3?
Or, alternatively, would you suggest simply not running these tests and removing the build-dep?
@stof commented on GitHub (Mar 17, 2016):
Then report an issue to the Debian/Ubuntu team (or use Composer to install dependencies, which is the installation way supported by Monolog).
aws/aws-sdk-phpmay indeed be used at runtime, but only if you want to use an AWS-based feature (i.e. sending your logs to AWS DynamoDb, as I don't think there is another one). This is why it is not listed inrequire: it is not a mandatory dependency (and won't be needed by at least 99% of the people using Monolog).Removing DynamoDbHandler from Monolog is not an option (it would be a BC break, and mean you would not be distributing Monolog anymore if you do it only on packaging).
Supporting both v2 and v3 in the codebase would be accepted (adding the necessary check inside DynamoDbHandler to support both). But a pull request needs to be sent (this handler was contributed by the community, and I'm almost sure Jordi does not use it and so won't add support for v3 himself).
If the SDK is not available, the DynamoDbHandler tests will be skipped:
github.com/Seldaek/monolog@bf712e4442/tests/Monolog/Handler/DynamoDbHandlerTest.php (L23)So this might be the best solution (the DynamoDbHandler is far from being the common usage of Monolog)