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

[5.7] Allow ENV to control paths of cache files for services, packages and routes #27389

Merged
merged 1 commit into from Feb 4, 2019

Conversation

Projects
None yet
5 participants
@divand
Copy link
Contributor

divand commented Feb 2, 2019

In order to override paths of all files in bootstrap/cache, add env vars below:

APP_SERVICES_CACHE
APP_PACKAGES_CACHE
APP_ROUTES_CACHE

env var "APP_CONFIG_CACHE" already defined in commit 578bc83#diff-7b18a52eceff5eb716c1de268e98d55d

@divand divand changed the title Allow ENV to control paths of cache files for services, packages and routes [5.7] Allow ENV to control paths of cache files for services, packages and routes Feb 2, 2019

@taylorotwell

This comment has been minimized.

Copy link
Member

taylorotwell commented Feb 2, 2019

Do you have an actual use case for this in your application? If so, can you please describe it.

@divand

This comment has been minimized.

Copy link
Contributor Author

divand commented Feb 2, 2019

@taylorotwell, sure!
My app has no rights to write to "bootstrap/cache/" and "storage/".
So for "storage/" I'm using this workaround:
in .env:

VIEW_COMPILED_PATH="/tmp"
SESSION_DRIVER="cookie"
LOG_CHANNEL="stderr"

But I cannot override path for "bootstrap/cache/" natively. That's why I suggest to extend the ability to override all of paths which are using to write to fs.

@deleugpn

This comment has been minimized.

Copy link
Contributor

deleugpn commented Feb 3, 2019

I don't know if this is the best implementation, but in terms of feature I think this is gonna become a must-have sooner or later with the rise of AWS Lambda and the fact that only /tmp is writable.
At the moment, anybody running Laravel on Lambda is doing the changes to the index.php or boostrap/app.php. An environment variable is a much cleaner solution.

@taylorotwell taylorotwell merged commit b402b56 into laravel:5.7 Feb 4, 2019

2 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@taylorotwell

This comment has been minimized.

Copy link
Member

taylorotwell commented Feb 4, 2019

@deleugpn this change isn't required to run Laravel (5.8 at least) on Lambda. Trust me... I would know 😉

@deleugpn

This comment has been minimized.

Copy link
Contributor

deleugpn commented Feb 4, 2019

@taylorotwell I remember going through all your commits on master branch to see if I could find anything related to Lambda when you teased about Vapor. Did I miss it somehow?

@martinbean

This comment has been minimized.

Copy link
Contributor

martinbean commented Feb 6, 2019

I remember going through all your commits on master branch to see if I could find anything related to Lambda when you teased about Vapor. Did I miss it somehow?

@taylorotwell Not missed it. Just think it’s a, “Wait until Laracon” deal.

@deleugpn

This comment has been minimized.

Copy link
Contributor

deleugpn commented Feb 13, 2019

@martinbean I've been battling a lot with getting everything to work on Lambda and I feel like all my efforts are going to be thrown out the window after Vapor release.

@tomswinkels

This comment has been minimized.

Copy link
Contributor

tomswinkels commented Feb 15, 2019

@divand @taylorotwell Why this folders not always / default write to the storage folder?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment