[FrameworkBundle] changed configuration file for workflow from XML to PHP
This commit is contained in:
parent
b3a313cd35
commit
2f1b72d7d0
@ -372,7 +372,7 @@ class FrameworkExtension extends Extension
|
||||
$this->registerFragmentsConfiguration($config['fragments'], $container, $phpLoader);
|
||||
$this->registerTranslatorConfiguration($config['translator'], $container, $phpLoader, $config['default_locale']);
|
||||
$this->registerProfilerConfiguration($config['profiler'], $container, $loader, $phpLoader);
|
||||
$this->registerWorkflowConfiguration($config['workflows'], $container, $loader);
|
||||
$this->registerWorkflowConfiguration($config['workflows'], $container, $phpLoader);
|
||||
$this->registerDebugConfiguration($config['php_errors'], $container, $phpLoader);
|
||||
$this->registerRouterConfiguration($config['router'], $container, $phpLoader, $config['translator']['enabled_locales'] ?? []);
|
||||
$this->registerAnnotationsConfiguration($config['annotations'], $container, $phpLoader);
|
||||
@ -639,7 +639,7 @@ class FrameworkExtension extends Extension
|
||||
->addTag('kernel.reset', ['method' => 'reset']);
|
||||
}
|
||||
|
||||
private function registerWorkflowConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
|
||||
private function registerWorkflowConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader)
|
||||
{
|
||||
if (!$config['enabled']) {
|
||||
$container->removeDefinition('console.command.workflow_dump');
|
||||
@ -651,7 +651,7 @@ class FrameworkExtension extends Extension
|
||||
throw new LogicException('Workflow support cannot be enabled as the Workflow component is not installed. Try running "composer require symfony/workflow".');
|
||||
}
|
||||
|
||||
$loader->load('workflow.xml');
|
||||
$loader->load('workflow.php');
|
||||
|
||||
$registryDefinition = $container->getDefinition('workflow.registry');
|
||||
|
||||
|
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
|
||||
|
||||
use Symfony\Component\Workflow\EventListener\ExpressionLanguage;
|
||||
use Symfony\Component\Workflow\MarkingStore\MethodMarkingStore;
|
||||
use Symfony\Component\Workflow\Registry;
|
||||
use Symfony\Component\Workflow\StateMachine;
|
||||
use Symfony\Component\Workflow\Workflow;
|
||||
|
||||
return static function (ContainerConfigurator $container) {
|
||||
$container->services()
|
||||
->set('workflow.abstract', Workflow::class)
|
||||
->args([
|
||||
abstract_arg('workflow definition'),
|
||||
abstract_arg('marking store'),
|
||||
service('event_dispatcher')->ignoreOnInvalid(),
|
||||
abstract_arg('workflow name'),
|
||||
])
|
||||
->abstract()
|
||||
->public()
|
||||
->set('state_machine.abstract', StateMachine::class)
|
||||
->args([
|
||||
abstract_arg('workflow definition'),
|
||||
abstract_arg('marking store'),
|
||||
service('event_dispatcher')->ignoreOnInvalid(),
|
||||
abstract_arg('workflow name'),
|
||||
])
|
||||
->abstract()
|
||||
->public()
|
||||
->set('workflow.marking_store.method', MethodMarkingStore::class)
|
||||
->abstract()
|
||||
->set('workflow.registry', Registry::class)
|
||||
->alias(Registry::class, 'workflow.registry')
|
||||
->set('workflow.security.expression_language', ExpressionLanguage::class)
|
||||
;
|
||||
};
|
@ -1,30 +0,0 @@
|
||||
<?xml version="1.0" ?>
|
||||
|
||||
<container xmlns="http://symfony.com/schema/dic/services"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd">
|
||||
|
||||
<services>
|
||||
<defaults public="false" />
|
||||
|
||||
<service id="workflow.abstract" class="Symfony\Component\Workflow\Workflow" abstract="true" public="true">
|
||||
<argument /> <!-- workflow definition -->
|
||||
<argument type="constant">null</argument> <!-- marking store -->
|
||||
<argument type="service" id="event_dispatcher" on-invalid="ignore" />
|
||||
<argument /> <!-- name -->
|
||||
</service>
|
||||
<service id="state_machine.abstract" class="Symfony\Component\Workflow\StateMachine" abstract="true" public="true">
|
||||
<argument /> <!-- workflow definition -->
|
||||
<argument type="constant">null</argument> <!-- marking store -->
|
||||
<argument type="service" id="event_dispatcher" on-invalid="ignore" />
|
||||
<argument /> <!-- name -->
|
||||
</service>
|
||||
|
||||
<service id="workflow.marking_store.method" class="Symfony\Component\Workflow\MarkingStore\MethodMarkingStore" abstract="true" />
|
||||
|
||||
<service id="workflow.registry" class="Symfony\Component\Workflow\Registry" />
|
||||
<service id="Symfony\Component\Workflow\Registry" alias="workflow.registry" />
|
||||
|
||||
<service id="workflow.security.expression_language" class="Symfony\Component\Workflow\EventListener\ExpressionLanguage" />
|
||||
</services>
|
||||
</container>
|
Reference in New Issue
Block a user