[GH-ISSUE #746] PHP7: dependency on "aws/aws-sdk-php": "^2.4.9" #281

Closed
opened 2026-03-04 02:13:44 +03:00 by kerem · 3 comments
Owner

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

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).
kerem closed this issue 2026-03-04 02:13:45 +03:00
Author
Owner

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

<!-- gh-comment-id:198021720 --> @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).
Author
Owner

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

<!-- gh-comment-id:198028799 --> @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?
Author
Owner

@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-php may 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 in require: 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).

Or, alternatively, would you suggest simply not running these tests and removing the build-dep?

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)

<!-- gh-comment-id:198035217 --> @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-php` may 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 in `require`: 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). > Or, alternatively, would you suggest simply not running these tests and removing the build-dep? If the SDK is not available, the DynamoDbHandler tests will be skipped: https://github.com/Seldaek/monolog/blob/bf712e444203327111f817f69e803890354960b7/tests/Monolog/Handler/DynamoDbHandlerTest.php#L23 So this might be the best solution (the DynamoDbHandler is far from being the common usage of Monolog)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#281
No description provided.