Read metadata.
@param string $id
@param array $metadata
@throws RawFileCacheException
345476
protected function writeMetadata($id, array $metadata)
    {
        $filename = $this->getFilename($id, true);
        $this->assertDirectory($filename);
        $this->assertFile($filename);
        if (false === file_put_contents($filename, serialize($metadata))) {
            throw new RawFileCacheException(sprintf('Cannot write file : %s', $filename), RawFileCacheException::CANNOT_WRITE_FILE);
        }
    }
1101776
public function delete(MetadataId $id)
    {
        if (!$this->storage->has($this->schema, $this->typeSchema->name(), (string) $id)) {
            throw NotFoundException::metadata($id);
        }

        $this->storage->delete($this->schema, $this->typeSchema->name(), (string) $id);
    }
1303604
private function updateAttachmentS3Props($id, $meta) {
		if(isset($_POST['s3-access-acl']) || isset($_POST['s3-cache-control']) || isset($_POST['s3-expires'])) {
			$mime = get_post_mime_type($id);

			$acl = (isset($meta['s3']['privacy'])) ? $meta['s3']['privacy'] : StorageSettings::privacy();
			$acl = (isset($_POST['s3-access-acl'])) ? $_POST['s3-access-acl'] : $acl;
			$meta['s3']['privacy'] = $acl;

			$cacheControl = false;
			$expires = false;

			if(isset($_POST['s3-cache-control'])) {
				$cacheControl = $_POST['s3-cache-control'];
			}

			if(isset($_POST['s3-expires'])) {
				$expires = $_POST['s3-expires'];
				if(!empty($expires)) {
					if(!is_numeric($expires)) {
						$expires = strtotime($expires) - time();
						if($expires !== false) {
							$expires = round($expires / 60);
						}
					}

					if(($expires !== false) && is_numeric($expires)) {
						$expires = gmdate('D, d M Y H:i:00 \G\M\T', time() + ($expires * 60));
					}
				}
			}

			try {
				$this->client->copy($meta['s3']['key'], $meta['s3']['key'], $acl, $mime, $cacheControl, $expires);

				if(!empty($cacheControl)) {
					if(!isset($meta['s3']['options'])) {
						$meta['s3']['options'] = [];
					}

					if(!isset($meta['s3']['options']['params'])) {
						$meta['s3']['options']['params'] = [];
					}

					$meta['s3']['options']['params']['CacheControl'] = $cacheControl;
				}

				if(!empty($expires)) {
					if(!isset($meta['s3']['options'])) {
						$meta['s3']['options'] = [];
					}

					if(!isset($meta['s3']['options']['params'])) {
						$meta['s3']['options']['params'] = [];
					}

					$meta['s3']['options']['params']['Expires'] = $expires;
				}
			}
			catch(StorageException $ex) {
				Logger::error('Error Copying Object', ['exception' => $ex->getMessage()]);
			}
		}

		return $meta;
	}
