My cakephp app relies on the app/webroot/img/product_images
directory existing and being writeable.
Right now I make sure the folder exists with a .empty
file so git will track the empty directory but I have to remember to chown/chmod the folder manually when I clone my repo to a new server.
Is there any way in CakePHP or pure PHP to automatically check and set the permissions for this folder?
As mentioned in "Git changes the permissions on a single file unexplainably", if:
umask
(set in your profile) compatible with the write you want (like0002
for 775)you should get the right permissions on the elements you are cloning.