|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
/* |
|
6
|
|
|
* This file is part of the Zikula package. |
|
7
|
|
|
* |
|
8
|
|
|
* Copyright Zikula - https://ziku.la/ |
|
9
|
|
|
* |
|
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
11
|
|
|
* file that was distributed with this source code. |
|
12
|
|
|
*/ |
|
13
|
|
|
|
|
14
|
|
|
namespace Zikula\UsersBundle\DependencyInjection; |
|
15
|
|
|
|
|
16
|
|
|
use Symfony\Component\Config\FileLocator; |
|
17
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
|
|
|
|
|
|
18
|
|
|
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; |
|
19
|
|
|
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; |
|
20
|
|
|
use Symfony\Component\HttpKernel\DependencyInjection\Extension; |
|
21
|
|
|
use Zikula\UsersBundle\Helper\MailHelper; |
|
22
|
|
|
use Zikula\UsersBundle\Menu\ExtensionMenu; |
|
23
|
|
|
|
|
24
|
|
|
class ZikulaUsersExtension extends Extension implements PrependExtensionInterface |
|
25
|
|
|
{ |
|
26
|
|
|
private ?bool $isNucleosSelfDeletionEnabled = null; |
|
27
|
|
|
|
|
28
|
|
|
public function prepend(ContainerBuilder $containerBuilder) |
|
29
|
|
|
{ |
|
30
|
|
|
// get all bundles |
|
31
|
|
|
$bundles = $containerBuilder->getParameter('kernel.bundles'); |
|
32
|
|
|
if (isset($bundles['NucleosUserBundle'])) { |
|
33
|
|
|
$config = $containerBuilder->getExtensionConfig('nucleos_user')[0]; |
|
34
|
|
|
$this->isNucleosSelfDeletionEnabled = $config['deletion']['enabled'] ?? null; |
|
35
|
|
|
} |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
public function load(array $configs, ContainerBuilder $container) |
|
39
|
|
|
{ |
|
40
|
|
|
$loader = new YamlFileLoader($container, new FileLocator(dirname(__DIR__) . '/Resources/config')); |
|
41
|
|
|
$loader->load('services.yaml'); |
|
42
|
|
|
|
|
43
|
|
|
$configuration = new Configuration(); |
|
44
|
|
|
$config = $this->processConfiguration($configuration, $configs); |
|
45
|
|
|
|
|
46
|
|
|
$container->getDefinition(MailHelper::class) |
|
47
|
|
|
->setArgument('$registrationNotificationEmail', $config['registration']['admin_notification_mail']); |
|
48
|
|
|
|
|
49
|
|
|
$container->getDefinition(ExtensionMenu::class) |
|
50
|
|
|
->setArgument('$registrationEnabled', $this->isNucleosSelfDeletionEnabled ?? $config['registration']['enabled']) |
|
51
|
|
|
->setArgument('$allowSelfDeletion', $config['allow_self_deletion']); |
|
52
|
|
|
} |
|
53
|
|
|
} |
|
54
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths