1
0
Fork 0
mirror of synced 2024-06-29 03:30:34 +12:00

feat: parse file

This commit is contained in:
Christy Jacob 2020-12-29 01:01:26 +05:30
parent f1887d2d9b
commit 54f40c8ce2

View file

@ -3,7 +3,9 @@
namespace Appwrite\Utopia\Response\Filter;
use Appwrite\Auth\Auth;
use Appwrite\Database\Database;
use Appwrite\Database\Validator\Authorization;
use Appwrite\OpenSSL\OpenSSL;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Filter;
use Exception;
@ -19,6 +21,10 @@ class V06 extends Filter {
switch($model) {
case Response::MODEL_FILE :
$parsedResponse = $this->parseFile($content);
break;
case Response::MODEL_USER :
$parsedResponse = $this->parseUser($content);
break;
@ -90,6 +96,22 @@ class V06 extends Filter {
return $parsedResponse;
}
private function parseFile(array $content)
{
$content['$collection'] = Database::SYSTEM_COLLECTION_FILES;
$content['algorithm'] = 'gzip';
$content['comment'] = '';
$content['fileOpenSSLCipher'] = OpenSSL::CIPHER_AES_128_GCM;
$content['fileOpenSSLIV'] = '';
$content['fileOpenSSLTag'] = '';
$content['fileOpenSSLVersion'] = '';
$content['folderId'] = '';
$content['path'] = '';
$content['sizeActual'] = $content['sizeOriginal'];
$content['token'] = '';
return $content;
}
private function parseCurrencyList(array $content)
{
$content['locations'] = [];