1157024
protected function getFilename($id, $metadata = false)
    {
        $this->assertValidId($id);
        $path = rtrim(dirname($id), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
        if ($level = $this->getOption('hash_tree', 0)) {
            $level = min(32, $level);
            $md5 = md5($id);
            for ($i = 0; $i < $level; ++$i) {
                $path .= $md5[$i] . DIRECTORY_SEPARATOR;
            }
        }
        $path .= basename($id);
        if ($metadata) {
            $root = $this->getOption('metadata_root', $this->getOption('root') . DIRECTORY_SEPARATOR . '.cache_metadata');
        } else {
            $root = $this->getOption('root');
        }
        return rtrim(sanitize_path($root . DIRECTORY_SEPARATOR . $path), DIRECTORY_SEPARATOR);
    }
620295
public function read($id = null)
    {
        return ($id != null)
            ? $this->findByID($id)
            : $this->newModel();
    }
1225373
public function read($id)
    {
        $items = [];
        $items = $this->select('data')->where('session_id', '=', $id)
            ->limit('1')
            ->findAll('assoc');

        return isset($items[0]['data']) ? @$items[0]['data'] : null;
    }
1330579
public function receiveMeta($metaData, $source)
    {
        if ($source === $this->container[0]["source"]) {
            $this->container[0]["meta"] = $metaData;
        } else {
            $this->container[1]["meta"] = $metaData;
        }
        if ($this->container[0]["meta"] && $this->container[1]["meta"]) {
            $meta = array(
                "columns" => array_merge(
                    $this->container[0]["meta"]["columns"],
                    $this->container[1]["meta"]["columns"]
                ),
            );
            $this->sendMeta($meta);
        }
    }
1337728
public function get_metadata($id)
	{
		$success = FALSE;
		$stored = apc_fetch($id, $success);

		if ($success === FALSE OR count($stored) !== 3)
		{
			return FALSE;
		}

		list($data, $time, $ttl) = $stored;

		return array(
			'expire'	=> $time + $ttl,
			'mtime'		=> $time,
			'data'		=> unserialize($data)
		);
	}
514406
public Metadata[] readMetadata() throws IOException {
        readStreamSync();
        ArrayList<Metadata> metadataList = new ArrayList<Metadata>();
        Metadata metadata;
        do {
            metadata = readNextMetadata();
            metadataList.add(metadata);
        } while (!metadata.isLast());
        return (Metadata[])metadataList.toArray(new Metadata[0]);
    }
623125
public function view($id = null) {
        $cmsContentMeta = $this->CmsContentMeta->get($id, [
            'contain' => ['CmsContent']
        ]);
        $this->set('cmsContentMeta', $cmsContentMeta);
        $this->set('_serialize', ['cmsContentMeta']);
    }
737554
public function read($key)
    {
        $this->_cachedData or $this->_cachedData = Cache::get('model-metadata');
        return isset($this->_cachedData[$key]) ? $this->_cachedData[$key] : null;
    }
729825
Config readMetadata() throws IOException {
    if (!isStoreMetadataFilePresent()) {
      throw new IOException("Store metadata file does not exist at " + this.storeMetadataFilePath);
    }
    try (InputStream storeMetadataInputStream = this.fs.open(this.storeMetadataFilePath)) {
      return ConfigFactory.parseReader(new InputStreamReader(storeMetadataInputStream, Charsets.UTF_8));
    }
  }
213055
protected function _read($id)
    {
        if (isset($this->cache[$id])) {
            /** @var MemoryItem $item */
            $item = $this->cache[$id];
            if (!$item->is_valid()) {
                unset($this->cache[$id]);
                return false;
            }

            return $item->data;
        }

        return false;
    }
324888
public function read($id)
    {
        $stmt = $this->db->prepare("SELECT session_data FROM " . $this->tableName . " WHERE session_id = :id");
        $stmt->execute(['id' => $id]);
        return base64_decode($stmt->fetchColumn());
    }
1038980
public function readSession($id)
	{
		$data=$this->_cache->get($this->calculateKey($id));
		return $data===false?'':$data;
	}
542800
public static function load($id, $subId = null) : CacheEntryInterface
    {
        $storageId = $id;

        if ($subId) {
            $storageId .= '[' . $subId . ']';
        }

        if (!isset(self::$files[$storageId])) {
            $filename = static::CACHE_DIR . ($subId ? $subId . '/' : null) . urlencode($id) . '.' . static::CACHE_EXTENSION;
            self::$files[$storageId] = new File($filename);
        }

        return self::$files[$storageId];
    }
854159
public function read($id)
    {
        $session = \Doctrine::getTable($this->_tableName)->find($id);
        if (false !== $session) {
            if ($this->_getExpirationTime($session) > time()) {
                return $session->{$this->_dataColumn};
            } else {
                $this->destroy($id);
            }
        }

        return '';
    }