protected function detectFsRoot()
    {
        Eresus_Kernel::log(__METHOD__, LOG_DEBUG, 'start');
        switch (true)
        {
            case Eresus_Kernel::isCLI():
                $path = reset($GLOBALS['argv']);
                Eresus_Kernel::log(__METHOD__, LOG_DEBUG, 'Using global $argv variable: %s', $path);
                $path = dirname($path);
                break;
            default:
                Eresus_Kernel::log(__METHOD__, LOG_DEBUG, 'Using $_SERVER["SCRIPT_FILENAME"]: %s',
                    $_SERVER['SCRIPT_FILENAME']);
                $path = dirname($_SERVER['SCRIPT_FILENAME']);
        }

        $path = Eresus_FS_Tool::normalize($path);
        Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '"%s"', $path);

        return $path;
    }