1
0
Fork 0
mirror of synced 2024-06-03 11:24:48 +12:00
appwrite/src/Appwrite/Storage/Device/S3.php
Eldad Fux a86ad1be90 Improve PHP exeution time by using
fully-qualified function calls
2020-06-20 14:05:43 +03:00

49 lines
858 B
PHP

<?php
namespace Appwrite\Storage\Device;
use Appwrite\Storage\Device;
class S3 extends Device
{
/**
* @return string
*/
public function getName()
{
return 'S3 Storage';
}
/**
* @return string
*/
public function getDescription()
{
return 'S3 Bucket Storage drive for AWS or on premise solution';
}
/**
* @return string
*/
public function getRoot()
{
return '';
}
/**
* @param string $filename
*
* @return string
*/
public function getPath($filename)
{
$path = '';
for ($i = 0; $i < 4; ++$i) {
$path = ($i < \strlen($filename)) ? $path.DIRECTORY_SEPARATOR.$filename[$i] : $path.DIRECTORY_SEPARATOR.'x';
}
return $this->getRoot().$path.DIRECTORY_SEPARATOR.$filename;
}
}