Compare commits

..

No commits in common. "5c4aa11b4b5a963fb01ff1cb315ff4bdda313819" and "392740d79c1c44ba36a66c273642f40e5f231a6b" have entirely different histories.

6 changed files with 36 additions and 121 deletions

58
composer.lock generated
View file

@ -1740,21 +1740,21 @@
},
{
"name": "doctrine/dbal",
"version": "4.3.0",
"version": "4.2.4",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
"reference": "5fe09532be619202d59c70956c6fb20e97933ee3"
"reference": "b37d160498ea91a2382a2ebe825c4ea6254fc0ec"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/5fe09532be619202d59c70956c6fb20e97933ee3",
"reference": "5fe09532be619202d59c70956c6fb20e97933ee3",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/b37d160498ea91a2382a2ebe825c4ea6254fc0ec",
"reference": "b37d160498ea91a2382a2ebe825c4ea6254fc0ec",
"shasum": ""
},
"require": {
"doctrine/deprecations": "^1.1.5",
"php": "^8.2",
"doctrine/deprecations": "^0.5.3|^1",
"php": "^8.1",
"psr/cache": "^1|^2|^3",
"psr/log": "^1|^2|^3"
},
@ -1765,7 +1765,7 @@
"phpstan/phpstan": "2.1.17",
"phpstan/phpstan-phpunit": "2.0.6",
"phpstan/phpstan-strict-rules": "^2",
"phpunit/phpunit": "11.5.23",
"phpunit/phpunit": "10.5.46",
"slevomat/coding-standard": "8.16.2",
"squizlabs/php_codesniffer": "3.13.1",
"symfony/cache": "^6.3.8|^7.0",
@ -1826,7 +1826,7 @@
],
"support": {
"issues": "https://github.com/doctrine/dbal/issues",
"source": "https://github.com/doctrine/dbal/tree/4.3.0"
"source": "https://github.com/doctrine/dbal/tree/4.2.4"
},
"funding": [
{
@ -1842,7 +1842,7 @@
"type": "tidelift"
}
],
"time": "2025-06-16T19:31:04+00:00"
"time": "2025-06-15T23:15:01+00:00"
},
{
"name": "doctrine/deprecations",
@ -7589,16 +7589,16 @@
},
{
"name": "sabberworm/php-css-parser",
"version": "v8.9.0",
"version": "v8.8.0",
"source": {
"type": "git",
"url": "https://github.com/MyIntervals/PHP-CSS-Parser.git",
"reference": "d8e916507b88e389e26d4ab03c904a082aa66bb9"
"reference": "3de493bdddfd1f051249af725c7e0d2c38fed740"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MyIntervals/PHP-CSS-Parser/zipball/d8e916507b88e389e26d4ab03c904a082aa66bb9",
"reference": "d8e916507b88e389e26d4ab03c904a082aa66bb9",
"url": "https://api.github.com/repos/MyIntervals/PHP-CSS-Parser/zipball/3de493bdddfd1f051249af725c7e0d2c38fed740",
"reference": "3de493bdddfd1f051249af725c7e0d2c38fed740",
"shasum": ""
},
"require": {
@ -7606,8 +7606,7 @@
"php": "^5.6.20 || ^7.0.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0"
},
"require-dev": {
"phpunit/phpunit": "5.7.27 || 6.5.14 || 7.5.20 || 8.5.41",
"rawr/cross-data-providers": "^2.0.0"
"phpunit/phpunit": "5.7.27 || 6.5.14 || 7.5.20 || 8.5.41"
},
"suggest": {
"ext-mbstring": "for parsing UTF-8 CSS"
@ -7649,9 +7648,9 @@
],
"support": {
"issues": "https://github.com/MyIntervals/PHP-CSS-Parser/issues",
"source": "https://github.com/MyIntervals/PHP-CSS-Parser/tree/v8.9.0"
"source": "https://github.com/MyIntervals/PHP-CSS-Parser/tree/v8.8.0"
},
"time": "2025-07-11T13:20:48+00:00"
"time": "2025-03-23T17:59:05+00:00"
},
{
"name": "scheb/2fa-backup-code",
@ -16792,16 +16791,16 @@
},
{
"name": "rector/rector",
"version": "2.1.1",
"version": "2.1.0",
"source": {
"type": "git",
"url": "https://github.com/rectorphp/rector.git",
"reference": "d0917c069bb0d9bb06ed111cf052510f609015a4"
"reference": "d513dea45a94394b660e15c155d1fa27826f8e30"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/d0917c069bb0d9bb06ed111cf052510f609015a4",
"reference": "d0917c069bb0d9bb06ed111cf052510f609015a4",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/d513dea45a94394b660e15c155d1fa27826f8e30",
"reference": "d513dea45a94394b660e15c155d1fa27826f8e30",
"shasum": ""
},
"require": {
@ -16840,7 +16839,7 @@
],
"support": {
"issues": "https://github.com/rectorphp/rector/issues",
"source": "https://github.com/rectorphp/rector/tree/2.1.1"
"source": "https://github.com/rectorphp/rector/tree/2.1.0"
},
"funding": [
{
@ -16848,7 +16847,7 @@
"type": "github"
}
],
"time": "2025-07-10T11:31:31+00:00"
"time": "2025-06-24T20:26:57+00:00"
},
{
"name": "roave/security-advisories",
@ -16856,12 +16855,12 @@
"source": {
"type": "git",
"url": "https://github.com/Roave/SecurityAdvisories.git",
"reference": "56a0a5fbffe6faa8e85eb4d027a3eaf704adc288"
"reference": "a76f62e135c8b583602bd99df737b5c20f4d7200"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/56a0a5fbffe6faa8e85eb4d027a3eaf704adc288",
"reference": "56a0a5fbffe6faa8e85eb4d027a3eaf704adc288",
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/a76f62e135c8b583602bd99df737b5c20f4d7200",
"reference": "a76f62e135c8b583602bd99df737b5c20f4d7200",
"shasum": ""
},
"conflict": {
@ -17199,7 +17198,7 @@
"jackalope/jackalope-doctrine-dbal": "<1.7.4",
"jambagecom/div2007": "<0.10.2",
"james-heinrich/getid3": "<1.9.21",
"james-heinrich/phpthumb": "<=1.7.23",
"james-heinrich/phpthumb": "<1.7.12",
"jasig/phpcas": "<1.3.3",
"jbartels/wec-map": "<3.0.3",
"jcbrand/converse.js": "<3.3.3",
@ -17301,7 +17300,7 @@
"microsoft/microsoft-graph": ">=1.16,<1.109.1|>=2,<2.0.1",
"microsoft/microsoft-graph-beta": "<2.0.1",
"microsoft/microsoft-graph-core": "<2.0.2",
"microweber/microweber": "<=2.0.19",
"microweber/microweber": "<=2.0.16",
"mikehaertl/php-shellcommand": "<1.6.1",
"miniorange/miniorange-saml": "<1.4.3",
"mittwald/typo3_forum": "<1.2.1",
@ -17662,7 +17661,6 @@
"ua-parser/uap-php": "<3.8",
"uasoft-indonesia/badaso": "<=2.9.7",
"unisharp/laravel-filemanager": "<2.9.1",
"universal-omega/dynamic-page-list3": "<3.6.4",
"unopim/unopim": "<0.1.5",
"userfrosting/userfrosting": ">=0.3.1,<4.6.3",
"usmanhalalit/pixie": "<1.0.3|>=2,<2.0.2",
@ -17804,7 +17802,7 @@
"type": "tidelift"
}
],
"time": "2025-07-11T23:05:27+00:00"
"time": "2025-07-04T13:13:44+00:00"
},
{
"name": "sebastian/cli-parser",

View file

@ -4,15 +4,18 @@ declare(strict_types=1);
namespace DoctrineMigrations;
use App\Doctrine\Migration\ContainerAwareMigrationInterface;
use App\Migration\AbstractMultiPlatformMigration;
use App\Migration\WithPermPresetsTrait;
use App\Services\UserSystem\PermissionPresetsHelper;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Schema\Schema;
use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
final class Version20221114193325 extends AbstractMultiPlatformMigration implements ContainerAwareMigrationInterface
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20221114193325 extends AbstractMultiPlatformMigration implements ContainerAwareInterface
{
use WithPermPresetsTrait;

View file

@ -4,16 +4,16 @@ declare(strict_types=1);
namespace DoctrineMigrations;
use App\Doctrine\Migration\ContainerAwareMigrationInterface;
use App\Migration\AbstractMultiPlatformMigration;
use App\Migration\WithPermPresetsTrait;
use App\Services\UserSystem\PermissionPresetsHelper;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240606203053 extends AbstractMultiPlatformMigration implements ContainerAwareMigrationInterface
final class Version20240606203053 extends AbstractMultiPlatformMigration implements ContainerAwareInterface
{
use WithPermPresetsTrait;

View file

@ -1,55 +0,0 @@
<?php
/*
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2025 Jan Böhmer (https://github.com/jbtronics)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace App\Doctrine\Migration;
use App\Services\UserSystem\PermissionPresetsHelper;
use Doctrine\Migrations\AbstractMigration;
use Doctrine\Migrations\Version\MigrationFactory;
use Symfony\Component\DependencyInjection\Attribute\AsDecorator;
use Symfony\Component\DependencyInjection\Attribute\AutowireLocator;
use Psr\Container\ContainerInterface;
#[AsDecorator("doctrine.migrations.migrations_factory")]
class ContainerAwareMigrationFactory implements MigrationFactory
{
public function __construct(private readonly MigrationFactory $decorated,
//List all services that should be available in migrations here
#[AutowireLocator([
PermissionPresetsHelper::class
])]
private readonly ContainerInterface $container)
{
}
public function createVersion(string $migrationClassName): AbstractMigration
{
$migration = $this->decorated->createVersion($migrationClassName);
if ($migration instanceof ContainerAwareMigrationInterface) {
$migration->setContainer($this->container);
}
return $migration;
}
}

View file

@ -1,31 +0,0 @@
<?php
/*
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2025 Jan Böhmer (https://github.com/jbtronics)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace App\Doctrine\Migration;
use Psr\Container\ContainerInterface;
interface ContainerAwareMigrationInterface
{
public function setContainer(?ContainerInterface $container = null): void;
}

View file

@ -26,7 +26,7 @@ namespace App\Migration;
use App\Entity\UserSystem\PermissionData;
use App\Security\Interfaces\HasPermissionsInterface;
use App\Services\UserSystem\PermissionPresetsHelper;
use Psr\Container\ContainerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
trait WithPermPresetsTrait
{