sintonia/airtime_mvc/application/cloud_storage/StorageBackend.php
Albert Santoni 2a89e4d5a0 Massive refactor of the analyzer branch and sync it back up with the
cloud storage branch (for the last time)

* Backported all the bugfixes from cc-5709-airtime-analyzer-cloud-storage
* Backported missing FileStorageBackend.php
* Fixed CC-6001: Track titles and artist names with slashes break audio preview
* Refactored all the MediaController code, pulling out the logic into MediaService
* Fixed an API key leak to guests in the Media API
* Made this branch work without cloud_storage.conf (defaults to file storage)
* Made ApiController's getMediaAction use the MediaService code
2015-02-20 14:01:06 -05:00

65 lines
1.4 KiB
PHP

<?php
/**
*
* Provides access to file objects stored on a specific storage backend.
*/
abstract class StorageBackend
{
private $bucket;
private $accessKey;
private $secretKey;
/** Returns the file object's URL to the storage backend it is located on. */
abstract public function getAbsoluteFilePath($resourceId);
/** Returns the file object's signed URL. The URL must be signed since they
* privately stored on the storage backend. */
abstract public function getSignedURL($resourceId);
/** Returns the file's size in bytes. */
abstract public function getFileSize($resourceId);
/** Deletes the file from the storage backend. */
abstract public function deletePhysicalFile($resourceId);
protected function getBucket()
{
return $this->bucket;
}
protected function setBucket($bucket)
{
$this->bucket = $bucket;
}
protected function getAccessKey()
{
return $this->accessKey;
}
protected function setAccessKey($accessKey)
{
$this->accessKey = $accessKey;
}
protected function getSecretKey()
{
return $this->secretKey;
}
protected function setSecretKey($secretKey)
{
$this->secretKey = $secretKey;
}
public function deleteAllCloudFileObjects()
{
return false;
}
public function getFilePrefix()
{
return "";
}
}