Retrieves an array of tags that we should never touch.

@param bool $reset Optional. Default false.

@return array {
An array of boolean values indexed by tagname.

@type bool $tag `true` if the tag should never be modified in any way.
}
494845
public static function inappropriate_tags( $reset = false ) {
		if ( empty( self::$inappropriate_tags ) || $reset ) {
			self::$inappropriate_tags = \array_flip(
				\array_merge(
					\array_filter(
						\array_keys( Elements::$html5 ),
						function( $tag ) {
							return Elements::isA( $tag, Elements::VOID_TAG )
								|| Elements::isA( $tag, Elements::TEXT_RAW )
								|| Elements::isA( $tag, Elements::TEXT_RCDATA );
						}
					),
					self::ADDITIONAL_INAPPROPRIATE_TAGS
				)
			);
		}

		return self::$inappropriate_tags;
	}
583271
private function getTags(): array
    {
        $tags = [];
        foreach ($this->referenceStorePool->getStores() as $alias => $referenceStore) {
            $tags = array_merge($tags, $this->getTagsFromStore($alias, $referenceStore));
        }

        return $tags;
    }
589511
public static function getBitfields(TagCollection $tags, Ruleset $rootRules)
	{
		$rules = ['*root*' => iterator_to_array($rootRules)];
		foreach ($tags as $tagName => $tag)
		{
			$rules[$tagName] = iterator_to_array($tag->rules);
		}

		// Create a matrix that contains all of the tags and whether every other tag is allowed as
		// a child and as a descendant
		$matrix = self::unrollRules($rules);

		// Remove unusable tags from the matrix
		self::pruneMatrix($matrix);

		// Group together tags are allowed in the exact same contexts
		$groupedTags = [];
		foreach (array_keys($matrix) as $tagName)
		{
			if ($tagName === '*root*')
			{
				continue;
			}

			$k = '';
			foreach ($matrix as $tagMatrix)
			{
				$k .= $tagMatrix['allowedChildren'][$tagName];
				$k .= $tagMatrix['allowedDescendants'][$tagName];
			}

			$groupedTags[$k][] = $tagName;
		}

		// Record the bit number of each tag, and the name of a tag for each bit
		$bitTag     = [];
		$bitNumber  = 0;
		$tagsConfig = [];
		foreach ($groupedTags as $tagNames)
		{
			foreach ($tagNames as $tagName)
			{
				$tagsConfig[$tagName]['bitNumber'] = $bitNumber;
				$bitTag[$bitNumber] = $tagName;
			}

			++$bitNumber;
		}

		// Build the bitfields of each tag, including the *root* pseudo-tag
		foreach ($matrix as $tagName => $tagMatrix)
		{
			$allowedChildren    = '';
			$allowedDescendants = '';
			foreach ($bitTag as $targetName)
			{
				$allowedChildren    .= $tagMatrix['allowedChildren'][$targetName];
				$allowedDescendants .= $tagMatrix['allowedDescendants'][$targetName];
			}

			$tagsConfig[$tagName]['allowed'] = self::pack($allowedChildren, $allowedDescendants);
		}

		// Prepare the return value
		$return = [
			'root' => $tagsConfig['*root*'],
			'tags' => $tagsConfig
		];
		unset($return['tags']['*root*']);

		return $return;
	}
1124400
private function tag_has_default(string $tag){
    return in_array('default', array_values(
      \is_array($this->tags[$tag]) ?
        $this->tags[$tag] :
        $this->tags[$this->tags[$tag]]
    ));
  }
520740
public function all($tag) {
  $i = $this->image = new Image;
  $images = $this->get($tag, 'basename');
  $results = array();
  foreach($images as $image) {
   try {
    $results[] = $i->get($image['uid']);
   }
   catch(\Exception $e) {
    if ($e->getCode() != 403) {
     throw new \Exception($e);
    }
   }
  }
  return $results;
 }
156813
public function removeByTag($tag)
    {
        $tags = (array) $tag;

        if (0 == count($tags)) {
            return false;
        }

        try {
            $this->_repository
                    ->createQueryBuilder('c')
                    ->delete()
                    ->where('c._tag IN (:tags)')
                    ->setParameters(array('tags' => $this->getContextualTags($tags)))
                    ->getQuery()
                    ->execute();
            $this->resetCacheEntity();
        } catch (\Exception $e) {
            $this->log('warning', sprintf('Enable to remove cache for tags (%s) : %s', implode(',', $tags), $e->getMessage()));

            return false;
        }

        return true;
    }
968206
public function getCreators($tag = null)
    {
        $tag = is_null($tag) ? [] : (is_array($tag) ? $tag : [$tag]);

        return array_values(array_filter(Person::get($this), function (Person $person) use ($tag) {
            return empty($tag) || in_array($person->getType(), $tag);
        }));
    }
541687
public function getClassTagValues($className, $tag)
    {
        if (!isset($this->reflectedClassNames[$className])) {
            $this->reflectClass($className);
        }
        if (!isset($this->classTagsValues[$className])) {
            return [];
        }
        return isset($this->classTagsValues[$className][$tag]) ? $this->classTagsValues[$className][$tag] : [];
    }
1066885
public function tagged()
    {
        $result = false;

        /** @var Tag $tag */
        foreach ($this->repository->getTags() as $tag) {
            if ($tag->getSha() === $this->getSha()) {
                $result = true;
                break;
            }
        }

        return $result;
    }
