8000 [framework-bundle][console] Introduce APP_DIR environment variable by voronkovich · Pull Request #133 · symfony/recipes · GitHub
[go: up one dir, main page]

Skip to content

[framework-bundle][console] Introduce APP_DIR environment variable #133

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

Closed
wants to merge 1 commit into from
Closed

[framework-bundle][console] Introduce APP_DIR environment variable #133

wants to merge 1 commit into from

Conversation

voronkovich
Copy link
Contributor
Q A
License MIT

In the Symfony demo application (see symfony/demo#617) we need to set an absolute path to a database, but we can't get it in the .env file. This PR introduces an environment variable which contains the absolute path to the application's folder (it works like the %kernel.project_dir% container parameter).

Example:

# .env
DATABASE_URL="sqlite:///${APP_DIR}/var/data/blog.sqlite"

symfony-bot
symfony-bot previously approved these changes Jul 28, 2017
@fabpot
Copy link
Member
fabpot commented Aug 1, 2017

If APP_DIR should be available, it should be defined in the Kernel, not here. I propose that you either submit a PR on symfony/symfony or an issue there instead.

@fabpot fabpot closed this Aug 1, 2017
@javiereguiluz
Copy link
Member

By the way, given that this env var is the project dir, shouldn't be called PROJECT_DIR instead of APP_DIR? (or SYMFONY_PROJECT_DIR)

@voronkovich
Copy link
Contributor Author

@fabpot, I think this problem can't be solved in the Kernel, because we can't instantiate the Kernel before loading the .env file (we need the APP_ENV and the APP_DEBUG variables).

VolCh pushed a commit to VolCh/recipes that referenced this pull request Nov 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0