Skip to content
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

Make sure /tmp/log dir exists #43

Merged
merged 4 commits into from
Jul 16, 2021
Merged

Make sure /tmp/log dir exists #43

merged 4 commits into from
Jul 16, 2021

Conversation

vhenzl
Copy link
Contributor

@vhenzl vhenzl commented Jul 7, 2021

Resolves #42.

Copy link
Member

@t-richard t-richard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for starting this!

Just a minor comment.

Could you also add tests that tries to write to the log dir directly ? I'd say one in an http context and one in a console context.

We had some differences in the past between the lifecycle of the Kernel in console and in http, so better be on the safe side of things 🙂

You can take a look at existing tests, they already do that (run the console and http request).

src/BrefKernel.php Outdated Show resolved Hide resolved
Copy link
Member

@mnapoli mnapoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On top of @t-richard's comment about tests, I've added minor feedback.

Thanks a lot for taking the time to fix this!

* Even though applications should never write into it on Lambda, there are parts of Symfony
* (like "about" CLI command) that expect the log dir exists, so we have to make sure of it.
*
* @see https://github.com/brefphp/symfony-bridge/issues/42
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome thanks for the comment, that makes maintenance much easier!

src/BrefKernel.php Outdated Show resolved Hide resolved
src/BrefKernel.php Show resolved Hide resolved
src/BrefKernel.php Outdated Show resolved Hide resolved
Copy link
Member

@t-richard t-richard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just small naming things.

But it looks good to me, thanks @vhenzl !

tests/Functional/LogDirTest.php Outdated Show resolved Hide resolved
tests/Functional/LogDirTest.php Outdated Show resolved Hide resolved
@mnapoli mnapoli added the bug Something isn't working label Jul 16, 2021
@mnapoli
Copy link
Member

mnapoli commented Jul 16, 2021

Thank you @vhenzl and @t-richard!

@mnapoli mnapoli merged commit bd40727 into brefphp:master Jul 16, 2021
@vhenzl vhenzl deleted the pr/fix-42 branch July 16, 2021 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BrefKernel should make sure /tmp/log dir exists
3 participants