1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the FOSCKEditor Bundle. |
5
|
|
|
* |
6
|
|
|
* (c) 2018 - present Friends of Symfony |
7
|
|
|
* (c) 2009 - 2017 Eric GELOEN <[email protected]> |
8
|
|
|
* |
9
|
|
|
* For the full copyright and license information, please read the LICENSE |
10
|
|
|
* file that was distributed with this source code. |
11
|
|
|
*/ |
12
|
|
|
|
13
|
|
|
namespace FOS\CKEditorBundle\DependencyInjection; |
14
|
|
|
|
15
|
|
|
use FOS\CKEditorBundle\Exception\DependencyInjectionException; |
|
|
|
|
16
|
|
|
use Symfony\Component\Config\FileLocator; |
17
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
18
|
|
|
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; |
19
|
|
|
use Symfony\Component\Form\AbstractType; |
20
|
|
|
use Symfony\Component\HttpKernel\DependencyInjection\ConfigurableExtension; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @author GeLo <[email protected]> |
24
|
|
|
*/ |
25
|
|
|
class FOSCKEditorExtension extends ConfigurableExtension |
26
|
|
|
{ |
27
|
|
|
protected function loadInternal(array $config, ContainerBuilder $container) |
28
|
|
|
{ |
29
|
|
|
$this->loadResources($container); |
30
|
|
|
|
31
|
|
|
$container->getDefinition('fos_ck_editor.configuration') |
32
|
|
|
->setArgument(0, $config); |
33
|
|
|
|
34
|
|
|
if (!method_exists(AbstractType::class, 'getBlockPrefix')) { |
35
|
|
|
$container->getDefinition('fos_ck_editor.form.type') |
36
|
|
|
->clearTag('form.type') |
37
|
|
|
->addTag('form.type', ['alias' => 'ckeditor']); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
$bundles = $container->getParameter('kernel.bundles'); |
41
|
|
|
|
42
|
|
|
if (isset($bundles['IvoryCKEditorBundle'])) { |
43
|
|
|
@trigger_error( |
44
|
|
|
"IvoryCKEditorBundle isn't maintained anymore and should be replaced with FOSCKEditorBundle.", |
45
|
|
|
E_USER_DEPRECATED |
46
|
|
|
); |
47
|
|
|
} |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
private function loadResources(ContainerBuilder $container) |
51
|
|
|
{ |
52
|
|
|
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
53
|
|
|
|
54
|
|
|
$resources = [ |
55
|
|
|
'builder', |
56
|
|
|
'command', |
57
|
|
|
'config', |
58
|
|
|
'form', |
59
|
|
|
'installer', |
60
|
|
|
'renderer', |
61
|
|
|
'twig', |
62
|
|
|
]; |
63
|
|
|
|
64
|
|
|
foreach ($resources as $resource) { |
65
|
|
|
$loader->load($resource.'.xml'); |
66
|
|
|
} |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
public function getAlias() |
70
|
|
|
{ |
71
|
|
|
return 'fos_ck_editor'; |
72
|
|
|
} |
73
|
|
|
} |
74
|
|
|
|
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