1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Dtc\QueueBundle\DependencyInjection\Compiler; |
4
|
|
|
|
5
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
6
|
|
|
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; |
7
|
|
|
|
8
|
|
|
class GridCompilerPass implements CompilerPassInterface |
9
|
|
|
{ |
10
|
|
|
use WorkerCompilerTrait; |
11
|
|
|
public function process(ContainerBuilder $container) |
12
|
|
|
{ |
13
|
|
|
if (!class_exists('Dtc\GridBundle\DtcGridBundle')) { |
14
|
|
|
return; |
15
|
|
|
} |
16
|
|
|
|
17
|
|
|
$defaultManagerType = $container->getParameter('dtc_queue.manager.job'); |
18
|
|
|
$runManagerType = $container->getParameter($this->getRunManagerType($container)); |
19
|
|
|
if ($defaultManagerType === 'orm' || $runManagerType === 'orm' || $defaultManagerType === 'odm' || $runManagerType === 'odm') { |
20
|
|
|
$filename =__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Resources' . DIRECTORY_SEPARATOR . 'dtc_grid.yaml'; |
21
|
|
|
$cacheDir = $container->getParameter('kernel.cache_dir'); |
22
|
|
|
if (class_exists('Dtc\GridBundle\Grid\Source\ColumnSource')) { |
23
|
|
|
\Dtc\GridBundle\Grid\Source\ColumnSource::cacheClassesFromFile($cacheDir, $filename); |
|
|
|
|
24
|
|
|
} |
25
|
|
|
} |
26
|
|
|
|
27
|
|
|
$this->addLiveJobs($container); |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @param ContainerBuilder $container |
33
|
|
|
* @throws |
34
|
|
|
*/ |
35
|
|
|
protected function addLiveJobs(ContainerBuilder $container) |
36
|
|
|
{ |
37
|
|
|
$jobReflection = new \ReflectionClass($container->getParameter('dtc_queue.class.job')); |
38
|
|
|
|
39
|
|
|
// Custom grid sources for waiting and running jobs. |
40
|
|
|
if ($jobReflection->isSubclassOf(\Dtc\QueueBundle\Document\BaseJob::class)) { |
41
|
|
|
\Dtc\GridBundle\DependencyInjection\Compiler\GridSourceCompilerPass::addGridSource($container, 'dtc_queue.grid_source.jobs_waiting.odm'); |
42
|
|
|
\Dtc\GridBundle\DependencyInjection\Compiler\GridSourceCompilerPass::addGridSource($container, 'dtc_queue.grid_source.jobs_running.odm'); |
43
|
|
|
} |
44
|
|
|
if ($jobReflection->isSubclassOf(\Dtc\QueueBundle\Entity\BaseJob::class)) { |
45
|
|
|
\Dtc\GridBundle\DependencyInjection\Compiler\GridSourceCompilerPass::addGridSource($container, 'dtc_queue.grid_source.jobs_waiting.orm'); |
46
|
|
|
\Dtc\GridBundle\DependencyInjection\Compiler\GridSourceCompilerPass::addGridSource($container, 'dtc_queue.grid_source.jobs_running.orm'); |
47
|
|
|
} |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
|
51
|
|
|
} |
52
|
|
|
|
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