| @@ 125-141 (lines=17) @@ | ||
| 122 | /** |
|
| 123 | * @param string $pluginDir |
|
| 124 | */ |
|
| 125 | protected function configureTwigPaths(ContainerBuilder $container, $enabled, $pluginDir) |
|
| 126 | { |
|
| 127 | $paths = []; |
|
| 128 | ||
| 129 | foreach ($enabled as $code) { |
|
| 130 | $dir = $pluginDir.'/'.$code.'/Resource/template'; |
|
| 131 | if (file_exists($dir)) { |
|
| 132 | $paths[$dir] = $code; |
|
| 133 | } |
|
| 134 | } |
|
| 135 | ||
| 136 | if (!empty($paths)) { |
|
| 137 | $container->prependExtensionConfig('twig', [ |
|
| 138 | 'paths' => $paths, |
|
| 139 | ]); |
|
| 140 | } |
|
| 141 | } |
|
| 142 | ||
| 143 | /** |
|
| 144 | * @param string $pluginDir |
|
| @@ 146-164 (lines=19) @@ | ||
| 143 | /** |
|
| 144 | * @param string $pluginDir |
|
| 145 | */ |
|
| 146 | protected function configureTranslations(ContainerBuilder $container, $enabled, $pluginDir) |
|
| 147 | { |
|
| 148 | $paths = []; |
|
| 149 | ||
| 150 | foreach ($enabled as $code) { |
|
| 151 | $dir = $pluginDir.'/'.$code.'/Resource/locale'; |
|
| 152 | if (file_exists($dir)) { |
|
| 153 | $paths[] = $dir; |
|
| 154 | } |
|
| 155 | } |
|
| 156 | ||
| 157 | if (!empty($paths)) { |
|
| 158 | $container->prependExtensionConfig('framework', [ |
|
| 159 | 'translator' => [ |
|
| 160 | 'paths' => $paths, |
|
| 161 | ], |
|
| 162 | ]); |
|
| 163 | } |
|
| 164 | } |
|
| 165 | ||
| 166 | protected function isConnected(Connection $conn) |
|
| 167 | { |
|