src/Files.php
/**
     * Retrieves the cache keys for the given tag.
     *
     * @param  string $tag The cache tag to retrieve.
     * @return array|null Returns an array of cache keys or null.
     */
Retrieves the cache keys for the given tag.
@param  string $tag The cache tag to retrieve.
@return array|null Returns an array of cache keys or null.
Retrieves the cache keys for the given tag . @param string $tag The cache tag to retrieve . @return array|null Returns an array of cache keys or null .
public function loadTag($tag)
    {
        if (!$this->getOption('tag_enable')) {
            return null;
        }
        $encoded = base64_encode($this->mapTag($tag));
        $found = array();
        $files = scandir($this->getOption('directory'));
        foreach ($files as $file) {
            if (substr($file, 0, 1) === '.') {
                continue;
            }
            $path = $this->getOption('directory') . DIRECTORY_SEPARATOR . $file;
            $fileTags = explode(' ', $this->readFile($path, 1));
            if (in_array($encoded, $fileTags, true)) {
                $found[] = base64_decode($file);
            }
        }
        if (0 === count($found)) {
            return null;
        }
        return $found;
    }
public function loadTag ( $ tag ) { if ( ! $ this -> getOption ( 'tag_enable' ) ) { return null ; } $ encoded = base64_encode ( $ this -> mapTag ( $ tag ) ) ; $ found = array ( ) ; $ files = scandir ( $ this -> getOption ( 'directory' ) ) ; foreach ( $ files as $ file ) { if ( substr ( $ file , 0 , 1 ) === '.' ) { continue ; } $ path = $ this -> getOption ( 'directory' ) . DIRECTORY_SEPARATOR . $ file ; $ fileTags = explode ( ' ' , $ this -> readFile ( $ path , 1 ) ) ; if ( in_array ( $ encoded , $ fileTags , true ) ) { $ found [ ] = base64_decode ( $ file ) ; } } if ( 0 === count ( $ found ) ) { return null ; } return $ found ; }
Retrieves the cache keys for the given tag.
Retrieves the cache keys for the given tag .