Skip to content
Browse files

fix imagine handling. now only the form template issue remains

  • Loading branch information...
1 parent a94e1e9 commit 72cc8a3512c9357f9a39c77019ba3b13bfa07635 @dbu dbu committed Mar 20, 2013
View
8 DependencyInjection/DoctrinePHPCRExtension.php
@@ -258,9 +258,11 @@ private function odmLoad(array $config, ContainerBuilder $container)
$filters = isset($config['image']['extra_filters']) && is_array($config['image']['extra_filters'])
? array_merge(array($filter), $config['image']['extra_filters'])
: array();
- $container->setParameter('doctrine_phpcr.odm.subscriber.image_cache.filter', $filter);
- $container->setParameter('doctrine_phpcr.odm.subscriber.image_cache.all_filters', $filters);
- $this->loader->load('odm_image.xml');
+ $container->setParameter('doctrine_phpcr.odm.subscriber.imagine_cache.filter', $filter);
+ $container->setParameter('doctrine_phpcr.odm.subscriber.imagine_cache.all_filters', $filters);
+ if ($filter) {
+ $this->loader->load('odm_imagine.xml');
+ }
$bundles = $container->getParameter('kernel.bundles');
if (!isset($bundles['LiipImagineBundle'])) {
$container->removeDefinition('doctrine_phpcr.odm.subscriber.image_cache');
View
7 Resources/config/odm.xml
@@ -22,6 +22,8 @@
<!-- form field factory guesser -->
<parameter key="form.type_guesser.doctrine_phpcr.class">Doctrine\Bundle\PHPCRBundle\Form\PHPCRTypeGuesser</parameter>
+ <parameter key="doctrine_phpcr.odm.form.image_class">Doctrine\Bundle\PHPCRBundle\Form\Type\ImageType</parameter>
+
<parameter key="doctrine_phpcr.odm.metadata.driver_chain.class">Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain</parameter>
<parameter key="doctrine_phpcr.odm.metadata.annotation.class">Doctrine\ODM\PHPCR\Mapping\Driver\AnnotationDriver</parameter>
<parameter key="doctrine_phpcr.odm.metadata.xml.class">Doctrine\Bundle\PHPCRBundle\Mapping\Driver\XmlDriver</parameter>
@@ -70,6 +72,11 @@
<argument type="service" id="doctrine_phpcr"/>
</service>
+ <service id="doctrine_phpcr.odm.form.type.image" class="%doctrine_phpcr.odm.form.image_class%">
+ <argument>%doctrine_phpcr.odm.subscriber.imagine_cache.filter%</argument>
+ <tag name="form.type" alias="phpcr_odm_image"/>
+ </service>
+
<service id="form.type_guesser.doctrine_phpcr" class="%form.type_guesser.doctrine_phpcr.class%">
<tag name="form.type_guesser"/>
<argument type="service" id="doctrine_phpcr"/>
View
28 Resources/config/odm_image.xml
@@ -1,28 +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 http://symfony.com/schema/dic/services/services-1.0.xsd">
-
- <parameters>
- <parameter key="doctrine_phpcr.odm.form.image_class">Doctrine\Bundle\PHPCRBundle\Form\Type\ImageType</parameter>
- <parameter key="doctrine_phpcr.odm.subscriber.image_cache_class">Doctrine\Bundle\PHPCRBundle\EventListener\ImagineCacheInvalidatorSubscriber</parameter>
- </parameters>
-
- <services>
-
- <service id="doctrine_phpcr.odm.form.type.image" class="%doctrine_phpcr.odm.form.image_class%">
- <argument>%doctrine_phpcr.odm.subscriber.image_cache.filter%</argument>
- <tag name="form.type" alias="phpcr_odm_image"/>
- </service>
-
- <service id="doctrine_phpcr.odm.subscriber.image_cache" class="%doctrine_phpcr.odm.subscriber.image_cache_class%">
- <tag name="doctrine_phpcr.event_subscriber"/>
- <argument type="service" id="liip_imagine.cache.manager"/>
- <argument type="service" id="service_container"/>
- <argument>%doctrine_phpcr.odm.subscriber.image_cache.all_filters%</argument>
- </service>
-
- </services>
-
-</container>
View
22 Resources/config/odm_imagine.xml
@@ -0,0 +1,22 @@
+<?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">
+
+ <parameters>
+ <parameter key="doctrine_phpcr.odm.subscriber.imagine_cache_class">Doctrine\Bundle\PHPCRBundle\EventListener\ImagineCacheInvalidatorSubscriber</parameter>
+ </parameters>
+
+ <services>
+
+ <service id="doctrine_phpcr.odm.subscriber.imagine_cache" class="%doctrine_phpcr.odm.subscriber.imagine_cache_class%">
+ <tag name="doctrine_phpcr.event_subscriber"/>
+ <argument type="service" id="liip_imagine.cache.manager"/>
+ <argument type="service" id="service_container"/>
+ <argument>%doctrine_phpcr.odm.subscriber.imagine_cache.all_filters%</argument>
+ </service>
+
+ </services>
+
+</container>

0 comments on commit 72cc8a3

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