Initializes the tag: convert data and create package.

@param VcsDriverInterface $driver
@param string             $packageName
@param string             $tag
@param string             $identifier
@param string             $parsedTag
439176
protected function initTagAddPackage(VcsDriverInterface $driver, $packageName, $tag, $identifier, $parsedTag)
    {
        $packageClass = 'Fxp\Composer\AssetPlugin\Package\LazyCompletePackage';
        $data = $this->createMockOfPackageConfig($packageName, $tag);
        $data['version'] = $this->assetType->getVersionConverter()->convertVersion($tag);
        $data['version_normalized'] = $parsedTag;

        // make sure tag packages have no -dev flag
        $data['version'] = preg_replace('{[.-]?dev$}i', '', (string) $data['version']);
        $data['version_normalized'] = preg_replace('{(^dev-|[.-]?dev$)}i', '', (string) $data['version_normalized']);

        $packageData = $this->preProcessAsset($data);
        $package = $this->loader->load($packageData, $packageClass);
        $lazyLoader = $this->createLazyLoader('tag', $identifier, $packageData, $driver);
        /* @var LazyCompletePackage $package */
        $package->setLoader($lazyLoader);

        if (!$this->hasPackage($package)) {
            $this->addPackage($package);
        }
    }
855206
private function extendContainer($tag, Definition $definition, $identifier = '')
    {
        if ('' !== $identifier) {
            $identifier .= '.';
        }

        $this->container
          ->setDefinition("$this->configKey.$identifier$tag", $definition)
          ->addTag($tag);
    }
261236
public static function makeSystemCategoryTags(&$tags, $uid, $tablename)
    {
        $categories = SearchHelper::getCategories($uid, $tablename);
        if (count($categories['uid_list'])) {
            foreach ($categories['uid_list'] as $category_uid) {
                SearchHelper::makeTags($tags, array('syscat' . $category_uid));
            }
        }
    }
730007
public function convert(\DOMElement $parent, TagDescriptor $tag)
    {
        $description = $this->getDescription($tag);

        $child = new \DOMElement('tag');
        $parent->appendChild($child);

        $child->setAttribute('name', str_replace('&', '&amp;', $tag->getName()));
        $child->setAttribute('line', $parent->getAttribute('line'));
        $child->setAttribute('description', str_replace('&', '&amp;', $description));
        $this->addTypes($tag, $child);

        // TODO: make the tests below configurable from the outside so that more could be added using plugins
        if (method_exists($tag, 'getVariableName')) {
            $child->setAttribute('variable', str_replace('&', '&amp;', $tag->getVariableName()));
        }
        if (method_exists($tag, 'getReference')) {
            $child->setAttribute('link', str_replace('&', '&amp;', $tag->getReference()));
        }
        if (method_exists($tag, 'getLink')) {
            $child->setAttribute('link', str_replace('&', '&amp;', $tag->getLink()));
        }
        if (method_exists($tag, 'getMethodName')) {
            $child->setAttribute('method_name', str_replace('&', '&amp;', $tag->getMethodName()));
        }

        return $child;
    }
446839
protected function processTaggedServices(ContainerBuilder $container, $manager, $tag, $method, $params = array())
    {
        if (!$container->hasDefinition($manager)) {
            return;
        }

        $definition = $container->getDefinition($manager);

        $taggedServices = $container->findTaggedServiceIds($tag);

        foreach ($taggedServices as $id => $attributes) {
            $methodParams = array();

            if (!empty($attributes)) {
                foreach ($params as $param) {
                    if (isset($attributes[0][$param])) {
                        $methodParams[] = $attributes[0][$param];
                    }
                }
            }

            $definition->addMethodCall(
                $method,
                array_merge(array(new Reference($id), $id), $methodParams)
            );
        }
    }
