private static function getHomeDir()
    {
        // Linux/Unix-like systems.
        if ($homeDir = getenv('HOME')) {
            return $homeDir;
        }

        $homeDrive = getenv('HOMEDRIVE');
        $homePath = getenv('HOMEPATH');

        return ($homeDrive && $homePath) ? $homeDrive . $homePath : null;
    }