cedaro / satispress

Expose installed WordPress plugins and themes as Composer packages.
500 stars 49 forks source link

Move packages into a subdirectory in the cache directory #69

Closed bradyvercher closed 5 years ago

bradyvercher commented 5 years ago

Packages are currently cached in the top level of the cache path defined in the service provider, so the directory structure looks something like this:

├─ wp-content
   └─ uploads
      └─ satispress-xxxx
         └─ akismet
            └─ akismet-4.0.8.zip

That doesn't really allow for adding anything else in that same location that needs to be stored on the filesystem, so I'm thinking packages should be moved to a /packages subdirectory:

├─ wp-content
   └─ uploads
      └─ satispress-xxxx
         ├─ cache
         ├─ logs
         ├─ packages
         │  └─ akismet
         │     └─ akismet-4.0.8.zip
         └─ .htaccess
GaryJones commented 5 years ago

Why not:

├─ wp-content
   ├─ satispress[-xxxx]
   │     ├─ cache
   │     └─ logs
   └─ uploads
      └─ satispress-xxxx
         ├─ akismet
         │  └─ akismet-4.0.8.zip
         └─ .htaccess

cache/ and logs/ are nothing to do with Uploads.

bradyvercher commented 5 years ago

The /uploads directory is usually the only location that's reliably writable on most servers and it's pretty standard for plugins to use it for data that's stored on the filesystem. Most backup plugins use it as does WooCommerce for logs.

It's also usually configured to be excluded from VCS repos and symlinked during deployments, so using something directly in /wp-content might cause issues.