Skip to content

Commit

Permalink
SUPPORT-86535 - added legacy_services
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuri Gaidoba committed Nov 17, 2023
1 parent f0943de commit b31109a
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\HttpKernel\Kernel;

/**
* This is the class that loads and manages your bundle configuration.
Expand All @@ -24,7 +25,8 @@ public function load(array $configs, ContainerBuilder $container)
$config = $this->processConfiguration($configuration, $configs);

$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.xml');
$prefix = Kernel::MAJOR_VERSION <= 4 ? 'legacy_' : '';
$loader->load($prefix . 'services.xml');

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?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 http://symfony.com/schema/dic/services/services-1.0.xsd">

<services>
<service class="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\Controller\DefaultController"
id="paysera_fixture_test.controller.default_controller"
public="true"/>

<service id="paysera_fixture_test.normalizer.item_denormalizer.parameter"
class="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\Normalizer\ItemDenormalizer">
<tag name="paysera_normalization.object_denormalizer" type="extract:parameter"/>
<argument>parameter</argument>
</service>
<service id="paysera_fixture_test.normalizer.item_denormalizer.parameter.custom"
class="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\Normalizer\ItemDenormalizer">
<tag name="paysera_normalization.object_denormalizer" type="extract:parameter" group="custom"/>
<argument>parameter_custom</argument>
</service>
<service id="paysera_fixture_test.normalizer.item_denormalizer.key"
class="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\Normalizer\ItemDenormalizer">
<tag name="paysera_normalization.object_denormalizer" type="extract:key"/>
<argument>key</argument>
</service>
<service id="paysera_fixture_test.normalizer.item_denormalizer.key.custom"
class="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\Normalizer\ItemDenormalizer">
<tag name="paysera_normalization.object_denormalizer" type="extract:key" group="custom"/>
<argument>key_custom</argument>
</service>
<service id="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\Normalizer\PrefixedDenormalizer">
<tag name="paysera_normalization.mixed_type_denormalizer"/>
</service>
<service id="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\Normalizer\MyObjectNormalizer">
<tag name="paysera_normalization.object_denormalizer"/>
<tag name="paysera_normalization.normalizer"/>
</service>
<service id="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\Normalizer\MyObjectCustomNormalizer">
<tag name="paysera_normalization.object_denormalizer" type="my_object_custom"/>
<tag name="paysera_normalization.normalizer" type="my_object_custom"/>
<tag name="paysera_normalization.normalizer"
type="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\Entity\MyObject"
group="custom"/>
</service>
<service id="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\Normalizer\PersistedEntityFilterDenormalizer">
<tag name="paysera_normalization.object_denormalizer"/>
</service>
<service id="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\Normalizer\PersistedEntityNormalizer">
<tag name="paysera_normalization.normalizer"/>
</service>

<service id="paysera_fixture_test.rest_request_options.1"
class="Paysera\Bundle\ApiBundle\Entity\RestRequestOptions">
<tag name="paysera_api.request_options" controller="PayseraFixtureTestBundle:Default:action1"/>
<tag name="paysera_api.request_options"
controller="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\Controller\DefaultController::action1b"/>
<tag name="paysera_api.request_options"
controller="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\Controller\DefaultController::action2"/>
<tag name="paysera_api.request_options" controller="paysera_fixture_test.controller.default_controller::action3"/>
<tag name="paysera_api.request_options"
controller="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\Controller\DefaultController::action4"/>
<tag name="paysera_api.request_options" controller="paysera_fixture_test.controller.default_controller::action5"/>

<call method="addQueryResolverOptions">
<argument type="service">
<service class="Paysera\Bundle\ApiBundle\Entity\QueryResolverOptions">
<call method="setDenormalizationType">
<argument>extract:parameter</argument>
</call>
<call method="setParameterName">
<argument>parameter</argument>
</call>
</service>
</argument>
</call>
</service>

<service id="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\Controller\AnnotatedController"
public="true"/>
<service id="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\Controller\AnnotatedClassRequiredPermissionsController"
public="true"/>
<service id="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\Controller\AnnotatedClassValidationController"
public="true"/>
<service id="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\Controller\PagedQueryController"
public="true">
<argument type="service" id="doctrine.orm.entity_manager"/>
</service>

<service id="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\PathAttributeResolver\PrefixedPathAttributeResolver">
<tag name="paysera_api.path_attribute_resolver" type="prefixed"/>
</service>
<service id="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\PathAttributeResolver\MyObjectResolver">
<tag name="paysera_api.path_attribute_resolver" type="my_object_resolver"/>
<tag name="paysera_api.path_attribute_resolver"
type="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\Entity\MyObject"/>
</service>
<service id="Paysera\Bundle\ApiBundle\Tests\Functional\Fixtures\FixtureTestBundle\PathAttributeResolver\NullResolver">
<tag name="paysera_api.path_attribute_resolver" type="always_null"/>
</service>
</services>
</container>

0 comments on commit b31109a

Please sign in to comment.