Create an array of OG tags and their values for a show.

https://developers.facebook.com/docs/sharing/webmasters

@param  object   $show       The show object.
@return array
10044
public static function createOpenGraphTagsForShow($show) {
        return [
            'og:title'               => $show->title,
            'og:type'                => 'website',
            'og:url'                 => Config('app.url') .'/'. $show->slug,
            'og:image'               => Config('app.url') .'/'. Config::get('lasallecastfrontend.images_shows') .'/'. $show->featured_image,
            'og:description'         => $show->meta_description,
            'og:site_name'           => Config::get('lasallecmsfrontend.og_site_name'),

        ];
    }
225781
protected function createObjectPayload($job)
    {
        return [
            'displayName' => $this->getDisplayName($job),
            'job' => 'Zilf\Queue\CallQueuedHandler@call',
            'maxTries' => $job->tries ?? null,
            'timeout' => $job->timeout ?? null,
            'timeoutAt' => $this->getJobExpiration($job),
            'data' => [
                'commandName' => get_class($job),
                'command' => serialize(clone $job),
            ],
        ];
    }
1016762
public function setRequireExistingPassword($show)
    {
        // Don't modify if already added / removed
        if ((bool)$show === $this->requireExistingPassword) {
            return $this;
        }
        $this->requireExistingPassword = $show;
        $name = $this->getName();
        $currentName = "{$name}[_CurrentPassword]";
        if ($show) {
            $confirmField = PasswordField::create($currentName, _t('SilverStripe\\Security\\Member.CURRENT_PASSWORD', 'Current Password'));
            $this->getChildren()->unshift($confirmField);
        } else {
            $this->getChildren()->removeByName($currentName, true);
        }
        return $this;
    }
301911
public static function fromJob($job)
    {
        if ($tags = static::extractExplicitTags($job)) {
            return $tags;
        }

        return static::modelsFor(static::targetsFor($job))->map(function ($model) {
            return FormatModel::given($model);
        })->all();
    }
657923
public static function createMetaTagsForEpisode($episode) {
        return [
            'page_title'             => $episode->title . '&verbar;' . Config::get('lasallecmsfrontend.og_site_name'),
            'canonical_url'          => $episode->canonical_url,
            'meta_description'       => $episode->meta_description,
        ];
    }
908599
public function tagged($tag)
    {
        if (! isset($this->tags[$tag])) {
            return [];
        }

        return new RewindableGenerator(function () use ($tag) {
            foreach ($this->tags[$tag] as $abstract) {
                yield $this->make($abstract);
            }
        }, count($this->tags[$tag]));
    }
295971
private function compile_arrays( $view )
	{	
		$tokens = token_get_all( $view );

		$tags = array( 0 => '' );
		$tag_index = 0;
		$in_tag = false;

		// parse all php tags out of the view
		foreach ( $tokens as $token ) 
		{
			if ( is_array( $token ) ) 
			{
				if ( $token[0] === T_OPEN_TAG )
				{
					$in_tag = true;
				}

				if ( $in_tag && !in_array( $token[0], array( T_INLINE_HTML ) ) ) 
				{				
					$tags[$tag_index] .= $token[1];
				}

				if ( $token[0] === T_CLOSE_TAG )
				{
					$in_tag = false;
					$tag_index++;
				}
			}
			else 
			{
				if ( $in_tag )
				{
					$tags[$tag_index] .= $token;
				}
			}
		}

		// lets make the tags search keys
		$tags = array_flip( $tags );

		// now search and replace var in the php sections
		foreach( $tags as $search => &$replace )
		{
			$replace = preg_replace_callback('/(\$[a-zA-Z0-9\_\.\-\>\;]+)/s', function( $match )
			{ 
				$var = $match[1];

				if ( strpos( $var, '.' ) !== false )
				{
					$buffer = '';
					$length = strlen( $var );
					$inside_arr = false;

					for( $i=0;$i<$length;$i++ )
					{
						$char = $var[$i];

						if ( $char == '.' && !$inside_arr  )
						{
							$buffer .= "['";
							$inside_arr = true;
						}
						else
						{
							if ( $inside_arr && in_array( $char, array( ';', '-', ',' ) ) )
							{
								$buffer .= "']";
								$inside_arr = false;
							}

							if ( $char == '.' )
							{
								$buffer .= "']['";
								$inside_arr = true;
							}
							else
							{
								$buffer .= $char;
							}
						}
					}

					if ( $inside_arr )
					{
						$buffer .= "']";
					}

					$var = $buffer;
				}

				return $var;

			}, $search );
		}

		return CCStr::replace( $view, $tags );
	}
1363812
public static function createTwitterTagsForEpisode($episode, $show) {
        return [
            'twitter:card'        => Config::get('lasallecmsfrontend.twitter_card'),
            'twitter:site'        => Config::get('lasallecmsfrontend.twitter_site'),
            'twitter:title'       => $episode->title,
            'twitter:description' => $episode->meta_description,
            'twitter:creator'     => Config::get('lasallecmsfrontend.twitter_creator'),
            //'twitter:image:src'   => self::determineEpisodeImagePath($episode, $show),
            'twitter:image'       => self::determineEpisodeImagePath($episode, $show),
        ];
    }
1008351
protected function getTagValues()
    {
        // Step1 Get tags value from cache
        $keys = array_map(array($this, 'getTagKey'), $this->tags);
        $values = $this->cache->getMulti($keys);

        // Step2 Initialize new tags value
        $emptyKeys = array_diff($values, array_filter($values));
        if ($emptyKeys) {
            $newValues = $this->setTagValues($emptyKeys);
            $values = array_merge($values, $newValues);
        }

        return $values;
    }
