We currently manage Drupal site files and directories in a disjointed fashion. We build multiple arrays to respectively chmod(), chown() and chgrp() in _provision_drupal_create_directories(), and provide separate hooks for each. We also blacklist execution of files in sites/example.com/files/ in site vhosts, where I think we'd be better off going with a whitelist instead.

I'd like to consolidate all of this into a unified filesystem array. Each file or directory could be represented by an object that has chmod/chown/chgrp/vhost-whitelist/etc. properties, or something along those lines. This would then allow us to have a single alter hook, rather than the current 3 (4+ if we include changing the vhost).

Sane defaults could be provided by the class, which could derive from Provision_FileSystem perhaps. This would give us the flexibility of overriding a specific file's or directory's handling by replacing the object with one from a derived class, thus overriding its behaviour. For example, if we're mounting a directory via NFS, we may know that chmods will fail and so could make it a null op

I'm not sure of the implementation strategy, but consolidating our filesystem handling certainly seems worthwhile. Thoughts?