diff --git a/src/Controller/DumpController.php b/src/Controller/DumpController.php index e115b0f..702dae0 100644 --- a/src/Controller/DumpController.php +++ b/src/Controller/DumpController.php @@ -6,7 +6,8 @@ use AeonDumpManager\MessageQueue\Message\CreateDumpMessage; use AeonDumpManager\Service\DumpJobStatusService; use AeonDumpManager\Service\DumpLister; use AeonDumpManager\Service\DumpService; -use Shopware\Core\Framework\Api\Route\ApiRouteScope; +use AeonDumpManager\Service\Exception\DumpNotFoundException; +use Shopware\Core\Framework\Routing\ApiRouteScope; use Shopware\Core\PlatformRequest; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; @@ -67,7 +68,11 @@ class DumpController )] public function delete(string $filename): JsonResponse { - $this->dumpService->delete($filename); + try { + $this->dumpService->delete($filename); + } catch (DumpNotFoundException $exception) { + return new JsonResponse(['message' => $exception->getMessage()], Response::HTTP_NOT_FOUND); + } return new JsonResponse(null, Response::HTTP_NO_CONTENT); } diff --git a/src/Resources/config/config.xml b/src/Resources/config/config.xml index 42334d0..0de0cb8 100755 --- a/src/Resources/config/config.xml +++ b/src/Resources/config/config.xml @@ -6,12 +6,12 @@ Minimal configuration - + maxDumps 6 - + retantionDays 0 @@ -19,7 +19,6 @@ dumpBinaryName - "" diff --git a/src/Resources/config/services.xml b/src/Resources/config/services.xml index 3c6530a..1d8d433 100755 --- a/src/Resources/config/services.xml +++ b/src/Resources/config/services.xml @@ -5,81 +5,82 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> - - + - + - + - + - + - - + + - + - + - - - + + + + - + - + - - + + + - - + + - - + + - - + + - - - + + + diff --git a/src/Service/DumpBinaryLocator.php b/src/Service/DumpBinaryLocator.php index 0027f63..7083d31 100644 --- a/src/Service/DumpBinaryLocator.php +++ b/src/Service/DumpBinaryLocator.php @@ -40,6 +40,9 @@ class DumpBinaryLocator private function isMariaDb(): bool { - return MySqlVariant::isMariaDb($this->connection->getServerVersion()); + // Connection::getServerVersion() is private in the DBAL version this + // repo pins against — SELECT VERSION() is the stable public way to get + // the same string. + return MySqlVariant::isMariaDb((string) $this->connection->fetchOne('SELECT VERSION()')); } }