forked from ems-project/elasticms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '5.x' into feat/deprecrated-search-index-view
- Loading branch information
Showing
107 changed files
with
64,556 additions
and
71,485 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace EMS\CommonBundle\Storage\File; | ||
|
||
interface FileInterface | ||
{ | ||
public function getContent(): string; | ||
|
||
public function getFilename(): string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace EMS\CommonBundle\Storage\File; | ||
|
||
use EMS\CommonBundle\Common\Standard\Type; | ||
|
||
class LocalFile implements FileInterface | ||
{ | ||
public function __construct(private readonly string $filename) | ||
{ | ||
} | ||
|
||
public function getContent(): string | ||
{ | ||
return Type::string(\file_get_contents($this->filename)); | ||
} | ||
|
||
public function getFilename(): string | ||
{ | ||
return $this->filename; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace EMS\CommonBundle\Storage\File; | ||
|
||
use EMS\Helpers\File\TempFile; | ||
use Psr\Http\Message\StreamInterface; | ||
|
||
class StorageFile implements FileInterface | ||
{ | ||
private ?TempFile $tempFile = null; | ||
|
||
public function __construct(private readonly string $hash, private readonly StreamInterface $stream) | ||
{ | ||
} | ||
|
||
public function __destruct() | ||
{ | ||
if (null === $this->tempFile) { | ||
return; | ||
} | ||
|
||
$this->tempFile->clean(); | ||
} | ||
|
||
public function getContent(): string | ||
{ | ||
return $this->stream->getContents(); | ||
} | ||
|
||
public function getFilename(): string | ||
{ | ||
if (null === $this->tempFile) { | ||
$this->tempFile = TempFile::createNamed($this->hash); | ||
$this->tempFile->loadFromStream($this->stream); | ||
} | ||
|
||
return $this->tempFile->path; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
|
||
<routes xmlns="http://symfony.com/schema/routing" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/routing https://symfony.com/schema/routing/routing-1.0.xsd"> | ||
|
||
<route id="emsco_auth_token_login" path="/auth-token" | ||
controller="EMS\CoreBundle\Controller\Api\AuthTokenLoginController::login" | ||
methods="POST" | ||
format="json"/> | ||
|
||
<import resource="@EMSCoreBundle/Resources/config/routing/api/admin.xml" | ||
prefix="/api/admin"/> | ||
<import resource="@EMSCoreBundle/Resources/config/routing/api/extract-data.xml" | ||
prefix="/api/extract-data"/> | ||
<import resource="@EMSCoreBundle/Resources/config/routing/api/file.xml" | ||
prefix="/api/file"/> | ||
<import resource="@EMSCoreBundle/Resources/config/routing/api/forms.xml" | ||
prefix="/api/forms"/> | ||
<import resource="@EMSCoreBundle/Resources/config/routing/api/images.xml" | ||
prefix="/api/images"/> | ||
<import resource="@EMSCoreBundle/Resources/config/routing/api/meta.xml" | ||
prefix="/api/meta"/> | ||
<import resource="@EMSCoreBundle/Resources/config/routing/api/search.xml" | ||
prefix="/api/search"/> | ||
|
||
</routes> |
26 changes: 26 additions & 0 deletions
26
EMS/core-bundle/src/Resources/config/routing/api/forms.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
|
||
<routes xmlns="http://symfony.com/schema/routing" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/routing https://symfony.com/schema/routing/routing-1.0.xsd"> | ||
|
||
<route id="emsco_api_forms_submissions" path="/submissions" | ||
controller="EMS\CoreBundle\Controller\Api\Form\SubmissionController::submit" | ||
methods="POST" | ||
format="json"/> | ||
<route id="emsco_api_forms_submissions_detail" path="/submissions/{submissionId}" | ||
controller="EMS\CoreBundle\Controller\Api\Form\SubmissionController::detail" | ||
methods="GET" | ||
format="json"> | ||
<requirement key="submissionId">.*</requirement> | ||
</route> | ||
<route id="emsco_api_forms_post_verifications" path="/verifications" | ||
controller="EMS\CoreBundle\Controller\Api\Form\VerificationController::createVerification" | ||
methods="POST" | ||
format="json"/> | ||
<route id="emsco_api_forms_get_verifications" path="/verifications" | ||
controller="EMS\CoreBundle\Controller\Api\Form\VerificationController::getVerification" | ||
methods="GET" | ||
format="json"/> | ||
|
||
</routes> |
Oops, something went wrong.