1332949
public function findOrCreate(array $tags)
    {
        $foundTags = $this->findWhereIn(['tag', $tags]);

        $returnTags = [];

        if ($foundTags) {
            foreach ($foundTags as $tag) {
                $pos = array_search($tag->tag, $tags);

                // Add returned tags to array
                if ($pos !== false) {
                    $returnTags[] = $tag;
                    unset($tags[$pos]);
                }
            }
        }

        // Add remainings tags as new
        foreach ($tags as $tag) {
            $returnTags[] = $this->create([
                'tag' => $tag,
                'slug' => Str::slug($tag),
            ]);
        }

        return $returnTags;
    }
260917
function _processCollectedTags($source)
        {
            $to_replace = array();
            $ordered = array();
            foreach(self::$tag_collections as $tag_name=>$tags)
            {
//              if this block has a collection order use it
                if(isset(self::$_tag_order[$tag_name]) === true)
                {
                    $pos = self::$_tag_order[$tag_name];
                    $ordered[$pos] = $tags;
                    continue;
                }
//              the source should be modified by the collection script
                $tag_func_name = ucwords(str_replace(array('_', '-'), ' ', $tag_name));
                $tag_func_name = strtolower(substr($tag_func_name, 0, 1)).substr($tag_func_name, 1);
                $tag_func_name = str_replace(' ', '', $this->_options['tag_callback_prefix'].$tag_func_name);
                if($this->_options['tag_global_callback'] !== false)
                {
                    $tags = call_user_func($this->_options['tag_global_callback'], 'collection', $tag_func_name, $tags, $source);
                }
                else
                {
                    $tags = call_user_func($tag_func_name, $tags, $source);
                }
                
                if($tags === -1)
                {
                    $source = self::throwError($tag_name, 'tag collection parsed however callback "'.$tag_func_name.'" returned -1.');
                }
                else if(is_array($tags) === false)
                {
                    $source = self::throwError($tag_name, 'tag collection parsed however callback "'.$tag_func_name.'" did not return the array of process tags.');
                }
                else if(count($tags) > 0)
                {
//                  input the parsed tags back into the source or store for re-intergration
                    foreach ($tags as $key => $tag)
                    {
                        if(strpos($source, $tag['tag']) !== false)
                        {
                            $source = str_replace($tag['tag'], $tag['parsed'], $source);
                        }
                        else
                        {
//                          do a reverse tag lookup here as the tag was not found in the source, thus it must be buried and un processed
                            array_push($to_replace, $tag);
                        }
                    }
                }
            }
            foreach($ordered as $key=>$tags)
            {
//              the source should be modified by the collection script
                $tag_func_name = ucwords(str_replace(array('_', '-'), ' ', $tag_name));
                $tag_func_name = strtolower(substr($tag_func_name, 0, 1)).substr($tag_func_name, 1);
                $tag_func_name = str_replace(' ', '', $this->_options['tag_callback_prefix'].$tag_func_name);
                $tags = call_user_func($tag_func_name, $tags);
                if($tags === -1)
                {
                    $source = self::throwError($tag['name'], 'tag collection parsed however callback "'.$tag_func_name.'" returned -1.');
                }
            }
            return $this->_doBuriedReplacements($to_replace, $source);
        }
932777
protected function _collectTags($object)
    {
        if ($object instanceof Mage_Cms_Model_Block) {
            return self::TAG_PREFIX . $object->getIdentifier();
        }
        return self::TAG_PREFIX . $object->getId();
    }
96342
public function tags(array $keys = [])
    {
        $html = '';

        foreach (($keys ?: array_keys($this->metas)) as $key) {
            $html .= $this->tag($key);
        }

        return $html;
    }
388159
private function export_tags(array $tags) : array {
        $user = $this->related['user'];
        $context = $this->related['context'];
        $capabilitymanager = $this->related['capabilitymanager'];
        $canmanagetags = $capabilitymanager->can_manage_tags($user);

        return array_values(array_map(function($tag) use ($context, $canmanagetags) {
            $viewurl = core_tag_tag::make_url($tag->tagcollid, $tag->rawname, 0, $context->id);
            return [
                'id' => $tag->taginstanceid,
                'tagid' => $tag->id,
                'isstandard' => $tag->isstandard,
                'displayname' => $tag->get_display_name(),
                'flag' => $canmanagetags && !empty($tag->flag),
                'urls' => [
                    'view' => $viewurl->out(false)
                ]
            ];
        }, $tags));
    }
583271
private function getTags(): array
    {
        $tags = [];
        foreach ($this->referenceStorePool->getStores() as $alias => $referenceStore) {
            $tags = array_merge($tags, $this->getTagsFromStore($alias, $referenceStore));
        }

        return $tags;
    }
1242032
public function tags($names)
    {
        return new TaggedCache($this, new TagSet($this, is_array($names) ? $names : func_get_args()));
    }
1092562
public function tags()
    {
        if (null === $this->tags) {
            $retval = $this->execute('ls-remote', array('--tags' => true, $this->getUrl()));

            if ('' === trim($retval)) {
                return $this->tags = array();
            }

            $list = explode("\n", rtrim($retval));

            $tags = array();
            foreach ($list as $line) {
                list ($hash, $ref) = explode("\t", $line);
                $tags[] = new Reference(str_replace('refs/tags/', '', $ref), Reference::TAG, $hash);
            }

            $this->tags = $tags;
        }

        return $this->tags;
    }