public static function addTag($tag, $class = null)
    {
        $tags = array();
        if (is_string($tag)) {
            if (is_null($class)) {
                $class = ucwords("{$tag}_Tag");
            }
            $tags[$tag] = $class;
        } elseif (is_array($tag)) {
            $tags = $tag;
        }

        foreach ($tags as $tag => $tagClass) {
            if (is_integer($tag)) {
                unset($tags[$tag]);
                $tag = $tagClass;
                $tagClass = ucwords("{$tagClass}_Tag");
            }
            if (!class_exists($tagClass, false)) {
                throw new H2o_Error("{$tagClass} tag is not found");
            }
            $tags[$tag] = $tagClass;
        }
        self::$tags = array_merge(self::$tags, $tags);
    }