1003867
protected function setTagFor( $paragraphId, $tag )
    {
        $rows       = 0;
        $tagSql     = $this->sql( $this->getTableInSchema( static::$tagTableName ) );
        $tagJoinSql = $this->sql( $this->getTableInSchema( static::$tagJoinTableName ) );
        $tagId      = $this->getTagIdByName( $tag );

        if ( empty( $tagId ) )
        {
           $insert = $tagSql->insert()
                            ->values( array(
                                'locale'   => $this->getLocale(),
                                'name'     => $tag,
                            ) );

           $rows += $tagSql->prepareStatementForSqlObject( $insert )
                           ->execute()
                           ->getAffectedRows();

           $tagId = $this->getTagIdByName( $tag );
        }

        $data = array(
            'paragraphId'   => $paragraphId,
            'tagId'         => $tagId,
        );

        $select = $tagJoinSql->select()
                             ->where( $data );

        if ( ! $tagJoinSql->prepareStatementForSqlObject( $select )
                          ->execute()
                          ->getAffectedRows() )
        {
            $insert = $tagJoinSql->insert()
                                 ->values( $data );

            $rows += $tagJoinSql->prepareStatementForSqlObject( $insert )
                                ->execute()
                                ->getAffectedRows();
        }

        return $rows;
    }
530286
public function doGenerate($tag, array $parameters)
    {
        if (isset($parameters['siteaccess'])) {
            // We generate for a different siteaccess, so potentially in a different language.
            $languages = $this->configResolver->getParameter('languages', null, $parameters['siteaccess']);
            unset($parameters['siteaccess']);
        } else {
            $languages = $this->configResolver->getParameter('languages');
        }

        $tagUrl = '';
        $isInternal = false;
        $originalTagId = $tagId = $tag->id;

        try {
            do {
                $tag = $this->tagsService->loadTag($tagId, $languages);

                $tagKeyword = null;
                foreach ($languages as $language) {
                    $tagKeyword = $tag->getKeyword($language);
                    if (!empty($tagKeyword)) {
                        break;
                    }
                }

                if (empty($tagKeyword)) {
                    if ($tag->alwaysAvailable) {
                        $tagKeyword = $tag->getKeyword();
                    }

                    if (empty($tagKeyword)) {
                        throw new LogicException("Unknown error when generating URL for tag ID #{$originalTagId}");
                    }
                }

                $tagUrl = '/' . $tagKeyword . $tagUrl;

                $tagId = $tag->parentTagId;
            } while ($tagId > 0);
        } catch (NotFoundException $e) {
            $isInternal = true;
            $tagUrl = $this->defaultRouter->generate(
                self::INTERNAL_TAG_ROUTE,
                [
                    'tagId' => $originalTagId,
                ]
            );
        } catch (LogicException $e) {
            if ($this->logger !== null) {
                $this->logger->warning($e->getMessage());
            }

            $isInternal = true;
            $tagUrl = $this->defaultRouter->generate(
                self::INTERNAL_TAG_ROUTE,
                [
                    'tagId' => $originalTagId,
                ]
            );
        }

        $queryString = '';
        if (!empty($parameters)) {
            $queryString = '?' . http_build_query($parameters, '', '&');
        }

        return (!$isInternal ? $this->getPathPrefix() : '') . '/' . trim($tagUrl, '/') . $queryString;
    }
1272185
public static function tagGetVer(string $tag) :?int
        {
            if (!self::$useTagsBuffer || !($ver = (self::$tagsBuffer[$tag] ?? null))) {
                $ver = self::$tagsBuffer[$tag] = self::GetInstance()
                                                     ->get("\$vxnTag:{$tag}") ?: self::tagIncrementVer($tag);
            }

            return $ver ?: null;
        }
354668
public function withTag($tag): Identifier
    {
        $obj = clone $this;
        $obj->_tag = new BigInt($tag);
        return $obj;
    }
324424
protected function renderTag(TagRendererInterface $renderer, TagInterface $tag)
    {
        $content = '';

        try {
            $content .= $renderer->render($tag);
        } catch (TagRendererExceptionInterface $e) {
            $tag = $e->getTag();

            throw new RequireTagException($e->getMessage(), $tag->getTemplateLine(), $tag->getTemplateName() ? new Source('', $tag->getTemplateName()) : null, $e->getPrevious());
        }

        return $content;
    }
88763
public void writeTag(Tag<?> tag) throws IOException {
        String name = tag.getName();
        byte[] nameBytes = name.getBytes(NBTConstants.CHARSET.name());

        os.writeByte(tag.getType().getId());
        os.writeShort(nameBytes.length);
        os.write(nameBytes);

        if (tag.getType() == TagType.TAG_END) {
            throw new IOException("Named TAG_End not permitted.");
        }

        writeTagPayload(tag);
    }
