You are here

protected function AmazonS3StreamWrapper::_amazons3_get_cache in AmazonS3 7

Fetch an object from the local metadata cache.

Parameters

string $uri: A string containing the uri of the resource to check.

Return value

array An array if the $uri is in the cache, otherwise FALSE

1 call to AmazonS3StreamWrapper::_amazons3_get_cache()
AmazonS3StreamWrapper::_amazons3_get_object in ./AmazonS3StreamWrapper.inc
Try to fetch an object from the metadata cache.

File

./AmazonS3StreamWrapper.inc, line 1294
Drupal stream wrapper implementation for Amazon S3

Class

AmazonS3StreamWrapper
@file Drupal stream wrapper implementation for Amazon S3

Code

protected function _amazons3_get_cache($uri) {

  // Check cache for existing object.
  $result = db_query("SELECT * FROM {amazons3_file} WHERE uri = :uri", array(
    ':uri' => $uri,
  ));
  $record = $result
    ->fetchAssoc();
  if ($record) {
    return $record;
  }
  return FALSE;
}