fix : ajout d'un préfix pour les path des app et correction de l'affichage
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled

This commit is contained in:
2026-04-07 10:30:58 +02:00
parent 777224709d
commit 419d3b24cb
13 changed files with 173 additions and 46 deletions

View File

@@ -7,21 +7,27 @@ namespace App\State;
use ApiPlatform\Metadata\Operation;
use ApiPlatform\State\ProcessorInterface;
use App\Entity\Environment;
use App\Service\AppPathResolver;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
final readonly class MaintenanceToggleProcessor implements ProcessorInterface
{
public function __construct(
private AppPathResolver $pathResolver,
) {}
/**
* @param Environment $data
*/
public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): Environment
{
$maintenancePath = $data->getMaintenanceFilePath();
$relativePath = $data->getMaintenanceFilePath();
if (null === $maintenancePath) {
if (null === $relativePath) {
throw new BadRequestHttpException('Maintenance file path is not configured for this environment.');
}
$maintenancePath = $this->pathResolver->resolve($relativePath);
$requestData = $context['request']?->toArray() ?? [];
$enableMaintenance = $requestData['maintenance'] ?? false;