Sweil/Frogsystem-2 — pull request #95 by Thoronador (2013-07-11 20:25:51+00:00)
Title: remove call to exec() and replace it by alternative functions

The exec() function is usually disabled in most hosted environments, because of security concerns. Furthermore the call to 'whoami' won't work on Windows servers running PHP, so we should be more portable in determining the current user's name.

Yes, people should usually avoid Windows as a server system OS, but nevertheless there are PHP binaries for Windows, too, so we should try to support that as well.

The replacement function for Windows, get_current_user(), might return wrong results, because the user who owns the script might be different from the user who runs PHP, but the POSIX functions used for systems with POSIX support should properly return the actual user's name. So everything's fine on Linux and POSIX-compatible systems. :)