`get_current_user()` returns the *owner* of the currently executed PHP file, so `cli-script.php` (see http://www.php.net/manual/en/function.get-current-user.php). On Windows, it returns the process owner, but that's just hinted at in a comment. Sounds like we need `posix_getuid()`, but that's not defined on Windows. Gotta love PHP...

Symfony2 solves the same problem by using filesystem ACLs, and falling back to 775: http://symfony.com/doc/2.0/book/installation.html ("Setting up Permissions")