php-pds / skeleton

Standard PHP package skeleton.
Creative Commons Attribution Share Alike 4.0 International
2.32k stars 167 forks source link

Missing tmp, cache and log directory #8

Closed odan closed 7 years ago

odan commented 7 years ago

I would love to see a standard temp and cache and log files directory.

For example:

tmp/          # temp files
tmp/cache/    # internal cache files
tmp/log/      # log files

or just like this

tmp/          # temp files
cache/        # internal cache files
log/          # log files
Revisor commented 7 years ago

Shouldn't these directories be defined by the system or the client of the packages?

tmp: http://php.net/manual/en/function.sys-get-temp-dir.php log: /var/log or client-defined cache: client-defined, not inside the package

What do you think?

pmjones commented 7 years ago

Hi @odan -- thanks for taking the time to review and comment.

The problem with adding a top-level tmp/ is that, per the sample, it's just not that common: 115 occurrences in 65617 packages. Directories for log/ and cache/ are similar. (The first-pass results are at https://github.com/php-pds/skeleton_research/blob/1.x/results/01-dirs.txt if you want to inspect them.)

Now, to be clear, those directories are not forbidden by the standard, only that the standard has little support for specifying a particular name when those kinds of directories are present.

guenti commented 7 years ago

In my opinion this skeleton will be a basic standard and not a "complete" structure. The directories and files in this skeleton are a boilerplate, I think. Additional folders or files are welcome, but with uniform naming, i.e.

cxj commented 7 years ago

How closely should a package mirror its ultimate deployment environment?

I usually think of a package as something that is deployed into an existing environment of some kind. The package contains only what is absolutely needed to run (or develop) the package, allowing the user to specify the run-time environment. For example, where I work, all logging goes to a central logging server rather than get scattered into the filesystems of load balanced host VMs.

odan commented 7 years ago

Ok, thank you all. In this context these folders are not really necessary and could be defined like you want.