public static function mapPath($virtualPath = null) {
        if (empty($virtualPath)) {
            return PHPMVC_ROOT_PATH;
        }

        if ($virtualPath[0] == '~' || $virtualPath[0] == '/') {
            $result = PHPMVC_ROOT_PATH;
            $result .= trim(substr($virtualPath, 1, strlen($virtualPath) - 1), '\\/');
        }
        elseif ($virtualPath[0] == '.') {
            $result = realpath(PHPMVC_ROOT_PATH . $virtualPath);
        }
        else {
            $result = PHPMVC_ROOT_PATH . $virtualPath;
        }

        return self::normalizePathSeparators($result);
    }