sabre-io / Baikal

Baïkal is a Calendar+Contacts server
https://sabre.io/baikal/
GNU General Public License v3.0
2.5k stars 288 forks source link

Use new Symfony 3 directory structure for /data #427

Closed ghost closed 8 years ago

ghost commented 8 years ago

Currently there is a data directory. The new Symfony3 structure has a var 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).

Pazns commented 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.

ghost commented 8 years ago

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.

Pazns commented 8 years ago

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.

ghost commented 8 years ago
  1. Configuration files should be in app/config/.
  2. There is no official data/ directory in Symfony 2.x or Symfony 3.x directory structure.
  3. The var/ directory contains "Generated files (cache, logs, etc.)". Source: http://symfony.com/doc/current/quick_tour/the_architecture.html

IMO: 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.

ghost commented 8 years ago

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

ghost commented 8 years ago

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

Pazns commented 8 years ago

I will. :)

ghost commented 8 years ago

@Pazns I think you should handle it as described in this comment: https://github.com/symfony/symfony-docs/issues/6095#issuecomment-170898929

Pazns commented 8 years ago

I closely followed this discussion.

evert commented 8 years ago

This issue was moved to fruux/Baikal2#3