Closed ghost closed 8 years ago
Data that must not be deleted between "restarts" of your application must not go into "var" directory. Go for the "app" dir, or eventually a "data" one at the root of your Symfony installation.
"var" is a bit more meant to hold cache, logs, volatile things like that.
As I understand "var" is a directory which contains the data which is different on any installation, for example config, cache, logs, storage files, etc. As I thought your current "data" folder does the same.
That's true, both /var and /data handle installation-specific data. I can be wrong, I'm not a Symfony expert, but that's how I understand it with both documentation and common sense :
Config files must go to /app, not /var . For two reasons : 1) it is not a volatile data, and 2) it is not really a "data" like an image, or post informations for a forum, it is tighly coupled to the core of your Symfony app.
app/config/
.data/
directory in Symfony 2.x or Symfony 3.x directory structure.var/
directory contains "Generated files (cache, logs, etc.)".
Source: http://symfony.com/doc/current/quick_tour/the_architecture.htmlIMO: I think something like an user database (which is different on each installation) should be moved to var/data/
. If the data is not changed between installations it should be something in a sub-directory of the app/
folder.
I've thought a little bit about this issue. The Linux Filesystem Hierarchy Standard
contains a /var
directory which contains log files, caches and something like that. In this point I would agree to you.
Otherwise some applications use the /var
directory for some more persistent things like /var/www/
for web applications.
The Symfony documentation not really contains a folder for persistent data. I think we should discuss this more in the Symfony community to understand if we should so something like /data/
or /var/data/
.
I've started an issue on the Symfony documentation about this. I think you should read the opinions of the Symfony developers there: https://github.com/symfony/symfony-docs/issues/6095
I will. :)
@Pazns I think you should handle it as described in this comment: https://github.com/symfony/symfony-docs/issues/6095#issuecomment-170898929
I closely followed this discussion.
This issue was moved to fruux/Baikal2#3
Currently there is a
data
directory. The new Symfony3 structure has avar
directory. Own data should be saved to/var/data/
and config files to/var/config/
.(Edit: config files to
/app/config/
, sorry for my mistake).