silverstripe/sapphire — pull request #1299 by sminnee (2013-03-18 02:37:34+00:00)
Title: NEW: Move temp data into a user-specific subfolder, to stop temp-permission bugs from occurring.

Anyone who has run "sudo -u www-data ./framework/sake dev/build" knows that SilverStripe's temp folder permissions can be very brittle. This patch resolves this by making the temp folder user-specific.

To minimise directory pollution it first creates a chmod 777 parent folder with the same name as the current folder. It then creates a subfolder of this with the same name as the current user.

The positive impact of this change is that sake can be used without fear of messing up file permissions. This means, among other things, that we can put a Composer post-update-cmd into the installer to run dev/build. Progress!

The negative impact is that you will get two caches if you run sake as a different user. However, that is much better than the current situation - which is a bunch of bugs - and if you're concerned about that, you still have the option of running sake as www-data.