1
0
Fork 0
mirror of synced 2024-06-03 03:14:50 +12:00
appwrite/src/Appwrite/Storage/Device/S3.php

196 lines
3.6 KiB
PHP
Raw Normal View History

2019-05-09 18:54:39 +12:00
<?php
2020-06-12 07:36:10 +12:00
namespace Appwrite\Storage\Device;
2019-05-09 18:54:39 +12:00
use Appwrite\Storage\Device;
2019-05-09 18:54:39 +12:00
class S3 extends Device
{
/**
* @return string
*/
2020-05-14 20:22:06 +12:00
public function getName():string
2019-05-09 18:54:39 +12:00
{
return 'S3 Storage';
}
/**
* @return string
*/
2020-05-14 20:22:06 +12:00
public function getDescription():string
2019-05-09 18:54:39 +12:00
{
return 'S3 Bucket Storage drive for AWS or on premise solution';
}
/**
* @return string
*/
2020-05-14 20:22:06 +12:00
public function getRoot():string
2019-05-09 18:54:39 +12:00
{
2020-02-20 01:41:23 +13:00
return '';
2019-05-09 18:54:39 +12:00
}
/**
* @param string $filename
*
2019-05-09 18:54:39 +12:00
* @return string
*/
2020-05-14 20:22:06 +12:00
public function getPath($filename):string
2019-05-09 18:54:39 +12:00
{
2020-05-14 20:22:06 +12:00
return '';
}
/**
* Upload.
*
* Upload a file to desired destination in the selected disk.
*
* @param string $target
* @param string $filename
*
* @throws \Exception
*
* @return bool
2020-05-14 20:22:06 +12:00
*/
public function upload($source, $path):bool
{
return false;
}
/**
* Read file by given path.
*
* @param string $path
*
* @return string
*/
public function read(string $path):string
{
return '';
}
/**
* Write file by given path.
*
* @param string $path
* @param string $data
*
* @return bool
*/
public function write(string $path, string $data):bool
{
return false;
}
/**
* Move file from given source to given path, Return true on success and false on failure.
*
* @see http://php.net/manual/en/function.filesize.php
*
* @param string $source
* @param string $target
*
* @return bool
*/
public function move(string $source, string $target):bool
{
return false;
}
/**
* Delete file in given path, Return true on success and false on failure.
*
* @see http://php.net/manual/en/function.filesize.php
*
* @param string $path
*
* @return bool
*/
2020-06-05 02:06:51 +12:00
public function delete(string $path, bool $recursive = false):bool
2020-05-14 20:22:06 +12:00
{
return false;
}
/**
* Returns given file path its size.
*
* @see http://php.net/manual/en/function.filesize.php
*
* @param $path
*
* @return int
*/
public function getFileSize(string $path):int
{
return 0;
}
/**
* Returns given file path its mime type.
*
* @see http://php.net/manual/en/function.mime-content-type.php
*
* @param $path
*
* @return string
*/
public function getFileMimeType(string $path):string
{
return '';
}
/**
* Returns given file path its MD5 hash value.
*
* @see http://php.net/manual/en/function.md5-file.php
*
* @param $path
*
* @return string
*/
public function getFileHash(string $path):string
{
return '';
}
2019-05-09 18:54:39 +12:00
2020-06-26 08:52:25 +12:00
/**
* Get directory size in bytes.
*
* Return -1 on error
*
* Based on http://www.jonasjohn.de/snippets/php/dir-size.htm
*
* @param $path
*
* @return int
*/
public function getDirectorySize(string $path):int
{
return 0;
}
2020-05-14 20:22:06 +12:00
/**
* Get Partition Free Space.
*
* disk_free_space Returns available space on filesystem or disk partition
*
* @return float
*/
public function getPartitionFreeSpace():float
{
return 0.0;
}
/**
* Get Partition Total Space.
*
* disk_total_space Returns the total size of a filesystem or disk partition
*
* @return float
*/
public function getPartitionTotalSpace():float
{
return 0.0;
2019-05-09 18:54:39 +12:00
}
2020-05-14 20:22:06 +12:00
}