Skip to content
This repository
Browse code

fix imagine handling. now only the form template issue remains

  • Loading branch information...
commit 72cc8a3512c9357f9a39c77019ba3b13bfa07635 1 parent a94e1e9
David Buchmann dbu authored
8 DependencyInjection/DoctrinePHPCRExtension.php
@@ -258,9 +258,11 @@ private function odmLoad(array $config, ContainerBuilder $container)
258 258 $filters = isset($config['image']['extra_filters']) && is_array($config['image']['extra_filters'])
259 259 ? array_merge(array($filter), $config['image']['extra_filters'])
260 260 : array();
261   - $container->setParameter('doctrine_phpcr.odm.subscriber.image_cache.filter', $filter);
262   - $container->setParameter('doctrine_phpcr.odm.subscriber.image_cache.all_filters', $filters);
263   - $this->loader->load('odm_image.xml');
  261 + $container->setParameter('doctrine_phpcr.odm.subscriber.imagine_cache.filter', $filter);
  262 + $container->setParameter('doctrine_phpcr.odm.subscriber.imagine_cache.all_filters', $filters);
  263 + if ($filter) {
  264 + $this->loader->load('odm_imagine.xml');
  265 + }
264 266 $bundles = $container->getParameter('kernel.bundles');
265 267 if (!isset($bundles['LiipImagineBundle'])) {
266 268 $container->removeDefinition('doctrine_phpcr.odm.subscriber.image_cache');
7 Resources/config/odm.xml
@@ -22,6 +22,8 @@
22 22 <!-- form field factory guesser -->
23 23 <parameter key="form.type_guesser.doctrine_phpcr.class">Doctrine\Bundle\PHPCRBundle\Form\PHPCRTypeGuesser</parameter>
24 24
  25 + <parameter key="doctrine_phpcr.odm.form.image_class">Doctrine\Bundle\PHPCRBundle\Form\Type\ImageType</parameter>
  26 +
25 27 <parameter key="doctrine_phpcr.odm.metadata.driver_chain.class">Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain</parameter>
26 28 <parameter key="doctrine_phpcr.odm.metadata.annotation.class">Doctrine\ODM\PHPCR\Mapping\Driver\AnnotationDriver</parameter>
27 29 <parameter key="doctrine_phpcr.odm.metadata.xml.class">Doctrine\Bundle\PHPCRBundle\Mapping\Driver\XmlDriver</parameter>
@@ -70,6 +72,11 @@
70 72 <argument type="service" id="doctrine_phpcr"/>
71 73 </service>
72 74
  75 + <service id="doctrine_phpcr.odm.form.type.image" class="%doctrine_phpcr.odm.form.image_class%">
  76 + <argument>%doctrine_phpcr.odm.subscriber.imagine_cache.filter%</argument>
  77 + <tag name="form.type" alias="phpcr_odm_image"/>
  78 + </service>
  79 +
73 80 <service id="form.type_guesser.doctrine_phpcr" class="%form.type_guesser.doctrine_phpcr.class%">
74 81 <tag name="form.type_guesser"/>
75 82 <argument type="service" id="doctrine_phpcr"/>
28 Resources/config/odm_image.xml
... ... @@ -1,28 +0,0 @@
1   -<?xml version="1.0" ?>
2   -
3   -<container xmlns="http://symfony.com/schema/dic/services"
4   - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5   - xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
6   -
7   - <parameters>
8   - <parameter key="doctrine_phpcr.odm.form.image_class">Doctrine\Bundle\PHPCRBundle\Form\Type\ImageType</parameter>
9   - <parameter key="doctrine_phpcr.odm.subscriber.image_cache_class">Doctrine\Bundle\PHPCRBundle\EventListener\ImagineCacheInvalidatorSubscriber</parameter>
10   - </parameters>
11   -
12   - <services>
13   -
14   - <service id="doctrine_phpcr.odm.form.type.image" class="%doctrine_phpcr.odm.form.image_class%">
15   - <argument>%doctrine_phpcr.odm.subscriber.image_cache.filter%</argument>
16   - <tag name="form.type" alias="phpcr_odm_image"/>
17   - </service>
18   -
19   - <service id="doctrine_phpcr.odm.subscriber.image_cache" class="%doctrine_phpcr.odm.subscriber.image_cache_class%">
20   - <tag name="doctrine_phpcr.event_subscriber"/>
21   - <argument type="service" id="liip_imagine.cache.manager"/>
22   - <argument type="service" id="service_container"/>
23   - <argument>%doctrine_phpcr.odm.subscriber.image_cache.all_filters%</argument>
24   - </service>
25   -
26   - </services>
27   -
28   -</container>
22 Resources/config/odm_imagine.xml
... ... @@ -0,0 +1,22 @@
  1 +<?xml version="1.0" ?>
  2 +
  3 +<container xmlns="http://symfony.com/schema/dic/services"
  4 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  5 + xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
  6 +
  7 + <parameters>
  8 + <parameter key="doctrine_phpcr.odm.subscriber.imagine_cache_class">Doctrine\Bundle\PHPCRBundle\EventListener\ImagineCacheInvalidatorSubscriber</parameter>
  9 + </parameters>
  10 +
  11 + <services>
  12 +
  13 + <service id="doctrine_phpcr.odm.subscriber.imagine_cache" class="%doctrine_phpcr.odm.subscriber.imagine_cache_class%">
  14 + <tag name="doctrine_phpcr.event_subscriber"/>
  15 + <argument type="service" id="liip_imagine.cache.manager"/>
  16 + <argument type="service" id="service_container"/>
  17 + <argument>%doctrine_phpcr.odm.subscriber.imagine_cache.all_filters%</argument>
  18 + </service>
  19 +
  20 + </services>
  21 +
  22 +</container>

0 comments on commit 72cc8a3

Please sign in to comment.
Something went wrong with that request. Please try again.