private function saveTag($tag, $digest)
    {
        $path = $this->getTagPath($tag) . DIRECTORY_SEPARATOR . $digest;
        if (!is_dir(dirname($path)) && false === @mkdir(dirname($path), 0777, true) && !is_dir(dirname($path))) {
            return false;
        }

        $tmpFile = tempnam(dirname($path), basename($path));
        if (false === $fp = @fopen($tmpFile, 'wb')) {
            return false;
        }
        @fwrite($fp, $digest);
        @fclose($fp);

        if ($digest != file_get_contents($tmpFile)) {
            return false;
        }

        if (false === @rename($tmpFile, $path)) {
            return false;
        }

        @chmod($path, 0666 & ~umask());

        return true;
    }
private function saveTag($tag, $digest)
    {
        $path = $this->getTagPath($tag) . DIRECTORY_SEPARATOR . $digest;
        if (!is_dir(dirname($path)) && false === @mkdir(dirname($path), 0777, true) && !is_dir(dirname($path))) {
            return false;
        }

        $tmpFile = tempnam(dirname($path), basename($path));
        if (false === $fp = @fopen($tmpFile, 'wb')) {
            return false;
        }
        @fwrite($fp, $digest);
        @fclose($fp);

        if ($digest != file_get_contents($tmpFile)) {
            return false;
        }

        if (false === @rename($tmpFile, $path)) {
            return false;
        }

        @chmod($path, 0666 & ~umask());

        return true;
    }
private function saveTag ( $ tag , $ digest ) { $ path = $ this -> getTagPath ( $ tag ) . DIRECTORY_SEPARATOR . $ digest ; if ( ! is_dir ( dirname ( $ path ) ) && false === @ mkdir ( dirname ( $ path ) , 0777 , true ) && ! is_dir ( dirname ( $ path ) ) ) { return false ; } $ tmpFile = tempnam ( dirname ( $ path ) , basename ( $ path ) ) ; if ( false === $ fp = @ fopen ( $ tmpFile , 'wb' ) ) { return false ; } @ fwrite ( $ fp , $ digest ) ; @ fclose ( $ fp ) ; if ( $ digest != file_get_contents ( $ tmpFile ) ) { return false ; } if ( false === @ rename ( $ tmpFile , $ path ) ) { return false ; } @ chmod ( $ path , 0666 & ~ umask ( ) ) ; return true ; }
Save digest for the given tag.

@param string $tag    The tag key
@param string $digest The digest hash to store representing the cache item.

@return bool
Save digest for the given tag .