635545
static function fetchByTag( $tagName, $cacheInfoList = false )
    {
        if ( !$cacheInfoList )
            $cacheInfoList = eZCache::fetchList();

        $cacheEntries = array();
        $tagList = explode( ',', $tagName );
        foreach ( $cacheInfoList as $cacheInfo )
        {
            if ( !is_array( $cacheInfo['tag'] ) )
                continue;

            $matchingTags = array_intersect( $tagList, $cacheInfo['tag'] );
            if ( !empty( $matchingTags ) )
                $cacheEntries[] = $cacheInfo;
        }

        return $cacheEntries;
    }
1327875
public function remove($tag)
    {
        if ($this->count() == 0) {
            return [$this, null];
        }

        $deleted = null;

        foreach ($this->items as $key => $element) {
            if ($element === $tag) {
                $this->forget($key);

                $deleted = $tag;

                break;
            }
        }

        return [$this, $deleted];
    }
409562
public function getByTag(string $tag): array
    {
        $result = [];
        if (isset($this->tags[$tag])) {
            foreach ($this->tags[$tag] as $id) {
                $result[$id] = $this->get($id);
            }
        }

        return $result;
    }
869967
public function search($reset = false)
    {
        $stickyRequest = $this->getStickyRequest();
        $searchList = $this->getSearchList();
        if ($reset) {
            $stickyRequest->resetSearchRequest();
        }
        $req = $stickyRequest->getSearchRequest();

        $req = $stickyRequest->getSearchRequest();

        if (isset($req['keywords']) && $req['keywords'] !== '') {
            $searchList->filterByKeywords($req['keywords']);
        }
        if (isset($req['locale']) && is_string($req['locale']) && $req['locale'] !== '') {
            $repo = $this->app->make(LocaleRepository::class);
            $locale = $repo->findApproved($req['locale']);
            if ($locale !== null) {
                $searchList->showLocaleStats($locale);
            }
        }
        $this->searchResult = new SearchResult($searchList);
    }
574592
public function getGlossaryTerms( $reset = false ) {
		// Cheap cache
		static $glossary_terms = null;
		if ( $reset || $glossary_terms === null ) {
			$glossary_terms = [];
			$args = [
				'post_type' => 'glossary',
				'posts_per_page' => -1, // @codingStandardsIgnoreLine
				'post_status' => [ 'private', 'publish' ],
			];
			$posts = get_posts( $args );
			/** @var \WP_Post $post */
			foreach ( $posts as $post ) {
				$type = '';
				$terms = get_the_terms( $post->ID, 'glossary-type' );
				if ( $terms && ! is_wp_error( $terms ) ) {
					foreach ( $terms as $term ) {
						$type .= "{$term->slug},";
					}
				}
				$glossary_terms[ $post->post_title ] = [
					'id' => $post->ID,
					'content' => $post->post_content,
					'type' => rtrim( $type, ',' ),
					'status' => $post->post_status,
				];
			}
		}
		return $glossary_terms;
	}
32636
protected static function _getTagList() {
        $config = Zend_Registry::get('config');
        if (!empty($config->staticcaching->tags)) {
            return $config->staticcaching->tags;
        }

        // For backward-compatibility: fall back to a separate cache.ini
        $ini = new Garp_Config_Ini(APPLICATION_PATH . '/configs/cache.ini', APPLICATION_ENV);
        if (!empty($ini->tags)) {
            return $ini->tags;
        }

        return null;
    }
46112
protected function getTags($value)
    {
        $tags = [];
        switch ($value) {
            case $value instanceof VersionList && !empty($value->versions):
                $tags[] = 'content-' . $value->versions[0]->contentInfo->id;
                $tags[] = 'content-versions-' . $value->versions[0]->contentInfo->id;

                break;

            case $value instanceof Section:
                $tags[] = 'section-' . $value->id;
                break;

            case $value instanceof ContentTypeGroupRefList:
                if ($value->contentType->status !== ContentType::STATUS_DEFINED) {
                    return [];
                }
                $tags[] = 'type-' . $value->contentType->id;
            case $value instanceof ContentTypeGroupList:
                foreach ($value->contentTypeGroups as $contentTypeGroup) {
                    $tags[] = 'type-group-' . $contentTypeGroup->id;
                }
                break;

            case $value instanceof RestContentType:
                $value = $value->contentType;
            case $value instanceof ContentType:
                if ($value->status !== ContentType::STATUS_DEFINED) {
                    return [];
                }
                $tags[] = 'type-' . $value->id;
                break;

            case $value instanceof Root:
                $tags[] = 'ez-all';
                break;

                // @deprecated The following logic is 1.x specific, and should be removed before a 1.0 version
            case $value instanceof PermissionReport:
                // We requrie v0.1.5 with added location property to be able to add tags
                if (!isset($value->parentLocation)) {
                    return [];
                }

                // In case of for instance location swap where content type might change affecting allowed content types
                $tags[] = 'content-' . $value->parentLocation->contentId;
                $tags[] = 'content-type-' . $value->parentLocation->contentInfo->contentTypeId;
                $tags[] = 'location-' . $value->parentLocation->id;

                // In case of permissions assigned by subtree, so if path changes affecting this (move subtree operation)
                foreach ($value->parentLocation->path as $pathItem) {
                    $tags[] = 'path-' . $pathItem;
                }
                break;
        }

        return $tags;
    }
1355583
public function hasTag($tag)
    {
        if (is_array($tag)) {
            return true;
        }

        @list($tag, $ref) = explode('#', $tag);

        return isset($this->tags[$tag]) || $this->isTopTag($tag);
    }