1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-28 23:40:41 +02:00

feat(core): add Files API basic files #428

This commit is contained in:
Awilum
2020-05-23 17:24:12 +03:00
parent 15ca7fd612
commit bbb3263a0c
2 changed files with 74 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
/**
* Flextype (http://flextype.org)
* Founded by Sergey Romanenko and maintained by Flextype Community.
*/
namespace Flextype;
use function md5;
class Files
{
/**
* Flextype Dependency Container
*
* @access private
*/
private $flextype;
/**
* Constructor
*
* @access public
*/
public function __construct($flextype)
{
$this->flextype = $flextype;
}
/**
* Create file
*
* @param string $data Unique identifier of the entry(entries).
* @return array The entry array data.
*
* @access public
*/
public function create(string $data) : array
{
}
}

View File

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
/**
* Flextype (http://flextype.org)
* Founded by Sergey Romanenko and maintained by Flextype Community.
*/
namespace Flextype;
use Flextype\Component\Filesystem\Filesystem;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use function array_replace_recursive;
/**
* API sys messages
*/
$api_sys_messages['AccessTokenInvalid'] = ['sys' => ['type' => 'Error', 'id' => 'AccessTokenInvalid'], 'message' => 'The access token you sent could not be found or is invalid.'];
$api_sys_messages['NotFound'] = ['sys' => ['type' => 'Error', 'id' => 'NotFound'], 'message' => 'The resource could not be found.'];
/**
* Validate delivery files token
*/
function validate_delivery_files_token($token) : bool
{
return Filesystem::has(PATH['project'] . '/tokens/delivery/files/' . $token . '/token.yaml');
}