814980
public function addTag(Dklab_Cache_Frontend_Tag $tag)
    {
        if ($tag->getBackend() !== $this->_getBackend()) {
            \Zend_Cache::throwException("Backends for tag " . get_class($tag) . " and slot " . get_class($this) . " must be same");
        }
        $this->_tags[] = $tag;
    }
204526
private void initStandardTaglets() {
        if (javafx) {
            initJavaFXTaglets();
        }

        Taglet temp;
        addStandardTaglet(new ParamTaglet());
        addStandardTaglet(new ReturnTaglet());
        addStandardTaglet(new ThrowsTaglet());
        addStandardTaglet(new SimpleTaglet(EXCEPTION.tagName, null,
                SimpleTaglet.METHOD + SimpleTaglet.CONSTRUCTOR));
        addStandardTaglet(!nosince, new SimpleTaglet(SINCE.tagName, resources.getText("doclet.Since"),
                SimpleTaglet.ALL));
        addStandardTaglet(showversion, new SimpleTaglet(VERSION.tagName, resources.getText("doclet.Version"),
                SimpleTaglet.MODULE + SimpleTaglet.PACKAGE + SimpleTaglet.TYPE + SimpleTaglet.OVERVIEW));
        addStandardTaglet(showauthor, new SimpleTaglet(AUTHOR.tagName, resources.getText("doclet.Author"),
                SimpleTaglet.MODULE + SimpleTaglet.PACKAGE + SimpleTaglet.TYPE + SimpleTaglet.OVERVIEW));
        addStandardTaglet(new SimpleTaglet(SERIAL_DATA.tagName, resources.getText("doclet.SerialData"),
                SimpleTaglet.EXCLUDED));
        addStandardTaglet(new SimpleTaglet(HIDDEN.tagName, resources.getText("doclet.Hidden"),
                SimpleTaglet.FIELD + SimpleTaglet.METHOD + SimpleTaglet.TYPE));
        customTags.put((temp = new SimpleTaglet("factory", resources.getText("doclet.Factory"),
                SimpleTaglet.METHOD)).getName(), temp);
        addStandardTaglet(new SeeTaglet());
        //Standard inline tags
        addStandardTaglet(new DocRootTaglet());
        addStandardTaglet(new InheritDocTaglet());
        addStandardTaglet(new ValueTaglet());
        addStandardTaglet(new LiteralTaglet());
        addStandardTaglet(new CodeTaglet());
        addStandardTaglet(new IndexTaglet());

        // Keep track of the names of standard tags for error
        // checking purposes. The following are not handled above.
        standardTags.add(DEPRECATED.tagName);
        standardTags.add(LINK.tagName);
        standardTags.add(LINK_PLAIN.tagName);
        standardTags.add(SERIAL.tagName);
        standardTags.add(SERIAL_FIELD.tagName);
    }
838949
public TagHandler createTagHandler(String ns, String localName, TagConfig tag) throws FacesException
    {
        for (int i = 0; i < this.libraries.length; i++)
        {
            if (this.libraries[i].containsTagHandler(ns, localName))
            {
                return this.libraries[i].createTagHandler(ns, localName, tag);
            }
        }
        return null;
    }
1204816
public function htmlDivider($identifier, $content="", $tagName="div") {
		return $this->addHtmlComponent(new HtmlDivider($identifier, $content, $tagName));
	}
1303133
public function getDriver(/*# string */ $tag = '')/*# : DriverInterface */
    {
        // match drivers
        $matched = $this->driverMatcher($tag);

        if (count($matched) > 0) {
            return $this->drivers[$matched[rand(1, count($matched)) - 1]];
        } else {
            throw new NotFoundException(
                Message::get(Message::DB_DRIVER_NOTFOUND),
                Message::DB_DRIVER_NOTFOUND
            );
        }
    }
434969
protected function insertTag(Tag $tag)
	{
		if (!$this->tagStackIsSorted)
		{
			$this->tagStack[] = $tag;
		}
		else
		{
			// Scan the stack and copy every tag to the next slot until we find the correct index
			$i = count($this->tagStack);
			while ($i > 0 && self::compareTags($this->tagStack[$i - 1], $tag) > 0)
			{
				$this->tagStack[$i] = $this->tagStack[$i - 1];
				--$i;
			}
			$this->tagStack[$i] = $tag;
		}
	}