Updates preparing for Doctrine 3.0
- Switch to EntityManagerInterface for EM uses - Wrap EntityManager in close-resilient wrapper - Close/clear/reopen EM with every request - Rework tests to be em->clear() resilient.
This commit is contained in:
parent
85991b7546
commit
4bcfad3eb5
|
@ -89,9 +89,9 @@
|
||||||
"flow/jsonpath": "^0.5",
|
"flow/jsonpath": "^0.5",
|
||||||
"mockery/mockery": "^1.0",
|
"mockery/mockery": "^1.0",
|
||||||
"overtrue/phplint": "^1.1",
|
"overtrue/phplint": "^1.1",
|
||||||
"phpstan/phpstan": "^0.11.1",
|
"phpstan/phpstan": "^0.12",
|
||||||
"phpstan/phpstan-doctrine": "^0.11.0",
|
"phpstan/phpstan-doctrine": "^0.12",
|
||||||
"phpstan/phpstan-strict-rules": "^0.11.0",
|
"phpstan/phpstan-strict-rules": "^0.12",
|
||||||
"phpunit/php-timer": "^3.1.4",
|
"phpunit/php-timer": "^3.1.4",
|
||||||
"roave/security-advisories": "dev-master",
|
"roave/security-advisories": "dev-master",
|
||||||
"squizlabs/php_codesniffer": "3.*"
|
"squizlabs/php_codesniffer": "3.*"
|
||||||
|
|
172
composer.lock
generated
172
composer.lock
generated
|
@ -4,7 +4,7 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "30fb1823a2fd210b7eb08ccbe9bab99c",
|
"content-hash": "5ba7e8647fd9f110a7573d7999a5fac1",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "aws/aws-sdk-php",
|
"name": "aws/aws-sdk-php",
|
||||||
|
@ -10141,172 +10141,108 @@
|
||||||
],
|
],
|
||||||
"time": "2020-03-05T15:02:03+00:00"
|
"time": "2020-03-05T15:02:03+00:00"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "phpstan/phpdoc-parser",
|
|
||||||
"version": "0.3.5",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/phpstan/phpdoc-parser.git",
|
|
||||||
"reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/8c4ef2aefd9788238897b678a985e1d5c8df6db4",
|
|
||||||
"reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": "~7.1"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"consistence/coding-standard": "^3.5",
|
|
||||||
"jakub-onderka/php-parallel-lint": "^0.9.2",
|
|
||||||
"phing/phing": "^2.16.0",
|
|
||||||
"phpstan/phpstan": "^0.10",
|
|
||||||
"phpunit/phpunit": "^6.3",
|
|
||||||
"slevomat/coding-standard": "^4.7.2",
|
|
||||||
"squizlabs/php_codesniffer": "^3.3.2",
|
|
||||||
"symfony/process": "^3.4 || ^4.0"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "0.3-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"PHPStan\\PhpDocParser\\": [
|
|
||||||
"src/"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"description": "PHPDoc parser with support for nullable, intersection and generic types",
|
|
||||||
"time": "2019-06-07T19:13:52+00:00"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "phpstan/phpstan",
|
"name": "phpstan/phpstan",
|
||||||
"version": "0.11.19",
|
"version": "0.12.31",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpstan/phpstan.git",
|
"url": "https://github.com/phpstan/phpstan.git",
|
||||||
"reference": "63cc502f6957b7f74efbac444b4cf219dcadffd7"
|
"reference": "776c8056b401e1b67f277b9e9fb334d1a274671d"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/63cc502f6957b7f74efbac444b4cf219dcadffd7",
|
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/776c8056b401e1b67f277b9e9fb334d1a274671d",
|
||||||
"reference": "63cc502f6957b7f74efbac444b4cf219dcadffd7",
|
"reference": "776c8056b401e1b67f277b9e9fb334d1a274671d",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"composer/xdebug-handler": "^1.3.0",
|
"php": "^7.1"
|
||||||
"jean85/pretty-package-versions": "^1.0.3",
|
|
||||||
"nette/bootstrap": "^2.4 || ^3.0",
|
|
||||||
"nette/di": "^2.4.7 || ^3.0",
|
|
||||||
"nette/neon": "^2.4.3 || ^3.0",
|
|
||||||
"nette/robot-loader": "^3.0.1",
|
|
||||||
"nette/schema": "^1.0",
|
|
||||||
"nette/utils": "^2.4.5 || ^3.0",
|
|
||||||
"nikic/php-parser": "^4.2.3",
|
|
||||||
"php": "~7.1",
|
|
||||||
"phpstan/phpdoc-parser": "^0.3.5",
|
|
||||||
"symfony/console": "~3.2 || ~4.0",
|
|
||||||
"symfony/finder": "~3.2 || ~4.0"
|
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"symfony/console": "3.4.16 || 4.1.5"
|
"phpstan/phpstan-shim": "*"
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"brianium/paratest": "^2.0 || ^3.0",
|
|
||||||
"consistence/coding-standard": "^3.5",
|
|
||||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
|
|
||||||
"ext-intl": "*",
|
|
||||||
"ext-mysqli": "*",
|
|
||||||
"ext-simplexml": "*",
|
|
||||||
"ext-soap": "*",
|
|
||||||
"ext-zip": "*",
|
|
||||||
"jakub-onderka/php-parallel-lint": "^1.0",
|
|
||||||
"localheinz/composer-normalize": "^1.1.0",
|
|
||||||
"phing/phing": "^2.16.0",
|
|
||||||
"phpstan/phpstan-deprecation-rules": "^0.11",
|
|
||||||
"phpstan/phpstan-php-parser": "^0.11",
|
|
||||||
"phpstan/phpstan-phpunit": "^0.11",
|
|
||||||
"phpstan/phpstan-strict-rules": "^0.11",
|
|
||||||
"phpunit/phpunit": "^7.5.14 || ^8.0",
|
|
||||||
"slevomat/coding-standard": "^4.7.2",
|
|
||||||
"squizlabs/php_codesniffer": "^3.3.2"
|
|
||||||
},
|
},
|
||||||
"bin": [
|
"bin": [
|
||||||
"bin/phpstan"
|
"phpstan",
|
||||||
|
"phpstan.phar"
|
||||||
],
|
],
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "0.11-dev"
|
"dev-master": "0.12-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"files": [
|
||||||
"PHPStan\\": [
|
"bootstrap.php"
|
||||||
"src/"
|
|
||||||
]
|
]
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
"MIT"
|
"MIT"
|
||||||
],
|
],
|
||||||
"description": "PHPStan - PHP Static Analysis Tool",
|
"description": "PHPStan - PHP Static Analysis Tool",
|
||||||
"time": "2019-10-22T20:20:22+00:00"
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/ondrejmirtes",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://www.patreon.com/phpstan",
|
||||||
|
"type": "patreon"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2020-06-24T20:55:29+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpstan/phpstan-doctrine",
|
"name": "phpstan/phpstan-doctrine",
|
||||||
"version": "0.11.6",
|
"version": "0.12.17",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpstan/phpstan-doctrine.git",
|
"url": "https://github.com/phpstan/phpstan-doctrine.git",
|
||||||
"reference": "77592865e167b32c7dcb4f39a35210e909a8854c"
|
"reference": "5eed42b2815f100f25bd45fe8c1a9b01f3e41657"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpstan/phpstan-doctrine/zipball/77592865e167b32c7dcb4f39a35210e909a8854c",
|
"url": "https://api.github.com/repos/phpstan/phpstan-doctrine/zipball/5eed42b2815f100f25bd45fe8c1a9b01f3e41657",
|
||||||
"reference": "77592865e167b32c7dcb4f39a35210e909a8854c",
|
"reference": "5eed42b2815f100f25bd45fe8c1a9b01f3e41657",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"nikic/php-parser": "^4.0",
|
|
||||||
"php": "~7.1",
|
"php": "~7.1",
|
||||||
"phpstan/phpdoc-parser": "^0.3",
|
"phpstan/phpstan": "^0.12.26"
|
||||||
"phpstan/phpstan": "^0.11.7"
|
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"doctrine/collections": "<1.0",
|
"doctrine/collections": "<1.0",
|
||||||
"doctrine/common": "<2.7",
|
"doctrine/common": "<2.7",
|
||||||
"doctrine/mongodb-odm": "<1.2",
|
"doctrine/mongodb-odm": "<1.2",
|
||||||
"doctrine/orm": "<2.5"
|
"doctrine/orm": "<2.5",
|
||||||
|
"doctrine/persistence": "<1.3"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"consistence/coding-standard": "^3.8",
|
"consistence/coding-standard": "^3.0.1",
|
||||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
|
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
|
||||||
"doctrine/collections": "^1.0",
|
"doctrine/collections": "^1.0",
|
||||||
"doctrine/common": "^2.7",
|
"doctrine/common": "^2.7 || ^3.0",
|
||||||
"doctrine/mongodb-odm": "^1.2",
|
"doctrine/mongodb-odm": "^1.3 || ^2.1",
|
||||||
"doctrine/orm": "^2.5",
|
"doctrine/orm": "^2.5",
|
||||||
|
"doctrine/persistence": "^1.1 || ^2.0",
|
||||||
|
"ergebnis/composer-normalize": "^2.0.2",
|
||||||
"jakub-onderka/php-parallel-lint": "^1.0",
|
"jakub-onderka/php-parallel-lint": "^1.0",
|
||||||
"phing/phing": "^2.16.0",
|
"phing/phing": "^2.16.0",
|
||||||
"phpstan/phpstan-phpunit": "^0.11",
|
"phpstan/phpstan-phpunit": "^0.12",
|
||||||
"phpstan/phpstan-strict-rules": "^0.11",
|
"phpstan/phpstan-strict-rules": "^0.12",
|
||||||
"phpunit/phpunit": "^7.0",
|
"phpunit/phpunit": "^7.0",
|
||||||
"slevomat/coding-standard": "^5.0.4"
|
"ramsey/uuid-doctrine": "^1.5.0",
|
||||||
|
"slevomat/coding-standard": "^4.5.2"
|
||||||
},
|
},
|
||||||
"type": "phpstan-extension",
|
"type": "phpstan-extension",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "0.11-dev"
|
"dev-master": "0.12-dev"
|
||||||
},
|
},
|
||||||
"phpstan": {
|
"phpstan": {
|
||||||
"includes": [
|
"includes": [
|
||||||
|
@ -10325,40 +10261,40 @@
|
||||||
"MIT"
|
"MIT"
|
||||||
],
|
],
|
||||||
"description": "Doctrine extensions for PHPStan",
|
"description": "Doctrine extensions for PHPStan",
|
||||||
"time": "2019-09-13T08:40:06+00:00"
|
"time": "2020-06-23T08:50:27+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpstan/phpstan-strict-rules",
|
"name": "phpstan/phpstan-strict-rules",
|
||||||
"version": "0.11.1",
|
"version": "0.12.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpstan/phpstan-strict-rules.git",
|
"url": "https://github.com/phpstan/phpstan-strict-rules.git",
|
||||||
"reference": "a203a7afdda073d4ea405a6d9007a5b32de3be61"
|
"reference": "a670a59aff7cf96f75d21b974860ada10e25b2ee"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/a203a7afdda073d4ea405a6d9007a5b32de3be61",
|
"url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/a670a59aff7cf96f75d21b974860ada10e25b2ee",
|
||||||
"reference": "a203a7afdda073d4ea405a6d9007a5b32de3be61",
|
"reference": "a670a59aff7cf96f75d21b974860ada10e25b2ee",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"nikic/php-parser": "^4.0",
|
|
||||||
"php": "~7.1",
|
"php": "~7.1",
|
||||||
"phpstan/phpstan": "^0.11.4"
|
"phpstan/phpstan": "^0.12.6"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"consistence/coding-standard": "^3.0.1",
|
"consistence/coding-standard": "^3.0.1",
|
||||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
|
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
|
||||||
|
"ergebnis/composer-normalize": "^2.0.2",
|
||||||
"jakub-onderka/php-parallel-lint": "^1.0",
|
"jakub-onderka/php-parallel-lint": "^1.0",
|
||||||
"phing/phing": "^2.16.0",
|
"phing/phing": "^2.16.0",
|
||||||
"phpstan/phpstan-phpunit": "^0.11",
|
"phpstan/phpstan-phpunit": "^0.12",
|
||||||
"phpunit/phpunit": "^7.0",
|
"phpunit/phpunit": "^7.0",
|
||||||
"slevomat/coding-standard": "^4.5.2"
|
"slevomat/coding-standard": "^4.5.2"
|
||||||
},
|
},
|
||||||
"type": "phpstan-extension",
|
"type": "phpstan-extension",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "0.11-dev"
|
"dev-master": "0.12-dev"
|
||||||
},
|
},
|
||||||
"phpstan": {
|
"phpstan": {
|
||||||
"includes": [
|
"includes": [
|
||||||
|
@ -10376,7 +10312,7 @@
|
||||||
"MIT"
|
"MIT"
|
||||||
],
|
],
|
||||||
"description": "Extra strict and opinionated rules for PHPStan",
|
"description": "Extra strict and opinionated rules for PHPStan",
|
||||||
"time": "2019-05-12T16:59:47+00:00"
|
"time": "2020-01-20T13:08:52+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/php-code-coverage",
|
"name": "phpunit/php-code-coverage",
|
||||||
|
|
|
@ -23,8 +23,8 @@ return function (\App\EventDispatcher $dispatcher) {
|
||||||
Doctrine\ORM\Tools\Console\ConsoleRunner::addCommands($console);
|
Doctrine\ORM\Tools\Console\ConsoleRunner::addCommands($console);
|
||||||
|
|
||||||
// Add Doctrine Migrations
|
// Add Doctrine Migrations
|
||||||
/** @var Doctrine\ORM\EntityManager $em */
|
/** @var Doctrine\ORM\EntityManagerInterface $em */
|
||||||
$em = $di->get(Doctrine\ORM\EntityManager::class);
|
$em = $di->get(Doctrine\ORM\EntityManagerInterface::class);
|
||||||
|
|
||||||
$helper_set = $console->getHelperSet();
|
$helper_set = $console->getHelperSet();
|
||||||
$doctrine_helpers = Doctrine\ORM\Tools\Console\ConsoleRunner::createHelperSet($em);
|
$doctrine_helpers = Doctrine\ORM\Tools\Console\ConsoleRunner::createHelperSet($em);
|
||||||
|
@ -73,6 +73,9 @@ return function (\App\EventDispatcher $dispatcher) {
|
||||||
$app->add(Middleware\InjectRouter::class);
|
$app->add(Middleware\InjectRouter::class);
|
||||||
$app->add(Middleware\InjectRateLimit::class);
|
$app->add(Middleware\InjectRateLimit::class);
|
||||||
|
|
||||||
|
// Re-establish database connection if multiple requests are handled by the same stack.
|
||||||
|
$app->add(Middleware\ReopenEntityManagerMiddleware::class);
|
||||||
|
|
||||||
// System middleware for routing and body parsing.
|
// System middleware for routing and body parsing.
|
||||||
$app->addBodyParsingMiddleware();
|
$app->addBodyParsingMiddleware();
|
||||||
$app->addRoutingMiddleware();
|
$app->addRoutingMiddleware();
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use Psr\Container\ContainerInterface;
|
use Psr\Container\ContainerInterface;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
@ -49,13 +48,12 @@ return [
|
||||||
},
|
},
|
||||||
|
|
||||||
// DBAL
|
// DBAL
|
||||||
Doctrine\DBAL\Connection::class => function (Doctrine\ORM\EntityManager $em) {
|
Doctrine\DBAL\Connection::class => function (Doctrine\ORM\EntityManagerInterface $em) {
|
||||||
return $em->getConnection();
|
return $em->getConnection();
|
||||||
},
|
},
|
||||||
'db' => DI\Get(Doctrine\DBAL\Connection::class),
|
|
||||||
|
|
||||||
// Doctrine Entity Manager
|
// Doctrine Entity Manager
|
||||||
Doctrine\ORM\EntityManager::class => function (
|
App\Doctrine\DecoratedEntityManager::class => function (
|
||||||
Doctrine\Common\Cache\Cache $doctrineCache,
|
Doctrine\Common\Cache\Cache $doctrineCache,
|
||||||
Doctrine\Common\Annotations\Reader $reader,
|
Doctrine\Common\Annotations\Reader $reader,
|
||||||
App\Settings $settings,
|
App\Settings $settings,
|
||||||
|
@ -112,12 +110,18 @@ return [
|
||||||
$eventManager->addEventSubscriber($eventRequiresRestart);
|
$eventManager->addEventSubscriber($eventRequiresRestart);
|
||||||
$eventManager->addEventSubscriber($eventAuditLog);
|
$eventManager->addEventSubscriber($eventAuditLog);
|
||||||
|
|
||||||
|
return new App\Doctrine\DecoratedEntityManager(function () use (
|
||||||
|
$connectionOptions,
|
||||||
|
$config,
|
||||||
|
$eventManager
|
||||||
|
) {
|
||||||
return Doctrine\ORM\EntityManager::create($connectionOptions, $config, $eventManager);
|
return Doctrine\ORM\EntityManager::create($connectionOptions, $config, $eventManager);
|
||||||
|
});
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new App\Exception\BootstrapException($e->getMessage());
|
throw new App\Exception\BootstrapException($e->getMessage());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'em' => DI\Get(Doctrine\ORM\EntityManager::class),
|
Doctrine\ORM\EntityManagerInterface::class => DI\Get(App\Doctrine\DecoratedEntityManager::class),
|
||||||
|
|
||||||
// Cache
|
// Cache
|
||||||
Psr\Cache\CacheItemPoolInterface::class => function (App\Settings $settings, Psr\Container\ContainerInterface $di) {
|
Psr\Cache\CacheItemPoolInterface::class => function (App\Settings $settings, Psr\Container\ContainerInterface $di) {
|
||||||
|
@ -284,7 +288,7 @@ return [
|
||||||
// Symfony Serializer
|
// Symfony Serializer
|
||||||
Symfony\Component\Serializer\Serializer::class => function (
|
Symfony\Component\Serializer\Serializer::class => function (
|
||||||
Doctrine\Common\Annotations\Reader $annotation_reader,
|
Doctrine\Common\Annotations\Reader $annotation_reader,
|
||||||
Doctrine\ORM\EntityManager $em
|
Doctrine\ORM\EntityManagerInterface $em
|
||||||
) {
|
) {
|
||||||
$meta_factory = new Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory(
|
$meta_factory = new Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory(
|
||||||
new Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader($annotation_reader)
|
new Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader($annotation_reader)
|
||||||
|
@ -316,7 +320,7 @@ return [
|
||||||
Redis $redis,
|
Redis $redis,
|
||||||
ContainerInterface $di,
|
ContainerInterface $di,
|
||||||
Monolog\Logger $logger,
|
Monolog\Logger $logger,
|
||||||
EntityManager $em
|
Doctrine\ORM\EntityManagerInterface $em
|
||||||
) {
|
) {
|
||||||
// Build QueueFactory
|
// Build QueueFactory
|
||||||
$driver = new Bernard\Driver\PhpRedis\Driver($redis);
|
$driver = new Bernard\Driver\PhpRedis\Driver($redis);
|
||||||
|
|
|
@ -4,7 +4,8 @@ parameters:
|
||||||
paths:
|
paths:
|
||||||
- src
|
- src
|
||||||
|
|
||||||
bootstrap: %rootDir%/../../../util/phpstan.php
|
bootstrapFiles:
|
||||||
|
- %rootDir%/../../../util/phpstan.php
|
||||||
|
|
||||||
universalObjectCratesClasses:
|
universalObjectCratesClasses:
|
||||||
- App\Session\NamespaceInterface
|
- App\Session\NamespaceInterface
|
||||||
|
|
|
@ -3,7 +3,7 @@ namespace App;
|
||||||
|
|
||||||
use App\Entity\Station;
|
use App\Entity\Station;
|
||||||
use App\Http\Router;
|
use App\Http\Router;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use GuzzleHttp\Psr7\UriResolver;
|
use GuzzleHttp\Psr7\UriResolver;
|
||||||
use Psr\Http\Message\UriInterface;
|
use Psr\Http\Message\UriInterface;
|
||||||
|
|
||||||
|
@ -13,13 +13,13 @@ use Psr\Http\Message\UriInterface;
|
||||||
*/
|
*/
|
||||||
class ApiUtilities
|
class ApiUtilities
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Router $router;
|
protected Router $router;
|
||||||
|
|
||||||
protected Customization $customization;
|
protected Customization $customization;
|
||||||
|
|
||||||
public function __construct(EntityManager $em, Router $router, Customization $customization)
|
public function __construct(EntityManagerInterface $em, Router $router, Customization $customization)
|
||||||
{
|
{
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->router = $router;
|
$this->router = $router;
|
||||||
|
|
|
@ -4,7 +4,6 @@ namespace App;
|
||||||
use App\Entity\Repository\UserRepository;
|
use App\Entity\Repository\UserRepository;
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
use App\Exception\NotLoggedInException;
|
use App\Exception\NotLoggedInException;
|
||||||
use App\Exception;
|
|
||||||
use Mezzio\Session\SessionInterface;
|
use Mezzio\Session\SessionInterface;
|
||||||
|
|
||||||
class Auth
|
class Auth
|
||||||
|
@ -170,7 +169,7 @@ class Auth
|
||||||
}
|
}
|
||||||
|
|
||||||
return ($this->user instanceof User)
|
return ($this->user instanceof User)
|
||||||
? $this->user
|
? $this->userRepo->getRepository()->find($this->user->getId())
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,7 @@ namespace App\Console\Command;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Sync\Task\Backup;
|
use App\Sync\Task\Backup;
|
||||||
use App\Utilities;
|
use App\Utilities;
|
||||||
use App\Console\Command\CommandAbstract;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use InfluxDB\Database;
|
use InfluxDB\Database;
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
use const PATHINFO_EXTENSION;
|
use const PATHINFO_EXTENSION;
|
||||||
|
@ -16,7 +15,7 @@ class BackupCommand extends CommandAbstract
|
||||||
|
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
SymfonyStyle $io,
|
SymfonyStyle $io,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Database $influxdb,
|
Database $influxdb,
|
||||||
?string $path = '',
|
?string $path = '',
|
||||||
bool $excludeMedia = false
|
bool $excludeMedia = false
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Console\Command\Internal;
|
namespace App\Console\Command\Internal;
|
||||||
|
|
||||||
|
use App\Console\Command\CommandAbstract;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Radio\Adapters;
|
use App\Radio\Adapters;
|
||||||
use App\Radio\Backend\Liquidsoap;
|
use App\Radio\Backend\Liquidsoap;
|
||||||
use App\Console\Command\CommandAbstract;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
|
|
||||||
class DjAuthCommand extends CommandAbstract
|
class DjAuthCommand extends CommandAbstract
|
||||||
{
|
{
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
SymfonyStyle $io,
|
SymfonyStyle $io,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Adapters $adapters,
|
Adapters $adapters,
|
||||||
int $stationId,
|
int $stationId,
|
||||||
string $djUser = '',
|
string $djUser = '',
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Console\Command\Internal;
|
namespace App\Console\Command\Internal;
|
||||||
|
|
||||||
|
use App\Console\Command\CommandAbstract;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Radio\Adapters;
|
use App\Radio\Adapters;
|
||||||
use App\Radio\Backend\Liquidsoap;
|
use App\Radio\Backend\Liquidsoap;
|
||||||
use App\Console\Command\CommandAbstract;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
|
|
||||||
class DjOffCommand extends CommandAbstract
|
class DjOffCommand extends CommandAbstract
|
||||||
{
|
{
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
SymfonyStyle $io,
|
SymfonyStyle $io,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Adapters $adapters,
|
Adapters $adapters,
|
||||||
int $stationId,
|
int $stationId,
|
||||||
string $djUser = ''
|
string $djUser = ''
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Console\Command\Internal;
|
namespace App\Console\Command\Internal;
|
||||||
|
|
||||||
|
use App\Console\Command\CommandAbstract;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Radio\Adapters;
|
use App\Radio\Adapters;
|
||||||
use App\Radio\Backend\Liquidsoap;
|
use App\Radio\Backend\Liquidsoap;
|
||||||
use App\Console\Command\CommandAbstract;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
|
|
||||||
class DjOnCommand extends CommandAbstract
|
class DjOnCommand extends CommandAbstract
|
||||||
{
|
{
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
SymfonyStyle $io,
|
SymfonyStyle $io,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Adapters $adapters,
|
Adapters $adapters,
|
||||||
int $stationId,
|
int $stationId,
|
||||||
string $djUser = ''
|
string $djUser = ''
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Console\Command\Internal;
|
namespace App\Console\Command\Internal;
|
||||||
|
|
||||||
|
use App\Console\Command\CommandAbstract;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Sync\Task\NowPlaying;
|
use App\Sync\Task\NowPlaying;
|
||||||
use App\Console\Command\CommandAbstract;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ class FeedbackCommand extends CommandAbstract
|
||||||
{
|
{
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
SymfonyStyle $io,
|
SymfonyStyle $io,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
NowPlaying $nowPlaying,
|
NowPlaying $nowPlaying,
|
||||||
int $stationId,
|
int $stationId,
|
||||||
string $song = null,
|
string $song = null,
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Console\Command\Internal;
|
namespace App\Console\Command\Internal;
|
||||||
|
|
||||||
|
use App\Console\Command\CommandAbstract;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Radio\AutoDJ;
|
use App\Radio\AutoDJ;
|
||||||
use App\Console\Command\CommandAbstract;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
|
|
||||||
class NextSongCommand extends CommandAbstract
|
class NextSongCommand extends CommandAbstract
|
||||||
{
|
{
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
SymfonyStyle $io,
|
SymfonyStyle $io,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
AutoDJ $autoDJ,
|
AutoDJ $autoDJ,
|
||||||
int $stationId,
|
int $stationId,
|
||||||
bool $asAutodj = false
|
bool $asAutodj = false
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Console\Command\Internal;
|
namespace App\Console\Command\Internal;
|
||||||
|
|
||||||
use App\Entity\SftpUser;
|
|
||||||
use App\Console\Command\CommandAbstract;
|
use App\Console\Command\CommandAbstract;
|
||||||
|
use App\Entity\SftpUser;
|
||||||
use Brick\Math\BigInteger;
|
use Brick\Math\BigInteger;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
|
|
||||||
class SftpAuthCommand extends CommandAbstract
|
class SftpAuthCommand extends CommandAbstract
|
||||||
{
|
{
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
SymfonyStyle $io,
|
SymfonyStyle $io,
|
||||||
EntityManager $em
|
EntityManagerInterface $em
|
||||||
) {
|
) {
|
||||||
$username = getenv('SFTPGO_AUTHD_USERNAME');
|
$username = getenv('SFTPGO_AUTHD_USERNAME');
|
||||||
$password = getenv('SFTPGO_AUTHD_PASSWORD');
|
$password = getenv('SFTPGO_AUTHD_PASSWORD');
|
||||||
|
|
|
@ -6,7 +6,7 @@ use App\Entity;
|
||||||
use App\Flysystem\Filesystem;
|
use App\Flysystem\Filesystem;
|
||||||
use App\Message;
|
use App\Message;
|
||||||
use App\MessageQueue;
|
use App\MessageQueue;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ class SftpUploadCommand extends CommandAbstract
|
||||||
{
|
{
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
SymfonyStyle $io,
|
SymfonyStyle $io,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\StationRepository $stationRepo,
|
Entity\Repository\StationRepository $stationRepo,
|
||||||
LoggerInterface $logger,
|
LoggerInterface $logger,
|
||||||
Filesystem $filesystem,
|
Filesystem $filesystem,
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
namespace App\Console\Command;
|
namespace App\Console\Command;
|
||||||
|
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
|
|
||||||
class ListUsersCommand extends CommandAbstract
|
class ListUsersCommand extends CommandAbstract
|
||||||
{
|
{
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
SymfonyStyle $io,
|
SymfonyStyle $io,
|
||||||
EntityManager $em
|
EntityManagerInterface $em
|
||||||
) {
|
) {
|
||||||
$io->title('AzuraCast User Accounts');
|
$io->title('AzuraCast User Accounts');
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,7 @@ namespace App\Console\Command;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Entity\Repository\StationRepository;
|
use App\Entity\Repository\StationRepository;
|
||||||
use App\Entity\Station;
|
use App\Entity\Station;
|
||||||
use App\Console\Command\CommandAbstract;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
|
|
||||||
|
@ -13,7 +12,7 @@ class ReprocessMediaCommand extends CommandAbstract
|
||||||
{
|
{
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
SymfonyStyle $io,
|
SymfonyStyle $io,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
StationRepository $stationRepo,
|
StationRepository $stationRepo,
|
||||||
Entity\Repository\StationMediaRepository $media_repo,
|
Entity\Repository\StationMediaRepository $media_repo,
|
||||||
?string $stationName = null
|
?string $stationName = null
|
||||||
|
|
|
@ -3,15 +3,14 @@ namespace App\Console\Command;
|
||||||
|
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Utilities;
|
use App\Utilities;
|
||||||
use App\Console\Command\CommandAbstract;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
|
|
||||||
class ResetPasswordCommand extends CommandAbstract
|
class ResetPasswordCommand extends CommandAbstract
|
||||||
{
|
{
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
SymfonyStyle $io,
|
SymfonyStyle $io,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
string $email
|
string $email
|
||||||
) {
|
) {
|
||||||
$io->title('Reset Account Password');
|
$io->title('Reset Account Password');
|
||||||
|
|
|
@ -4,14 +4,14 @@ namespace App\Console\Command;
|
||||||
use App\Entity\Repository\StationRepository;
|
use App\Entity\Repository\StationRepository;
|
||||||
use App\Entity\Station;
|
use App\Entity\Station;
|
||||||
use App\Radio\Configuration;
|
use App\Radio\Configuration;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
|
|
||||||
class RestartRadioCommand extends CommandAbstract
|
class RestartRadioCommand extends CommandAbstract
|
||||||
{
|
{
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
SymfonyStyle $io,
|
SymfonyStyle $io,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
StationRepository $stationRepo,
|
StationRepository $stationRepo,
|
||||||
Configuration $configuration,
|
Configuration $configuration,
|
||||||
?string $stationName = null
|
?string $stationName = null
|
||||||
|
|
|
@ -3,7 +3,7 @@ namespace App\Console\Command;
|
||||||
|
|
||||||
use App\Sync\Task\Backup;
|
use App\Sync\Task\Backup;
|
||||||
use App\Utilities;
|
use App\Utilities;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use InfluxDB\Database;
|
use InfluxDB\Database;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
|
@ -16,7 +16,7 @@ class RestoreCommand extends CommandAbstract
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
SymfonyStyle $io,
|
SymfonyStyle $io,
|
||||||
OutputInterface $output,
|
OutputInterface $output,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Database $influxdb,
|
Database $influxdb,
|
||||||
string $path
|
string $path
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -3,15 +3,14 @@ namespace App\Console\Command;
|
||||||
|
|
||||||
use App\Acl;
|
use App\Acl;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Console\Command\CommandAbstract;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
|
|
||||||
class SetAdministratorCommand extends CommandAbstract
|
class SetAdministratorCommand extends CommandAbstract
|
||||||
{
|
{
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
SymfonyStyle $io,
|
SymfonyStyle $io,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\RolePermissionRepository $perms_repo,
|
Entity\Repository\RolePermissionRepository $perms_repo,
|
||||||
string $email
|
string $email
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -3,12 +3,11 @@ namespace App\Console\Command;
|
||||||
|
|
||||||
use App\Entity\Station;
|
use App\Entity\Station;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use App\Console\Command\CommandAbstract;
|
|
||||||
use Cake\Chronos\Chronos;
|
use Cake\Chronos\Chronos;
|
||||||
use Doctrine\Common\DataFixtures\Executor\ORMExecutor;
|
use Doctrine\Common\DataFixtures\Executor\ORMExecutor;
|
||||||
use Doctrine\Common\DataFixtures\Loader;
|
use Doctrine\Common\DataFixtures\Loader;
|
||||||
use Doctrine\Common\DataFixtures\Purger\ORMPurger;
|
use Doctrine\Common\DataFixtures\Purger\ORMPurger;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use InfluxDB\Database;
|
use InfluxDB\Database;
|
||||||
use InfluxDB\Point;
|
use InfluxDB\Point;
|
||||||
use Psr\Container\ContainerInterface;
|
use Psr\Container\ContainerInterface;
|
||||||
|
@ -20,7 +19,7 @@ class SetupFixturesCommand extends CommandAbstract
|
||||||
{
|
{
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
SymfonyStyle $io,
|
SymfonyStyle $io,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
ContainerInterface $di,
|
ContainerInterface $di,
|
||||||
Database $influx,
|
Database $influx,
|
||||||
Settings $settings
|
Settings $settings
|
||||||
|
|
|
@ -4,14 +4,14 @@ namespace App\Controller\Admin;
|
||||||
use App\Exception\NotFoundException;
|
use App\Exception\NotFoundException;
|
||||||
use App\Form\EntityForm;
|
use App\Form\EntityForm;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
|
|
||||||
abstract class AbstractAdminCrudController
|
abstract class AbstractAdminCrudController
|
||||||
{
|
{
|
||||||
protected EntityForm $form;
|
protected EntityForm $form;
|
||||||
|
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected string $entity_class;
|
protected string $entity_class;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ use App\Http\ServerRequest;
|
||||||
use App\Radio\AutoDJ;
|
use App\Radio\AutoDJ;
|
||||||
use App\Radio\Backend\Liquidsoap;
|
use App\Radio\Backend\Liquidsoap;
|
||||||
use App\Sync\Runner;
|
use App\Sync\Runner;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Monolog\Handler\TestHandler;
|
use Monolog\Handler\TestHandler;
|
||||||
use Monolog\Logger;
|
use Monolog\Logger;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
@ -75,7 +75,7 @@ class DebugController
|
||||||
public function nextsongAction(
|
public function nextsongAction(
|
||||||
ServerRequest $request,
|
ServerRequest $request,
|
||||||
Response $response,
|
Response $response,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
AutoDJ $autoDJ
|
AutoDJ $autoDJ
|
||||||
): ResponseInterface {
|
): ResponseInterface {
|
||||||
$this->logger->pushHandler($this->testHandler);
|
$this->logger->pushHandler($this->testHandler);
|
||||||
|
|
|
@ -7,14 +7,14 @@ use App\Exception;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class LogsController extends AbstractLogViewerController
|
class LogsController extends AbstractLogViewerController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
public function __construct(EntityManager $em)
|
public function __construct(EntityManagerInterface $em)
|
||||||
{
|
{
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,14 +4,14 @@ namespace App\Controller\Admin;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class RelaysController
|
class RelaysController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
public function __construct(EntityManager $em)
|
public function __construct(EntityManagerInterface $em)
|
||||||
{
|
{
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ use App\Exception\ValidationException;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Utilities;
|
use App\Utilities;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\OptimisticLockException;
|
use Doctrine\ORM\OptimisticLockException;
|
||||||
use Doctrine\ORM\ORMException;
|
use Doctrine\ORM\ORMException;
|
||||||
use Doctrine\ORM\Query;
|
use Doctrine\ORM\Query;
|
||||||
|
@ -18,7 +18,7 @@ use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
|
||||||
abstract class AbstractApiCrudController
|
abstract class AbstractApiCrudController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Serializer $serializer;
|
protected Serializer $serializer;
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ abstract class AbstractApiCrudController
|
||||||
/** @var string The route name used to generate the "self" links for each record. */
|
/** @var string The route name used to generate the "self" links for each record. */
|
||||||
protected string $resourceRouteName;
|
protected string $resourceRouteName;
|
||||||
|
|
||||||
public function __construct(EntityManager $em, Serializer $serializer, ValidatorInterface $validator)
|
public function __construct(EntityManagerInterface $em, Serializer $serializer, ValidatorInterface $validator)
|
||||||
{
|
{
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->serializer = $serializer;
|
$this->serializer = $serializer;
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Controller\Api\Admin;
|
namespace App\Controller\Api\Admin;
|
||||||
|
|
||||||
|
use App\Doctrine\Paginator;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Doctrine\Paginator;
|
|
||||||
use Cake\Chronos\Chronos;
|
use Cake\Chronos\Chronos;
|
||||||
use DateTimeZone;
|
use DateTimeZone;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use const JSON_PRETTY_PRINT;
|
use const JSON_PRETTY_PRINT;
|
||||||
|
|
||||||
class AuditLogController
|
class AuditLogController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
public function __construct(EntityManager $em)
|
public function __construct(EntityManagerInterface $em)
|
||||||
{
|
{
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,18 +6,18 @@ use App\Entity;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Radio\Adapters;
|
use App\Radio\Adapters;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use OpenApi\Annotations as OA;
|
use OpenApi\Annotations as OA;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class RelaysController
|
class RelaysController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Adapters $adapters;
|
protected Adapters $adapters;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Adapters $adapters
|
Adapters $adapters
|
||||||
) {
|
) {
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
|
|
|
@ -5,7 +5,7 @@ use App\Entity;
|
||||||
use App\Exception\ValidationException;
|
use App\Exception\ValidationException;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use OpenApi\Annotations as OA;
|
use OpenApi\Annotations as OA;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
||||||
|
@ -14,7 +14,7 @@ use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
|
||||||
class SettingsController
|
class SettingsController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Serializer $serializer;
|
protected Serializer $serializer;
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ class SettingsController
|
||||||
protected Entity\Api\Admin\Settings $api_settings;
|
protected Entity\Api\Admin\Settings $api_settings;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\SettingsRepository $settings_repo,
|
Entity\Repository\SettingsRepository $settings_repo,
|
||||||
Serializer $serializer,
|
Serializer $serializer,
|
||||||
ValidatorInterface $validator
|
ValidatorInterface $validator
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace App\Controller\Api\Admin;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Exception\ValidationException;
|
use App\Exception\ValidationException;
|
||||||
use App\Normalizer\DoctrineEntityNormalizer;
|
use App\Normalizer\DoctrineEntityNormalizer;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use OpenApi\Annotations as OA;
|
use OpenApi\Annotations as OA;
|
||||||
use Symfony\Component\Serializer\Serializer;
|
use Symfony\Component\Serializer\Serializer;
|
||||||
|
@ -18,7 +18,7 @@ class StationsController extends AbstractAdminApiCrudController
|
||||||
protected Entity\Repository\StationRepository $station_repo;
|
protected Entity\Repository\StationRepository $station_repo;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Serializer $serializer,
|
Serializer $serializer,
|
||||||
ValidatorInterface $validator,
|
ValidatorInterface $validator,
|
||||||
Entity\Repository\StationRepository $station_repo
|
Entity\Repository\StationRepository $station_repo
|
||||||
|
|
|
@ -6,7 +6,7 @@ use App\Event\Radio\LoadNowPlaying;
|
||||||
use App\EventDispatcher;
|
use App\EventDispatcher;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use OpenApi\Annotations as OA;
|
use OpenApi\Annotations as OA;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\SimpleCache\CacheInterface;
|
use Psr\SimpleCache\CacheInterface;
|
||||||
|
@ -14,7 +14,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
|
|
||||||
class NowplayingController implements EventSubscriberInterface
|
class NowplayingController implements EventSubscriberInterface
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Entity\Repository\SettingsRepository $settingsRepo;
|
protected Entity\Repository\SettingsRepository $settingsRepo;
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ class NowplayingController implements EventSubscriberInterface
|
||||||
protected EventDispatcher $dispatcher;
|
protected EventDispatcher $dispatcher;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\SettingsRepository $settingsRepo,
|
Entity\Repository\SettingsRepository $settingsRepo,
|
||||||
CacheInterface $cache,
|
CacheInterface $cache,
|
||||||
EventDispatcher $dispatcher
|
EventDispatcher $dispatcher
|
||||||
|
|
|
@ -5,7 +5,7 @@ use App\Entity;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use Cake\Chronos\Chronos;
|
use Cake\Chronos\Chronos;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Symfony\Component\Serializer\Serializer;
|
use Symfony\Component\Serializer\Serializer;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
@ -15,7 +15,7 @@ abstract class AbstractScheduledEntityController extends AbstractStationApiCrudC
|
||||||
protected Entity\Repository\StationScheduleRepository $scheduleRepo;
|
protected Entity\Repository\StationScheduleRepository $scheduleRepo;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Serializer $serializer,
|
Serializer $serializer,
|
||||||
ValidatorInterface $validator,
|
ValidatorInterface $validator,
|
||||||
Entity\Repository\StationScheduleRepository $scheduleRepo
|
Entity\Repository\StationScheduleRepository $scheduleRepo
|
||||||
|
|
|
@ -9,7 +9,7 @@ use App\Http\ServerRequest;
|
||||||
use App\Message\WritePlaylistFileMessage;
|
use App\Message\WritePlaylistFileMessage;
|
||||||
use App\MessageQueue;
|
use App\MessageQueue;
|
||||||
use App\Radio\Backend\Liquidsoap;
|
use App\Radio\Backend\Liquidsoap;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ class BatchAction
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
ServerRequest $request,
|
ServerRequest $request,
|
||||||
Response $response,
|
Response $response,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\StationMediaRepository $mediaRepo,
|
Entity\Repository\StationMediaRepository $mediaRepo,
|
||||||
Entity\Repository\StationPlaylistMediaRepository $playlistMediaRepo,
|
Entity\Repository\StationPlaylistMediaRepository $playlistMediaRepo,
|
||||||
Entity\Repository\StationPlaylistFolderRepository $playlistFolderRepo,
|
Entity\Repository\StationPlaylistFolderRepository $playlistFolderRepo,
|
||||||
|
@ -55,7 +55,7 @@ class BatchAction
|
||||||
$music_files = $this->getMusicFiles($fs, $files);
|
$music_files = $this->getMusicFiles($fs, $files);
|
||||||
$files_found = count($music_files);
|
$files_found = count($music_files);
|
||||||
|
|
||||||
/** @var Entity\StationPlaylist[] $playlists */
|
/** @var Entity\StationPlaylist[] $affected_playlists */
|
||||||
$affected_playlists = [];
|
$affected_playlists = [];
|
||||||
|
|
||||||
foreach ($music_files as $file) {
|
foreach ($music_files as $file) {
|
||||||
|
|
|
@ -5,7 +5,7 @@ use App\Entity;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Service\Flow;
|
use App\Service\Flow;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Error;
|
use Error;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
@ -15,7 +15,7 @@ class FlowUploadAction
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
ServerRequest $request,
|
ServerRequest $request,
|
||||||
Response $response,
|
Response $response,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\StationMediaRepository $mediaRepo,
|
Entity\Repository\StationMediaRepository $mediaRepo,
|
||||||
Entity\Repository\StationPlaylistMediaRepository $spmRepo
|
Entity\Repository\StationPlaylistMediaRepository $spmRepo
|
||||||
): ResponseInterface {
|
): ResponseInterface {
|
||||||
|
|
|
@ -7,7 +7,7 @@ use App\Flysystem\Filesystem;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Utilities;
|
use App\Utilities;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use const SORT_ASC;
|
use const SORT_ASC;
|
||||||
use const SORT_DESC;
|
use const SORT_DESC;
|
||||||
|
@ -17,7 +17,7 @@ class ListAction
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
ServerRequest $request,
|
ServerRequest $request,
|
||||||
Response $response,
|
Response $response,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Filesystem $filesystem,
|
Filesystem $filesystem,
|
||||||
Customization $customization
|
Customization $customization
|
||||||
): ResponseInterface {
|
): ResponseInterface {
|
||||||
|
|
|
@ -5,7 +5,7 @@ use App\Entity;
|
||||||
use App\Flysystem\Filesystem;
|
use App\Flysystem\Filesystem;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class RenameAction
|
class RenameAction
|
||||||
|
@ -14,7 +14,7 @@ class RenameAction
|
||||||
ServerRequest $request,
|
ServerRequest $request,
|
||||||
Response $response,
|
Response $response,
|
||||||
Filesystem $filesystem,
|
Filesystem $filesystem,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\StationMediaRepository $mediaRepo
|
Entity\Repository\StationMediaRepository $mediaRepo
|
||||||
): ResponseInterface {
|
): ResponseInterface {
|
||||||
$originalPath = $request->getAttribute('file');
|
$originalPath = $request->getAttribute('file');
|
||||||
|
|
|
@ -10,7 +10,7 @@ use App\Message\WritePlaylistFileMessage;
|
||||||
use App\MessageQueue;
|
use App\MessageQueue;
|
||||||
use App\Radio\Adapters;
|
use App\Radio\Adapters;
|
||||||
use App\Radio\Backend\Liquidsoap;
|
use App\Radio\Backend\Liquidsoap;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use OpenApi\Annotations as OA;
|
use OpenApi\Annotations as OA;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
@ -38,7 +38,7 @@ class FilesController extends AbstractStationApiCrudController
|
||||||
protected Entity\Repository\StationPlaylistMediaRepository $playlist_media_repo;
|
protected Entity\Repository\StationPlaylistMediaRepository $playlist_media_repo;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Serializer $serializer,
|
Serializer $serializer,
|
||||||
ValidatorInterface $validator,
|
ValidatorInterface $validator,
|
||||||
Filesystem $filesystem,
|
Filesystem $filesystem,
|
||||||
|
@ -271,7 +271,7 @@ class FilesController extends AbstractStationApiCrudController
|
||||||
if (null !== $playlists) {
|
if (null !== $playlists) {
|
||||||
$station = $record->getStation();
|
$station = $record->getStation();
|
||||||
|
|
||||||
/** @var Entity\StationPlaylist[] $playlists */
|
/** @var Entity\StationPlaylist[] $affected_playlists */
|
||||||
$affected_playlists = [];
|
$affected_playlists = [];
|
||||||
|
|
||||||
// Remove existing playlists.
|
// Remove existing playlists.
|
||||||
|
@ -288,13 +288,13 @@ class FilesController extends AbstractStationApiCrudController
|
||||||
$playlist_id = $new_playlist['id'];
|
$playlist_id = $new_playlist['id'];
|
||||||
$playlist_weight = $new_playlist['weight'] ?? 0;
|
$playlist_weight = $new_playlist['weight'] ?? 0;
|
||||||
} else {
|
} else {
|
||||||
$playlist_id = $new_playlist;
|
$playlist_id = (int)$new_playlist;
|
||||||
$playlist_weight = 0;
|
$playlist_weight = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$playlist = $this->em->getRepository(Entity\StationPlaylist::class)->findOneBy([
|
$playlist = $this->em->getRepository(Entity\StationPlaylist::class)->findOneBy([
|
||||||
'station_id' => $station->getId(),
|
'station_id' => $station->getId(),
|
||||||
'id' => (int)$playlist_id,
|
'id' => $playlist_id,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($playlist instanceof Entity\StationPlaylist) {
|
if ($playlist instanceof Entity\StationPlaylist) {
|
||||||
|
@ -330,7 +330,7 @@ class FilesController extends AbstractStationApiCrudController
|
||||||
|
|
||||||
$station = $record->getStation();
|
$station = $record->getStation();
|
||||||
|
|
||||||
/** @var Entity\StationPlaylist[] $playlists */
|
/** @var Entity\StationPlaylist[] $affected_playlists */
|
||||||
$affected_playlists = [];
|
$affected_playlists = [];
|
||||||
|
|
||||||
$media_playlists = $this->playlist_media_repo->clearPlaylistsFromMedia($record);
|
$media_playlists = $this->playlist_media_repo->clearPlaylistsFromMedia($record);
|
||||||
|
|
|
@ -9,17 +9,17 @@ use App\Http\ServerRequest;
|
||||||
use App\Utilities\Csv;
|
use App\Utilities\Csv;
|
||||||
use Cake\Chronos\Chronos;
|
use Cake\Chronos\Chronos;
|
||||||
use DateTimeZone;
|
use DateTimeZone;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use OpenApi\Annotations as OA;
|
use OpenApi\Annotations as OA;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class HistoryController
|
class HistoryController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected App\ApiUtilities $api_utils;
|
protected App\ApiUtilities $api_utils;
|
||||||
|
|
||||||
public function __construct(EntityManager $em, App\ApiUtilities $api_utils)
|
public function __construct(EntityManagerInterface $em, App\ApiUtilities $api_utils)
|
||||||
{
|
{
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->api_utils = $api_utils;
|
$this->api_utils = $api_utils;
|
||||||
|
|
|
@ -7,17 +7,17 @@ use App\Exception\NotFoundException;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Radio\Adapters;
|
use App\Radio\Adapters;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use OpenApi\Annotations as OA;
|
use OpenApi\Annotations as OA;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class IndexController
|
class IndexController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Adapters $adapters;
|
protected Adapters $adapters;
|
||||||
|
|
||||||
public function __construct(EntityManager $em, Adapters $adapters)
|
public function __construct(EntityManagerInterface $em, Adapters $adapters)
|
||||||
{
|
{
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->adapters = $adapters;
|
$this->adapters = $adapters;
|
||||||
|
|
|
@ -8,18 +8,18 @@ use App\Service\IpGeolocation;
|
||||||
use App\Utilities\Csv;
|
use App\Utilities\Csv;
|
||||||
use Cake\Chronos\Chronos;
|
use Cake\Chronos\Chronos;
|
||||||
use DateTimeZone;
|
use DateTimeZone;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Mobile_Detect;
|
use Mobile_Detect;
|
||||||
use OpenApi\Annotations as OA;
|
use OpenApi\Annotations as OA;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class ListenersController
|
class ListenersController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected IpGeolocation $geoLite;
|
protected IpGeolocation $geoLite;
|
||||||
|
|
||||||
public function __construct(EntityManager $em, IpGeolocation $geoLite)
|
public function __construct(EntityManagerInterface $em, IpGeolocation $geoLite)
|
||||||
{
|
{
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->geoLite = $geoLite;
|
$this->geoLite = $geoLite;
|
||||||
|
|
|
@ -7,7 +7,7 @@ use App\Entity;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Utilities;
|
use App\Utilities;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class ListAction
|
class ListAction
|
||||||
|
@ -15,7 +15,7 @@ class ListAction
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
ServerRequest $request,
|
ServerRequest $request,
|
||||||
Response $response,
|
Response $response,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
ApiUtilities $apiUtils
|
ApiUtilities $apiUtils
|
||||||
): ResponseInterface {
|
): ResponseInterface {
|
||||||
$station = $request->getStation();
|
$station = $request->getStation();
|
||||||
|
|
|
@ -5,7 +5,7 @@ use App;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use OpenApi\Annotations as OA;
|
use OpenApi\Annotations as OA;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
@ -20,7 +20,7 @@ class QueueController extends AbstractStationApiCrudController
|
||||||
protected App\ApiUtilities $apiUtils;
|
protected App\ApiUtilities $apiUtils;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Serializer $serializer,
|
Serializer $serializer,
|
||||||
ValidatorInterface $validator,
|
ValidatorInterface $validator,
|
||||||
App\ApiUtilities $apiUtils
|
App\ApiUtilities $apiUtils
|
||||||
|
|
|
@ -8,20 +8,20 @@ use App\Exception;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Utilities;
|
use App\Utilities;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use OpenApi\Annotations as OA;
|
use OpenApi\Annotations as OA;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class RequestsController
|
class RequestsController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Entity\Repository\StationRequestRepository $requestRepo;
|
protected Entity\Repository\StationRequestRepository $requestRepo;
|
||||||
|
|
||||||
protected ApiUtilities $api_utils;
|
protected ApiUtilities $api_utils;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\StationRequestRepository $requestRepo,
|
Entity\Repository\StationRequestRepository $requestRepo,
|
||||||
ApiUtilities $api_utils
|
ApiUtilities $api_utils
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -5,7 +5,7 @@ use App\Entity\Repository\StationScheduleRepository;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use Cake\Chronos\Chronos;
|
use Cake\Chronos\Chronos;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use OpenApi\Annotations as OA;
|
use OpenApi\Annotations as OA;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\SimpleCache\CacheInterface;
|
use Psr\SimpleCache\CacheInterface;
|
||||||
|
@ -42,7 +42,7 @@ class ScheduleController extends AbstractStationApiCrudController
|
||||||
*
|
*
|
||||||
* @param ServerRequest $request
|
* @param ServerRequest $request
|
||||||
* @param Response $response
|
* @param Response $response
|
||||||
* @param EntityManager $em
|
* @param EntityManagerInterface $em
|
||||||
* @param CacheInterface $cache
|
* @param CacheInterface $cache
|
||||||
* @param StationScheduleRepository $scheduleRepo
|
* @param StationScheduleRepository $scheduleRepo
|
||||||
*
|
*
|
||||||
|
@ -51,7 +51,7 @@ class ScheduleController extends AbstractStationApiCrudController
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
ServerRequest $request,
|
ServerRequest $request,
|
||||||
Response $response,
|
Response $response,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
CacheInterface $cache,
|
CacheInterface $cache,
|
||||||
StationScheduleRepository $scheduleRepo
|
StationScheduleRepository $scheduleRepo
|
||||||
): ResponseInterface {
|
): ResponseInterface {
|
||||||
|
|
|
@ -8,17 +8,17 @@ use App\Http\ServerRequest;
|
||||||
use App\Radio\AutoDJ;
|
use App\Radio\AutoDJ;
|
||||||
use App\Radio\Backend\Liquidsoap;
|
use App\Radio\Backend\Liquidsoap;
|
||||||
use App\Radio\Configuration;
|
use App\Radio\Configuration;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use OpenApi\Annotations as OA;
|
use OpenApi\Annotations as OA;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class ServicesController
|
class ServicesController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Configuration $configuration;
|
protected Configuration $configuration;
|
||||||
|
|
||||||
public function __construct(EntityManager $em, Configuration $configuration)
|
public function __construct(EntityManagerInterface $em, Configuration $configuration)
|
||||||
{
|
{
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->configuration = $configuration;
|
$this->configuration = $configuration;
|
||||||
|
|
|
@ -11,7 +11,7 @@ use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\RateLimit;
|
use App\RateLimit;
|
||||||
use App\Session\Flash;
|
use App\Session\Flash;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class LoginAction
|
class LoginAction
|
||||||
|
@ -21,7 +21,7 @@ class LoginAction
|
||||||
Response $response,
|
Response $response,
|
||||||
Acl $acl,
|
Acl $acl,
|
||||||
Auth $auth,
|
Auth $auth,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
RateLimit $rateLimit,
|
RateLimit $rateLimit,
|
||||||
SettingsRepository $settingsRepo
|
SettingsRepository $settingsRepo
|
||||||
): ResponseInterface {
|
): ResponseInterface {
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Controller\Frontend;
|
namespace App\Controller\Frontend;
|
||||||
|
|
||||||
|
use App\Config;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Exception\NotFoundException;
|
use App\Exception\NotFoundException;
|
||||||
use App\Form\Form;
|
use App\Form\Form;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Config;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class ApiKeysController
|
class ApiKeysController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected string $csrf_namespace = 'frontend_api_keys';
|
protected string $csrf_namespace = 'frontend_api_keys';
|
||||||
|
|
||||||
|
@ -20,8 +20,11 @@ class ApiKeysController
|
||||||
|
|
||||||
protected array $form_config;
|
protected array $form_config;
|
||||||
|
|
||||||
public function __construct(EntityManager $em, Entity\Repository\ApiKeyRepository $apiKeyRepository, Config $config)
|
public function __construct(
|
||||||
{
|
EntityManagerInterface $em,
|
||||||
|
Entity\Repository\ApiKeyRepository $apiKeyRepository,
|
||||||
|
Config $config
|
||||||
|
) {
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->record_repo = $apiKeyRepository;
|
$this->record_repo = $apiKeyRepository;
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ use App\Http\Response;
|
||||||
use App\Http\Router;
|
use App\Http\Router;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Radio\Adapters;
|
use App\Radio\Adapters;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use InfluxDB\Database;
|
use InfluxDB\Database;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\SimpleCache\CacheInterface;
|
use Psr\SimpleCache\CacheInterface;
|
||||||
|
@ -17,7 +17,7 @@ use stdClass;
|
||||||
|
|
||||||
class DashboardController
|
class DashboardController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Entity\Repository\SettingsRepository $settingsRepo;
|
protected Entity\Repository\SettingsRepository $settingsRepo;
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ class DashboardController
|
||||||
protected EventDispatcher $dispatcher;
|
protected EventDispatcher $dispatcher;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\SettingsRepository $settingsRepo,
|
Entity\Repository\SettingsRepository $settingsRepo,
|
||||||
Acl $acl,
|
Acl $acl,
|
||||||
CacheInterface $cache,
|
CacheInterface $cache,
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace App\Controller\Frontend\Profile;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Session\Flash;
|
use App\Session\Flash;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class DisableTwoFactorAction
|
class DisableTwoFactorAction
|
||||||
|
@ -12,7 +12,7 @@ class DisableTwoFactorAction
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
ServerRequest $request,
|
ServerRequest $request,
|
||||||
Response $response,
|
Response $response,
|
||||||
EntityManager $em
|
EntityManagerInterface $em
|
||||||
): ResponseInterface {
|
): ResponseInterface {
|
||||||
$user = $request->getUser();
|
$user = $request->getUser();
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ use App\Http\ServerRequest;
|
||||||
use App\Session\Flash;
|
use App\Session\Flash;
|
||||||
use AzuraForms\Field\AbstractField;
|
use AzuraForms\Field\AbstractField;
|
||||||
use BaconQrCode;
|
use BaconQrCode;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use OTPHP\TOTP;
|
use OTPHP\TOTP;
|
||||||
use ParagonIE\ConstantTime\Base32;
|
use ParagonIE\ConstantTime\Base32;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
@ -20,7 +20,7 @@ class EnableTwoFactorAction
|
||||||
ServerRequest $request,
|
ServerRequest $request,
|
||||||
Response $response,
|
Response $response,
|
||||||
Config $config,
|
Config $config,
|
||||||
EntityManager $em
|
EntityManagerInterface $em
|
||||||
): ResponseInterface {
|
): ResponseInterface {
|
||||||
$twoFactorFormConfig = $config->get('forms/profile_two_factor');
|
$twoFactorFormConfig = $config->get('forms/profile_two_factor');
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ use App\Exception\StationNotFoundException;
|
||||||
use App\Exception\StationUnsupportedException;
|
use App\Exception\StationUnsupportedException;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class OnDemandAction
|
class OnDemandAction
|
||||||
|
@ -13,7 +13,7 @@ class OnDemandAction
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
ServerRequest $request,
|
ServerRequest $request,
|
||||||
Response $response,
|
Response $response,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
bool $embed = false
|
bool $embed = false
|
||||||
): ResponseInterface {
|
): ResponseInterface {
|
||||||
// Override system-wide iframe refusal
|
// Override system-wide iframe refusal
|
||||||
|
|
|
@ -9,14 +9,14 @@ use App\Form\SettingsForm;
|
||||||
use App\Form\StationForm;
|
use App\Form\StationForm;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Settings;
|
|
||||||
use App\Session\Flash;
|
use App\Session\Flash;
|
||||||
use Doctrine\ORM\EntityManager;
|
use App\Settings;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class SetupController
|
class SetupController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Entity\Repository\SettingsRepository $settingsRepo;
|
protected Entity\Repository\SettingsRepository $settingsRepo;
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ class SetupController
|
||||||
protected Settings $settings;
|
protected Settings $settings;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\SettingsRepository $settingsRepository,
|
Entity\Repository\SettingsRepository $settingsRepository,
|
||||||
Auth $auth,
|
Auth $auth,
|
||||||
Acl $acl,
|
Acl $acl,
|
||||||
|
|
|
@ -7,7 +7,7 @@ use App\Exception\CsrfValidationException;
|
||||||
use App\Exception\NotFoundException;
|
use App\Exception\NotFoundException;
|
||||||
use App\Form\EntityForm;
|
use App\Form\EntityForm;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
use Doctrine\ORM\OptimisticLockException;
|
use Doctrine\ORM\OptimisticLockException;
|
||||||
use Doctrine\ORM\ORMException;
|
use Doctrine\ORM\ORMException;
|
||||||
|
@ -16,7 +16,7 @@ abstract class AbstractStationCrudController
|
||||||
{
|
{
|
||||||
protected EntityForm $form;
|
protected EntityForm $form;
|
||||||
|
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected string $entity_class;
|
protected string $entity_class;
|
||||||
|
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Controller\Stations;
|
namespace App\Controller\Stations;
|
||||||
|
|
||||||
|
use App\Config;
|
||||||
use App\Form\Form;
|
use App\Form\Form;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
|
use App\Session\Flash;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use App\Sync\Task\RadioAutomation;
|
use App\Sync\Task\RadioAutomation;
|
||||||
use App\Config;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use App\Session\Flash;
|
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class AutomationController
|
class AutomationController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected RadioAutomation $sync_task;
|
protected RadioAutomation $sync_task;
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ class AutomationController
|
||||||
protected array $form_config;
|
protected array $form_config;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
RadioAutomation $sync_task,
|
RadioAutomation $sync_task,
|
||||||
Settings $app_settings,
|
Settings $app_settings,
|
||||||
Config $config
|
Config $config
|
||||||
|
|
|
@ -8,7 +8,7 @@ use App\Http\ServerRequest;
|
||||||
use App\Radio\Backend\Liquidsoap;
|
use App\Radio\Backend\Liquidsoap;
|
||||||
use App\Session\Flash;
|
use App\Session\Flash;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class EditLiquidsoapConfigController
|
class EditLiquidsoapConfigController
|
||||||
|
@ -16,7 +16,7 @@ class EditLiquidsoapConfigController
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
ServerRequest $request,
|
ServerRequest $request,
|
||||||
Response $response,
|
Response $response,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Settings $settings
|
Settings $settings
|
||||||
): ResponseInterface {
|
): ResponseInterface {
|
||||||
$station = $request->getStation();
|
$station = $request->getStation();
|
||||||
|
|
|
@ -5,7 +5,7 @@ use App\Entity;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Service\SftpGo;
|
use App\Service\SftpGo;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class FilesController
|
class FilesController
|
||||||
|
@ -13,7 +13,7 @@ class FilesController
|
||||||
public function __invoke(
|
public function __invoke(
|
||||||
ServerRequest $request,
|
ServerRequest $request,
|
||||||
Response $response,
|
Response $response,
|
||||||
EntityManager $em
|
EntityManagerInterface $em
|
||||||
): ResponseInterface {
|
): ResponseInterface {
|
||||||
$station = $request->getStation();
|
$station = $request->getStation();
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,12 @@ use App\Entity;
|
||||||
use App\Form\StationForm;
|
use App\Form\StationForm;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class ProfileController
|
class ProfileController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Entity\Repository\StationRepository $station_repo;
|
protected Entity\Repository\StationRepository $station_repo;
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ class ProfileController
|
||||||
protected string $csrf_namespace = 'stations_profile';
|
protected string $csrf_namespace = 'stations_profile';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\StationRepository $station_repo,
|
Entity\Repository\StationRepository $station_repo,
|
||||||
StationForm $station_form
|
StationForm $station_form
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -6,19 +6,19 @@ use App\Flysystem\Filesystem;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Session\Flash;
|
use App\Session\Flash;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class DuplicatesController
|
class DuplicatesController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Entity\Repository\StationMediaRepository $mediaRepo;
|
protected Entity\Repository\StationMediaRepository $mediaRepo;
|
||||||
|
|
||||||
protected Filesystem $filesystem;
|
protected Filesystem $filesystem;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\StationMediaRepository $mediaRepo,
|
Entity\Repository\StationMediaRepository $mediaRepo,
|
||||||
Filesystem $filesystem
|
Filesystem $filesystem
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -6,7 +6,7 @@ use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use Cake\Chronos\Chronos;
|
use Cake\Chronos\Chronos;
|
||||||
use DateTimeZone;
|
use DateTimeZone;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use InfluxDB\Database;
|
use InfluxDB\Database;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
|
@ -15,14 +15,17 @@ use function array_slice;
|
||||||
|
|
||||||
class OverviewController
|
class OverviewController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Entity\Repository\SettingsRepository $settingsRepo;
|
protected Entity\Repository\SettingsRepository $settingsRepo;
|
||||||
|
|
||||||
protected Database $influx;
|
protected Database $influx;
|
||||||
|
|
||||||
public function __construct(EntityManager $em, Entity\Repository\SettingsRepository $settingsRepo, Database $influx)
|
public function __construct(
|
||||||
{
|
EntityManagerInterface $em,
|
||||||
|
Entity\Repository\SettingsRepository $settingsRepo,
|
||||||
|
Database $influx
|
||||||
|
) {
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->settingsRepo = $settingsRepo;
|
$this->settingsRepo = $settingsRepo;
|
||||||
$this->influx = $influx;
|
$this->influx = $influx;
|
||||||
|
|
|
@ -6,16 +6,16 @@ use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Sync\Task\RadioAutomation;
|
use App\Sync\Task\RadioAutomation;
|
||||||
use App\Utilities\Csv;
|
use App\Utilities\Csv;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class PerformanceController
|
class PerformanceController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected RadioAutomation $sync_automation;
|
protected RadioAutomation $sync_automation;
|
||||||
|
|
||||||
public function __construct(EntityManager $em, RadioAutomation $sync_automation)
|
public function __construct(EntityManagerInterface $em, RadioAutomation $sync_automation)
|
||||||
{
|
{
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->sync_automation = $sync_automation;
|
$this->sync_automation = $sync_automation;
|
||||||
|
|
|
@ -5,16 +5,16 @@ use App\Entity;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Session\Flash;
|
use App\Session\Flash;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class RequestsController
|
class RequestsController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected string $csrf_namespace = 'stations_requests';
|
protected string $csrf_namespace = 'stations_requests';
|
||||||
|
|
||||||
public function __construct(EntityManager $em)
|
public function __construct(EntityManagerInterface $em)
|
||||||
{
|
{
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Controller\Stations\Reports;
|
namespace App\Controller\Stations\Reports;
|
||||||
|
|
||||||
|
use App\Config;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Form\Form;
|
use App\Form\Form;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Config;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
|
@ -15,21 +15,13 @@ use Psr\Http\Message\ResponseInterface;
|
||||||
*/
|
*/
|
||||||
class SoundExchangeController
|
class SoundExchangeController
|
||||||
{
|
{
|
||||||
/** @var EntityManager */
|
protected EntityManagerInterface $em;
|
||||||
protected EntityManager $em;
|
|
||||||
|
|
||||||
/** @var Client */
|
|
||||||
protected Client $http_client;
|
protected Client $http_client;
|
||||||
|
|
||||||
/** @var array */
|
|
||||||
protected array $form_config;
|
protected array $form_config;
|
||||||
|
|
||||||
/**
|
public function __construct(EntityManagerInterface $em, Client $http_client, Config $config)
|
||||||
* @param EntityManager $em
|
|
||||||
* @param Client $http_client
|
|
||||||
* @param Config $config
|
|
||||||
*/
|
|
||||||
public function __construct(EntityManager $em, Client $http_client, Config $config)
|
|
||||||
{
|
{
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->form_config = $config->get('forms/report/soundexchange');
|
$this->form_config = $config->get('forms/report/soundexchange');
|
||||||
|
|
|
@ -7,19 +7,19 @@ use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Service\AzuraCastCentral;
|
use App\Service\AzuraCastCentral;
|
||||||
use App\Session\Flash;
|
use App\Session\Flash;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class StreamersController
|
class StreamersController
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected AzuraCastCentral $ac_central;
|
protected AzuraCastCentral $ac_central;
|
||||||
|
|
||||||
protected Entity\Repository\SettingsRepository $settingsRepo;
|
protected Entity\Repository\SettingsRepository $settingsRepo;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
AzuraCastCentral $ac_central,
|
AzuraCastCentral $ac_central,
|
||||||
Entity\Repository\SettingsRepository $settingsRepo
|
Entity\Repository\SettingsRepository $settingsRepo
|
||||||
) {
|
) {
|
||||||
|
|
51
src/Doctrine/DecoratedEntityManager.php
Normal file
51
src/Doctrine/DecoratedEntityManager.php
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
<?php
|
||||||
|
namespace App\Doctrine;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use Doctrine\ORM\Decorator\EntityManagerDecorator;
|
||||||
|
|
||||||
|
class DecoratedEntityManager extends EntityManagerDecorator
|
||||||
|
{
|
||||||
|
protected Closure $createEm;
|
||||||
|
|
||||||
|
public function __construct(callable $createEm)
|
||||||
|
{
|
||||||
|
parent::__construct($createEm());
|
||||||
|
$this->createEm = Closure::fromCallable($createEm);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Recreate the underlying EntityManager if it was closed due to a previous exception.
|
||||||
|
*/
|
||||||
|
public function open(): void
|
||||||
|
{
|
||||||
|
if (!$this->wrapped->isOpen()) {
|
||||||
|
$this->wrapped = ($this->createEm)();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch a new, managed instance of an entity object, even if the EntityManager has been cleared.
|
||||||
|
*
|
||||||
|
* @template T
|
||||||
|
*
|
||||||
|
* @param T $entity
|
||||||
|
*
|
||||||
|
* @return T
|
||||||
|
*/
|
||||||
|
public function refetch($entity)
|
||||||
|
{
|
||||||
|
$metadata = $this->wrapped->getClassMetadata(get_class($entity));
|
||||||
|
$freshValue = $this->wrapped->find($metadata->getName(), $metadata->getIdentifierValues($entity));
|
||||||
|
|
||||||
|
if (!$freshValue) {
|
||||||
|
throw new \InvalidArgumentException(
|
||||||
|
sprintf('Object of class %s cannot be refetched.', get_class($entity))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $freshValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -7,7 +7,7 @@ use App\Annotations\AuditLog\AuditIgnore;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use Doctrine\Common\Annotations\Reader;
|
use Doctrine\Common\Annotations\Reader;
|
||||||
use Doctrine\Common\EventSubscriber;
|
use Doctrine\Common\EventSubscriber;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\Event\OnFlushEventArgs;
|
use Doctrine\ORM\Event\OnFlushEventArgs;
|
||||||
use Doctrine\ORM\Events;
|
use Doctrine\ORM\Events;
|
||||||
use Doctrine\ORM\Mapping\ClassMetadataInfo;
|
use Doctrine\ORM\Mapping\ClassMetadataInfo;
|
||||||
|
@ -219,12 +219,12 @@ class AuditLog implements EventSubscriber
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param EntityManager $em
|
* @param EntityManagerInterface $em
|
||||||
* @param object|string $class
|
* @param object|string $class
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected function isEntity(EntityManager $em, $class): bool
|
protected function isEntity(EntityManagerInterface $em, $class): bool
|
||||||
{
|
{
|
||||||
if (is_object($class)) {
|
if (is_object($class)) {
|
||||||
$class = ($class instanceof Proxy || $class instanceof GhostObjectInterface)
|
$class = ($class instanceof Proxy || $class instanceof GhostObjectInterface)
|
||||||
|
|
|
@ -5,6 +5,7 @@ use App\Normalizer\DoctrineEntityNormalizer;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use Closure;
|
use Closure;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManager;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Symfony\Component\Serializer\Serializer;
|
use Symfony\Component\Serializer\Serializer;
|
||||||
|
@ -30,13 +31,17 @@ class Repository
|
||||||
protected $logger;
|
protected $logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param EntityManager $em
|
* @param EntityManagerInterface $em
|
||||||
* @param Serializer $serializer
|
* @param Serializer $serializer
|
||||||
* @param Settings $settings
|
* @param Settings $settings
|
||||||
* @param LoggerInterface $logger
|
* @param LoggerInterface $logger
|
||||||
*/
|
*/
|
||||||
public function __construct(EntityManager $em, Serializer $serializer, Settings $settings, LoggerInterface $logger)
|
public function __construct(
|
||||||
{
|
EntityManagerInterface $em,
|
||||||
|
Serializer $serializer,
|
||||||
|
Settings $settings,
|
||||||
|
LoggerInterface $logger
|
||||||
|
) {
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->serializer = $serializer;
|
$this->serializer = $serializer;
|
||||||
$this->settings = $settings;
|
$this->settings = $settings;
|
||||||
|
|
|
@ -5,7 +5,7 @@ use App\ApiUtilities;
|
||||||
use App\Doctrine\Repository;
|
use App\Doctrine\Repository;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Psr\Http\Message\UriInterface;
|
use Psr\Http\Message\UriInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
@ -16,7 +16,7 @@ class SongHistoryRepository extends Repository
|
||||||
protected ListenerRepository $listenerRepository;
|
protected ListenerRepository $listenerRepository;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Serializer $serializer,
|
Serializer $serializer,
|
||||||
Settings $settings,
|
Settings $settings,
|
||||||
LoggerInterface $logger,
|
LoggerInterface $logger,
|
||||||
|
|
|
@ -7,7 +7,7 @@ use App\Exception\MediaProcessingException;
|
||||||
use App\Flysystem\Filesystem;
|
use App\Flysystem\Filesystem;
|
||||||
use App\Service\AudioWaveform;
|
use App\Service\AudioWaveform;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\ORMException;
|
use Doctrine\ORM\ORMException;
|
||||||
use Exception;
|
use Exception;
|
||||||
use getID3;
|
use getID3;
|
||||||
|
@ -27,7 +27,7 @@ class StationMediaRepository extends Repository
|
||||||
protected CustomFieldRepository $customFieldRepo;
|
protected CustomFieldRepository $customFieldRepo;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Serializer $serializer,
|
Serializer $serializer,
|
||||||
Settings $settings,
|
Settings $settings,
|
||||||
LoggerInterface $logger,
|
LoggerInterface $logger,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use App\Radio\Frontend\AbstractFrontend;
|
||||||
use App\Sync\Task\Media;
|
use App\Sync\Task\Media;
|
||||||
use App\Utilities;
|
use App\Utilities;
|
||||||
use Closure;
|
use Closure;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Psr\SimpleCache\CacheInterface;
|
use Psr\SimpleCache\CacheInterface;
|
||||||
|
@ -29,7 +29,7 @@ class StationRepository extends Repository
|
||||||
protected CacheInterface $cache;
|
protected CacheInterface $cache;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Serializer $serializer,
|
Serializer $serializer,
|
||||||
\App\Settings $settings,
|
\App\Settings $settings,
|
||||||
LoggerInterface $logger,
|
LoggerInterface $logger,
|
||||||
|
|
|
@ -5,17 +5,18 @@ use App\Entity;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManager;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
|
||||||
abstract class AbstractSettingsForm extends Form
|
abstract class AbstractSettingsForm extends Form
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Entity\Repository\SettingsRepository $settingsRepo;
|
protected Entity\Repository\SettingsRepository $settingsRepo;
|
||||||
|
|
||||||
protected Settings $settings;
|
protected Settings $settings;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\SettingsRepository $settingsRepo,
|
Entity\Repository\SettingsRepository $settingsRepo,
|
||||||
Settings $settings,
|
Settings $settings,
|
||||||
array $formConfig
|
array $formConfig
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
use App\Entity;
|
|
||||||
use App\Config;
|
use App\Config;
|
||||||
use Doctrine\ORM\EntityManager;
|
use App\Entity;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Component\Serializer\Serializer;
|
use Symfony\Component\Serializer\Serializer;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
|
||||||
class ApiKeyForm extends EntityForm
|
class ApiKeyForm extends EntityForm
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Serializer $serializer,
|
Serializer $serializer,
|
||||||
ValidatorInterface $validator,
|
ValidatorInterface $validator,
|
||||||
Config $config
|
Config $config
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
|
use App\Config;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use App\Config;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
|
|
||||||
class BackupSettingsForm extends AbstractSettingsForm
|
class BackupSettingsForm extends AbstractSettingsForm
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\SettingsRepository $settingsRepo,
|
Entity\Repository\SettingsRepository $settingsRepo,
|
||||||
Settings $settings,
|
Settings $settings,
|
||||||
Config $config
|
Config $config
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
|
use App\Config;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use App\Config;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
|
|
||||||
class BrandingSettingsForm extends AbstractSettingsForm
|
class BrandingSettingsForm extends AbstractSettingsForm
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\SettingsRepository $settingsRepo,
|
Entity\Repository\SettingsRepository $settingsRepo,
|
||||||
Settings $settings,
|
Settings $settings,
|
||||||
Config $config
|
Config $config
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
use App\Entity;
|
|
||||||
use App\Config;
|
use App\Config;
|
||||||
use Doctrine\ORM\EntityManager;
|
use App\Entity;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Component\Serializer\Serializer;
|
use Symfony\Component\Serializer\Serializer;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
|
||||||
class CustomFieldForm extends EntityForm
|
class CustomFieldForm extends EntityForm
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Serializer $serializer,
|
Serializer $serializer,
|
||||||
ValidatorInterface $validator,
|
ValidatorInterface $validator,
|
||||||
Config $config
|
Config $config
|
||||||
|
|
|
@ -6,8 +6,8 @@ use App\Exception;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Normalizer\DoctrineEntityNormalizer;
|
use App\Normalizer\DoctrineEntityNormalizer;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\Persistence\ObjectRepository;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
|
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
|
||||||
use Symfony\Component\Serializer\Serializer;
|
use Symfony\Component\Serializer\Serializer;
|
||||||
|
@ -23,7 +23,7 @@ use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
*/
|
*/
|
||||||
class EntityForm extends Form
|
class EntityForm extends Form
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Serializer $serializer;
|
protected Serializer $serializer;
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ class EntityForm extends Form
|
||||||
protected ?Station $station = null;
|
protected ?Station $station = null;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Serializer $serializer,
|
Serializer $serializer,
|
||||||
ValidatorInterface $validator,
|
ValidatorInterface $validator,
|
||||||
array $options = [],
|
array $options = [],
|
||||||
|
@ -61,12 +61,12 @@ class EntityForm extends Form
|
||||||
$this->entityClass = $entityClass;
|
$this->entityClass = $entityClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEntityManager(): EntityManager
|
public function getEntityManager(): EntityManagerInterface
|
||||||
{
|
{
|
||||||
return $this->em;
|
return $this->em;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEntityRepository(): EntityRepository
|
public function getEntityRepository(): ObjectRepository
|
||||||
{
|
{
|
||||||
if (null === $this->entityClass) {
|
if (null === $this->entityClass) {
|
||||||
throw new Exception('Entity class name is not specified.');
|
throw new Exception('Entity class name is not specified.');
|
||||||
|
|
|
@ -5,14 +5,14 @@ use App\Config;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use App\Sync\Task\UpdateGeoLiteDatabase;
|
use App\Sync\Task\UpdateGeoLiteDatabase;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
|
||||||
class GeoLiteSettingsForm extends AbstractSettingsForm
|
class GeoLiteSettingsForm extends AbstractSettingsForm
|
||||||
{
|
{
|
||||||
protected UpdateGeoLiteDatabase $syncTask;
|
protected UpdateGeoLiteDatabase $syncTask;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\SettingsRepository $settingsRepo,
|
Entity\Repository\SettingsRepository $settingsRepo,
|
||||||
Settings $settings,
|
Settings $settings,
|
||||||
Config $config,
|
Config $config,
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
|
use App\Config;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Config;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use Symfony\Component\Serializer\Serializer;
|
use Symfony\Component\Serializer\Serializer;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ class PermissionsForm extends EntityForm
|
||||||
protected bool $set_permissions = true;
|
protected bool $set_permissions = true;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Serializer $serializer,
|
Serializer $serializer,
|
||||||
ValidatorInterface $validator,
|
ValidatorInterface $validator,
|
||||||
Config $config,
|
Config $config,
|
||||||
|
|
|
@ -5,12 +5,12 @@ use App\Config;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
|
||||||
class SettingsForm extends AbstractSettingsForm
|
class SettingsForm extends AbstractSettingsForm
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\SettingsRepository $settingsRepo,
|
Entity\Repository\SettingsRepository $settingsRepo,
|
||||||
Settings $settings,
|
Settings $settings,
|
||||||
Config $config
|
Config $config
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
use App\Entity;
|
|
||||||
use App\Config;
|
use App\Config;
|
||||||
use Doctrine\ORM\EntityManager;
|
use App\Entity;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Component\Serializer\Serializer;
|
use Symfony\Component\Serializer\Serializer;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
|
||||||
class SftpUserForm extends EntityForm
|
class SftpUserForm extends EntityForm
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Serializer $serializer,
|
Serializer $serializer,
|
||||||
ValidatorInterface $validator,
|
ValidatorInterface $validator,
|
||||||
Config $config
|
Config $config
|
||||||
|
|
|
@ -10,7 +10,7 @@ use App\Settings;
|
||||||
use App\Sync\Task\Media;
|
use App\Sync\Task\Media;
|
||||||
use DeepCopy;
|
use DeepCopy;
|
||||||
use Doctrine\Common\Collections\Collection;
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Symfony\Component\Serializer\Serializer;
|
use Symfony\Component\Serializer\Serializer;
|
||||||
|
@ -23,7 +23,7 @@ class StationCloneForm extends StationForm
|
||||||
protected Media $media_sync;
|
protected Media $media_sync;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Serializer $serializer,
|
Serializer $serializer,
|
||||||
ValidatorInterface $validator,
|
ValidatorInterface $validator,
|
||||||
Entity\Repository\StationRepository $station_repo,
|
Entity\Repository\StationRepository $station_repo,
|
||||||
|
|
|
@ -7,7 +7,7 @@ use App\Entity;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Radio\Frontend\SHOUTcast;
|
use App\Radio\Frontend\SHOUTcast;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Component\Serializer\Serializer;
|
use Symfony\Component\Serializer\Serializer;
|
||||||
use Symfony\Component\Validator\ConstraintViolation;
|
use Symfony\Component\Validator\ConstraintViolation;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
@ -21,7 +21,7 @@ class StationForm extends EntityForm
|
||||||
protected Settings $settings;
|
protected Settings $settings;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Serializer $serializer,
|
Serializer $serializer,
|
||||||
ValidatorInterface $validator,
|
ValidatorInterface $validator,
|
||||||
Entity\Repository\StationRepository $station_repo,
|
Entity\Repository\StationRepository $station_repo,
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
|
use App\Config;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Entity\Station;
|
use App\Entity\Station;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Radio\Adapters;
|
use App\Radio\Adapters;
|
||||||
use App\Config;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use Symfony\Component\Serializer\Serializer;
|
use Symfony\Component\Serializer\Serializer;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ class StationMountForm extends EntityForm
|
||||||
protected array $form_configs;
|
protected array $form_configs;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Serializer $serializer,
|
Serializer $serializer,
|
||||||
ValidatorInterface $validator,
|
ValidatorInterface $validator,
|
||||||
Config $config
|
Config $config
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
use App\Entity;
|
|
||||||
use App\Config;
|
use App\Config;
|
||||||
use Doctrine\ORM\EntityManager;
|
use App\Entity;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Component\Serializer\Serializer;
|
use Symfony\Component\Serializer\Serializer;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
|
||||||
class StationRemoteForm extends EntityForm
|
class StationRemoteForm extends EntityForm
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Serializer $serializer,
|
Serializer $serializer,
|
||||||
ValidatorInterface $validator,
|
ValidatorInterface $validator,
|
||||||
Config $config
|
Config $config
|
||||||
|
|
|
@ -6,7 +6,7 @@ use App\Entity;
|
||||||
use App\Http\Router;
|
use App\Http\Router;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use Symfony\Component\Serializer\Serializer;
|
use Symfony\Component\Serializer\Serializer;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
@ -18,7 +18,7 @@ class StationWebhookForm extends EntityForm
|
||||||
protected array $forms;
|
protected array $forms;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Serializer $serializer,
|
Serializer $serializer,
|
||||||
ValidatorInterface $validator,
|
ValidatorInterface $validator,
|
||||||
Settings $settings,
|
Settings $settings,
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
|
use App\Config;
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Config;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use Symfony\Component\Serializer\Serializer;
|
use Symfony\Component\Serializer\Serializer;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
|
||||||
class UserForm extends EntityForm
|
class UserForm extends EntityForm
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Serializer $serializer,
|
Serializer $serializer,
|
||||||
ValidatorInterface $validator,
|
ValidatorInterface $validator,
|
||||||
Config $config,
|
Config $config,
|
||||||
|
|
|
@ -6,14 +6,14 @@ use App\Entity;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use AzuraForms\Field\AbstractField;
|
use AzuraForms\Field\AbstractField;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Component\Serializer\Serializer;
|
use Symfony\Component\Serializer\Serializer;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
|
||||||
class UserProfileForm extends EntityForm
|
class UserProfileForm extends EntityForm
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Serializer $serializer,
|
Serializer $serializer,
|
||||||
ValidatorInterface $validator,
|
ValidatorInterface $validator,
|
||||||
Config $config,
|
Config $config,
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace App\Http;
|
||||||
use App\Flysystem\FilesystemGroup;
|
use App\Flysystem\FilesystemGroup;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class Response extends \Slim\Http\Response
|
final class Response extends \Slim\Http\Response
|
||||||
{
|
{
|
||||||
public const CACHE_ONE_MINUTE = 60;
|
public const CACHE_ONE_MINUTE = 60;
|
||||||
public const CACHE_ONE_HOUR = 3600;
|
public const CACHE_ONE_HOUR = 3600;
|
||||||
|
|
|
@ -10,7 +10,7 @@ use App\Session;
|
||||||
use App\View;
|
use App\View;
|
||||||
use Mezzio\Session\SessionInterface;
|
use Mezzio\Session\SessionInterface;
|
||||||
|
|
||||||
class ServerRequest extends \Slim\Http\ServerRequest
|
final class ServerRequest extends \Slim\Http\ServerRequest
|
||||||
{
|
{
|
||||||
public const ATTR_VIEW = 'app_view';
|
public const ATTR_VIEW = 'app_view';
|
||||||
public const ATTR_SESSION = 'app_session';
|
public const ATTR_SESSION = 'app_session';
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App;
|
namespace App;
|
||||||
|
|
||||||
|
use App\Doctrine\DecoratedEntityManager;
|
||||||
use App\Message\AbstractDelayedMessage;
|
use App\Message\AbstractDelayedMessage;
|
||||||
use Bernard\BernardEvents;
|
use Bernard\BernardEvents;
|
||||||
use Bernard\Consumer;
|
use Bernard\Consumer;
|
||||||
|
@ -10,7 +11,6 @@ use Bernard\Message;
|
||||||
use Bernard\Producer;
|
use Bernard\Producer;
|
||||||
use Bernard\Queue;
|
use Bernard\Queue;
|
||||||
use Bernard\QueueFactory;
|
use Bernard\QueueFactory;
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use Monolog\Logger;
|
use Monolog\Logger;
|
||||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
|
|
||||||
|
@ -26,14 +26,14 @@ class MessageQueue implements EventSubscriberInterface
|
||||||
|
|
||||||
protected Logger $logger;
|
protected Logger $logger;
|
||||||
|
|
||||||
protected EntityManager $em;
|
protected DecoratedEntityManager $em;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
QueueFactory $queues,
|
QueueFactory $queues,
|
||||||
Producer $producer,
|
Producer $producer,
|
||||||
Consumer $consumer,
|
Consumer $consumer,
|
||||||
Logger $logger,
|
Logger $logger,
|
||||||
EntityManager $em
|
DecoratedEntityManager $em
|
||||||
) {
|
) {
|
||||||
$this->queues = $queues;
|
$this->queues = $queues;
|
||||||
$this->producer = $producer;
|
$this->producer = $producer;
|
||||||
|
@ -120,12 +120,7 @@ class MessageQueue implements EventSubscriberInterface
|
||||||
|
|
||||||
public function checkEntityManager(): void
|
public function checkEntityManager(): void
|
||||||
{
|
{
|
||||||
// Shut the process manager down if the entity manager isn't open.
|
$this->em->open();
|
||||||
if (!$this->em->isOpen()) {
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clear the EM before running any new tasks.
|
|
||||||
$this->em->clear();
|
$this->em->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
39
src/Middleware/ReopenEntityManagerMiddleware.php
Normal file
39
src/Middleware/ReopenEntityManagerMiddleware.php
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Middleware;
|
||||||
|
|
||||||
|
use App\Doctrine\DecoratedEntityManager;
|
||||||
|
use App\Settings;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
use Psr\Http\Server\MiddlewareInterface;
|
||||||
|
use Psr\Http\Server\RequestHandlerInterface;
|
||||||
|
|
||||||
|
class ReopenEntityManagerMiddleware implements MiddlewareInterface
|
||||||
|
{
|
||||||
|
protected DecoratedEntityManager $em;
|
||||||
|
|
||||||
|
protected Settings $settings;
|
||||||
|
|
||||||
|
public function __construct(DecoratedEntityManager $em, Settings $settings)
|
||||||
|
{
|
||||||
|
$this->em = $em;
|
||||||
|
$this->settings = $settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
||||||
|
{
|
||||||
|
$this->em->open();
|
||||||
|
|
||||||
|
try {
|
||||||
|
return $handler->handle($request);
|
||||||
|
} finally {
|
||||||
|
if (!$this->settings->isTesting()) {
|
||||||
|
$this->em->getConnection()->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->em->clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,7 +8,7 @@ use Doctrine\Common\Annotations\Reader;
|
||||||
use Doctrine\Common\Collections\Collection;
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\Inflector\Inflector;
|
use Doctrine\Inflector\Inflector;
|
||||||
use Doctrine\Inflector\InflectorFactory;
|
use Doctrine\Inflector\InflectorFactory;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
|
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
|
||||||
use Doctrine\ORM\Proxy\Proxy;
|
use Doctrine\ORM\Proxy\Proxy;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
|
@ -40,21 +40,14 @@ class DoctrineEntityNormalizer extends AbstractNormalizer
|
||||||
/** @var SerializerInterface|NormalizerInterface|DenormalizerInterface */
|
/** @var SerializerInterface|NormalizerInterface|DenormalizerInterface */
|
||||||
protected $serializer;
|
protected $serializer;
|
||||||
|
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Reader $annotationReader;
|
protected Reader $annotationReader;
|
||||||
|
|
||||||
protected Inflector $inflector;
|
protected Inflector $inflector;
|
||||||
|
|
||||||
/**
|
|
||||||
* @param EntityManager $em
|
|
||||||
* @param Reader|null $annotationReader
|
|
||||||
* @param ClassMetadataFactoryInterface|null $classMetadataFactory
|
|
||||||
* @param NameConverterInterface|null $nameConverter
|
|
||||||
* @param array $defaultContext
|
|
||||||
*/
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Reader $annotationReader = null,
|
Reader $annotationReader = null,
|
||||||
ClassMetadataFactoryInterface $classMetadataFactory = null,
|
ClassMetadataFactoryInterface $classMetadataFactory = null,
|
||||||
NameConverterInterface $nameConverter = null,
|
NameConverterInterface $nameConverter = null,
|
||||||
|
@ -397,7 +390,9 @@ class DoctrineEntityNormalizer extends AbstractNormalizer
|
||||||
$first_param = $method->getParameters()[0];
|
$first_param = $method->getParameters()[0];
|
||||||
|
|
||||||
if ($first_param->hasType()) {
|
if ($first_param->hasType()) {
|
||||||
$first_param_type = $first_param->getType()->getName();
|
/** @var \ReflectionNamedType $firstParamTypeObj */
|
||||||
|
$firstParamTypeObj = $first_param->getType();
|
||||||
|
$first_param_type = $firstParamTypeObj->getName();
|
||||||
|
|
||||||
switch ($first_param_type) {
|
switch ($first_param_type) {
|
||||||
case 'DateTime':
|
case 'DateTime':
|
||||||
|
|
|
@ -6,7 +6,7 @@ use App\Entity;
|
||||||
use App\Event\GetNotifications;
|
use App\Event\GetNotifications;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use Cake\Chronos\Chronos;
|
use Cake\Chronos\Chronos;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Monolog\Logger;
|
use Monolog\Logger;
|
||||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ class Manager implements EventSubscriberInterface
|
||||||
{
|
{
|
||||||
protected Acl $acl;
|
protected Acl $acl;
|
||||||
|
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Logger $logger;
|
protected Logger $logger;
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ class Manager implements EventSubscriberInterface
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
Acl $acl,
|
Acl $acl,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\SettingsRepository $settings_repo,
|
Entity\Repository\SettingsRepository $settings_repo,
|
||||||
Logger $logger,
|
Logger $logger,
|
||||||
Settings $app_settings
|
Settings $app_settings
|
||||||
|
|
|
@ -2,28 +2,28 @@
|
||||||
namespace App\Radio;
|
namespace App\Radio;
|
||||||
|
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
|
use App\EventDispatcher;
|
||||||
use App\Exception\Supervisor\AlreadyRunningException;
|
use App\Exception\Supervisor\AlreadyRunningException;
|
||||||
use App\Exception\Supervisor\BadNameException;
|
use App\Exception\Supervisor\BadNameException;
|
||||||
use App\Exception\Supervisor\NotRunningException;
|
use App\Exception\Supervisor\NotRunningException;
|
||||||
use App\Exception\SupervisorException;
|
use App\Exception\SupervisorException;
|
||||||
use App\Settings;
|
|
||||||
use App\EventDispatcher;
|
|
||||||
use App\Logger;
|
use App\Logger;
|
||||||
use Doctrine\ORM\EntityManager;
|
use App\Settings;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use fXmlRpc\Exception\FaultException;
|
use fXmlRpc\Exception\FaultException;
|
||||||
use Supervisor\Process;
|
use Supervisor\Process;
|
||||||
use Supervisor\Supervisor;
|
use Supervisor\Supervisor;
|
||||||
|
|
||||||
abstract class AbstractAdapter
|
abstract class AbstractAdapter
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Supervisor $supervisor;
|
protected Supervisor $supervisor;
|
||||||
|
|
||||||
protected EventDispatcher $dispatcher;
|
protected EventDispatcher $dispatcher;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Supervisor $supervisor,
|
Supervisor $supervisor,
|
||||||
EventDispatcher $dispatcher
|
EventDispatcher $dispatcher
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -9,7 +9,7 @@ use App\Flysystem\Filesystem;
|
||||||
use App\Lock\LockManager;
|
use App\Lock\LockManager;
|
||||||
use Cake\Chronos\Chronos;
|
use Cake\Chronos\Chronos;
|
||||||
use DateTimeZone;
|
use DateTimeZone;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Monolog\Logger;
|
use Monolog\Logger;
|
||||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ class AutoDJ implements EventSubscriberInterface
|
||||||
{
|
{
|
||||||
protected Adapters $adapters;
|
protected Adapters $adapters;
|
||||||
|
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Entity\Repository\SongRepository $songRepo;
|
protected Entity\Repository\SongRepository $songRepo;
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ class AutoDJ implements EventSubscriberInterface
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
Adapters $adapters,
|
Adapters $adapters,
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\SongRepository $songRepo,
|
Entity\Repository\SongRepository $songRepo,
|
||||||
Entity\Repository\SongHistoryRepository $songHistoryRepo,
|
Entity\Repository\SongHistoryRepository $songHistoryRepo,
|
||||||
Entity\Repository\StationPlaylistMediaRepository $spmRepo,
|
Entity\Repository\StationPlaylistMediaRepository $spmRepo,
|
||||||
|
|
|
@ -7,7 +7,7 @@ use App\EventDispatcher;
|
||||||
use App\Exception;
|
use App\Exception;
|
||||||
use App\Radio\Backend\Liquidsoap\ConfigWriter;
|
use App\Radio\Backend\Liquidsoap\ConfigWriter;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Http\Message\UriInterface;
|
use Psr\Http\Message\UriInterface;
|
||||||
use Supervisor\Supervisor;
|
use Supervisor\Supervisor;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ class Liquidsoap extends AbstractBackend
|
||||||
protected Entity\Repository\StationStreamerRepository $streamerRepo;
|
protected Entity\Repository\StationStreamerRepository $streamerRepo;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Supervisor $supervisor,
|
Supervisor $supervisor,
|
||||||
EventDispatcher $dispatcher,
|
EventDispatcher $dispatcher,
|
||||||
Entity\Repository\StationStreamerRepository $streamerRepo
|
Entity\Repository\StationStreamerRepository $streamerRepo
|
||||||
|
|
|
@ -9,7 +9,7 @@ use App\Message;
|
||||||
use App\Radio\Adapters;
|
use App\Radio\Adapters;
|
||||||
use App\Radio\Backend\Liquidsoap;
|
use App\Radio\Backend\Liquidsoap;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
|
|
||||||
class ConfigWriter implements EventSubscriberInterface
|
class ConfigWriter implements EventSubscriberInterface
|
||||||
|
@ -24,11 +24,11 @@ class ConfigWriter implements EventSubscriberInterface
|
||||||
public const CROSSFADE_DISABLED = 'none';
|
public const CROSSFADE_DISABLED = 'none';
|
||||||
public const CROSSFADE_SMART = 'smart';
|
public const CROSSFADE_SMART = 'smart';
|
||||||
|
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Liquidsoap $liquidsoap;
|
protected Liquidsoap $liquidsoap;
|
||||||
|
|
||||||
public function __construct(EntityManager $em, Liquidsoap $liquidsoap)
|
public function __construct(EntityManagerInterface $em, Liquidsoap $liquidsoap)
|
||||||
{
|
{
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->liquidsoap = $liquidsoap;
|
$this->liquidsoap = $liquidsoap;
|
||||||
|
@ -176,7 +176,6 @@ class ConfigWriter implements EventSubscriberInterface
|
||||||
$defaultPlaylist = new Entity\StationPlaylist($station);
|
$defaultPlaylist = new Entity\StationPlaylist($station);
|
||||||
$defaultPlaylist->setName('default');
|
$defaultPlaylist->setName('default');
|
||||||
|
|
||||||
/** @var EntityManager $em */
|
|
||||||
$this->em->persist($defaultPlaylist);
|
$this->em->persist($defaultPlaylist);
|
||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace App\Radio;
|
||||||
use App\Entity\Station;
|
use App\Entity\Station;
|
||||||
use App\Exception;
|
use App\Exception;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use fXmlRpc\Exception\FaultException;
|
use fXmlRpc\Exception\FaultException;
|
||||||
use Monolog\Logger;
|
use Monolog\Logger;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
|
@ -15,7 +15,7 @@ class Configuration
|
||||||
public const DEFAULT_PORT_MIN = 8000;
|
public const DEFAULT_PORT_MIN = 8000;
|
||||||
public const DEFAULT_PORT_MAX = 8499;
|
public const DEFAULT_PORT_MAX = 8499;
|
||||||
|
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Adapters $adapters;
|
protected Adapters $adapters;
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ class Configuration
|
||||||
protected Logger $logger;
|
protected Logger $logger;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Adapters $adapters,
|
Adapters $adapters,
|
||||||
Supervisor $supervisor,
|
Supervisor $supervisor,
|
||||||
Logger $logger
|
Logger $logger
|
||||||
|
|
|
@ -8,7 +8,7 @@ use App\Logger;
|
||||||
use App\Radio\AbstractAdapter;
|
use App\Radio\AbstractAdapter;
|
||||||
use App\Settings;
|
use App\Settings;
|
||||||
use App\Xml\Reader;
|
use App\Xml\Reader;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\Psr7\Uri;
|
use GuzzleHttp\Psr7\Uri;
|
||||||
use NowPlaying\Adapter\AdapterAbstract;
|
use NowPlaying\Adapter\AdapterAbstract;
|
||||||
|
@ -28,7 +28,7 @@ abstract class AbstractFrontend extends AbstractAdapter
|
||||||
protected Entity\Repository\StationMountRepository $stationMountRepo;
|
protected Entity\Repository\StationMountRepository $stationMountRepo;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\SettingsRepository $settingsRepo,
|
Entity\Repository\SettingsRepository $settingsRepo,
|
||||||
Entity\Repository\StationMountRepository $stationMountRepo,
|
Entity\Repository\StationMountRepository $stationMountRepo,
|
||||||
Supervisor $supervisor,
|
Supervisor $supervisor,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
namespace App\Radio\Remote;
|
namespace App\Radio\Remote;
|
||||||
|
|
||||||
use App\Entity;
|
use App\Entity;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\Psr7\Uri;
|
use GuzzleHttp\Psr7\Uri;
|
||||||
use Monolog\Logger;
|
use Monolog\Logger;
|
||||||
|
@ -10,7 +10,7 @@ use NowPlaying\Adapter\AdapterAbstract;
|
||||||
|
|
||||||
abstract class AbstractRemote
|
abstract class AbstractRemote
|
||||||
{
|
{
|
||||||
protected EntityManager $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Entity\Repository\SettingsRepository $settingsRepo;
|
protected Entity\Repository\SettingsRepository $settingsRepo;
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ abstract class AbstractRemote
|
||||||
protected Logger $logger;
|
protected Logger $logger;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManager $em,
|
EntityManagerInterface $em,
|
||||||
Entity\Repository\SettingsRepository $settingsRepo,
|
Entity\Repository\SettingsRepository $settingsRepo,
|
||||||
Client $http_client,
|
Client $http_client,
|
||||||
Logger $logger
|
Logger $logger
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue