public static function isDirCS($sDir)
    {
        if (array_key_exists($sDir, static::$aIsDirCache)) {
            return static::$aIsDirCache[$sDir];
        }

        $aDirBits = explode(DIRECTORY_SEPARATOR, $sDir);
        $bResult  = true;
        while (count($aDirBits) > 1) {
            $sDirectory     = array_pop($aDirBits);
            $sDirectoryPath = implode(DIRECTORY_SEPARATOR, $aDirBits);
            $aDirectories   = array_map(function ($sDirectory) {
                return basename($sDirectory);
            }, glob($sDirectoryPath . DIRECTORY_SEPARATOR . '*', GLOB_NOSORT | GLOB_ONLYDIR));

            if (!in_array($sDirectory, $aDirectories)) {
                $bResult = false;
                break;
            }
        }

        static::$aIsDirCache[$sDir] = $bResult;
        return $bResult;
    }