Author: caefer
Date: 2010-03-16 07:08:11 +0100 (Tue, 16 Mar 2010)
New Revision: 28539

Added:
   plugins/sfImageTransformExtraPlugin/trunk/config/routing.yml
Modified:
   
plugins/sfImageTransformExtraPlugin/trunk/config/sfImageTransformExtraPluginConfiguration.class.php
   plugins/sfImageTransformExtraPlugin/trunk/package.xml.tmpl
   plugins/sfImageTransformExtraPlugin/trunk/test/fixtures/project/cache/
   plugins/sfImageTransformExtraPlugin/trunk/test/fixtures/project/log/
   
plugins/sfImageTransformExtraPlugin/trunk/test/unit/config/sfImageTransformExtraPluginConfigurationTest.php
Log:
* created routing.yml to replace sf_image route that was formerly added by code
* removed the route generating code from 
sfImageTransformExtraPluginConfiguration
* removed the unit test for the route generation as it is now obsolete
* added a comment to the upcomming release in package.xml.tmpl

* also added cache and log directory of the fixture project to svn:ignore



Added: plugins/sfImageTransformExtraPlugin/trunk/config/routing.yml
===================================================================
--- plugins/sfImageTransformExtraPlugin/trunk/config/routing.yml                
                (rev 0)
+++ plugins/sfImageTransformExtraPlugin/trunk/config/routing.yml        
2010-03-16 06:08:11 UTC (rev 28539)
@@ -0,0 +1,13 @@
+sf_image:
+  class: sfImageTransformRoute
+  url:   /thumbnails/:type/:format/:path/:slug-:id.:sf_format
+  param: { module: sfImageTransformator, action: index }
+  requirements:
+    format:    '[\w_-]+(?:,[\w_-]+(?:,[\w_-]+)?)?'
+    path:      '[\w/]+'
+    slug:      '[\w_-]+'
+    id:        '\d+(?:,\d+)?'
+    sf_format: gif|png|jpg
+    sf_method: [ get ]
+  options:
+    segment_separators: [ '/', '.', '-' ]

Modified: 
plugins/sfImageTransformExtraPlugin/trunk/config/sfImageTransformExtraPluginConfiguration.class.php
===================================================================
--- 
plugins/sfImageTransformExtraPlugin/trunk/config/sfImageTransformExtraPluginConfiguration.class.php
 2010-03-16 01:00:05 UTC (rev 28538)
+++ 
plugins/sfImageTransformExtraPlugin/trunk/config/sfImageTransformExtraPluginConfiguration.class.php
 2010-03-16 06:08:11 UTC (rev 28539)
@@ -34,7 +34,6 @@
     }
 
     $this->dispatcher->connect('context.load_factories', 
array('sfImageTransformExtraPluginConfiguration', 'registerStreamWrapper'));
-    $this->dispatcher->connect('routing.load_configuration', 
array('sfImageTransformExtraPluginConfiguration', 'prependRoutes'));
     $this->dispatcher->connect('controller.change_action', 
array('sfImageTransformExtraPluginConfiguration', 'setViewCache'));
     $this->dispatcher->connect('sf_image_transform.changed_source', 
array('sfImageTransformExtraPluginConfiguration', 'removeOldThumbnails'));
   }
@@ -111,44 +110,6 @@
   }
 
   /**
-   * Prepends default route for generated images
-   *
-   * @static
-   * @param  sfEvent $event Event object as passed by symfony event system
-   *
-   * @return void
-   */
-  static public function prependRoutes(sfEvent $event)
-  {
-    $routing = $event->getSubject();
-    $routes  = $routing->getRoutes();
-
-    if(!array_key_exists('sf_image', $routes))
-    {
-      $routing->prependRoute('sf_image',
-        new sfImageTransformRoute(
-          '/thumbnails/:type/:format/:path/:slug-:id.:sf_format',
-          array(
-            'module' => 'sfImageTransformator',
-            'action' => 'index'
-          ),
-          array(
-            'format' => '[\\w_-]+(?:,[\\w_-]+(?:,[\\w_-]+)?)?',
-            'path' => '[\\w/]+',
-            'slug' => '[\\w_-]+',
-            'id' => '\d+(?:,\d+)?',
-            'sf_format' => 'gif|png|jpg',
-            'sf_method' => array('get')
-          ),
-          array(
-            'segment_separators' => array('/', '.', '-')
-          )
-        )
-      );
-    }
-  }
-
-  /**
    * Removes all generated thumbnails for given asset when a new contentAsset 
is published
    *
    * @todo

Modified: plugins/sfImageTransformExtraPlugin/trunk/package.xml.tmpl
===================================================================
--- plugins/sfImageTransformExtraPlugin/trunk/package.xml.tmpl  2010-03-16 
01:00:05 UTC (rev 28538)
+++ plugins/sfImageTransformExtraPlugin/trunk/package.xml.tmpl  2010-03-16 
06:08:11 UTC (rev 28539)
@@ -2,12 +2,12 @@
 <package xmlns="http://pear.php.net/dtd/package-2.0"; 
xmlns:tasks="http://pear.php.net/dtd/tasks-1.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; packagerversion="1.4.1" 
version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 
http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 
http://pear.php.net/dtd/package-2.0.xsd";>
   <name>sfImageTransformExtraPlugin</name>
   <channel>pear.symfony-project.com</channel>
-  <summary>##SUMMARY##</summary>
-  <description>##SUMMARY##</description>
+  <summary>Christian Schaefer &amp;lt;[email protected]&amp;gt;</summary>
+  <description>Christian Schaefer &amp;lt;[email protected]&amp;gt;</description>
   <lead>
-    <name>##LEAD_NAME##</name>
-    <user>##LEAD_USERNAME##</user>
-    <email>##LEAD_EMAIL##</email>
+    <name>Christian Schaefer</name>
+    <user>caefer</user>
+    <email>[email protected]</email>
     <active>yes</active>
   </lead>
   <date>##CURRENT_DATE##</date>
@@ -35,12 +35,66 @@
       <package>
         <name>symfony</name>
         <channel>pear.symfony-project.com</channel>
-        <min>1.2.0</min>
-        <max>1.3.0</max>
-        <exclude>1.3.0</exclude>
+        <min>1.4.0</min>
+        <max>1.4.4</max>
       </package>
+      <package>
+        <name>sfImageTransformPlugin</name>
+        <channel>plugins.symfony-project.org</channel>
+        <min>1.3.0</min>
+        <max>1.3.2</max>
+      </package>
     </required>
   </dependencies>
   <phprelease></phprelease>
-  <changelog></changelog>
+  <changelog>
+    <release>
+      <version>
+        <release>0.9.2</release>
+        <api>0.9.0</api>
+      </version>
+      <stability>
+        <release>stable</release>
+        <api>stable</api>
+      </stability>
+      <license uri="http://www.symfony-project.org/license";>MIT 
license</license>
+      <date>2010-03-16</date>
+      <license>MIT</license>
+      <notes>
+       * caefer: transfered route from plugin configuration to routing.yml
+      </notes>
+    </release>
+    <release>
+      <version>
+        <release>0.9.1</release>
+        <api>0.9.0</api>
+      </version>
+      <stability>
+        <release>stable</release>
+        <api>stable</api>
+      </stability>
+      <license uri="http://www.symfony-project.org/license";>MIT 
license</license>
+      <date>2010-03-14</date>
+      <license>MIT</license>
+      <notes>
+       * caefer: at least started the README
+      </notes>
+    </release>
+    <release>
+      <version>
+        <release>0.9.0</release>
+        <api>0.9.0</api>
+      </version>
+      <stability>
+        <release>stable</release>
+        <api>stable</api>
+      </stability>
+      <license uri="http://www.symfony-project.org/license";>MIT 
license</license>
+      <date>2010-03-14</date>
+      <license>MIT</license>
+      <notes>
+       * caefer: initial commit with documentation yet to write
+      </notes>
+    </release>
+  </changelog>
 </package>


Property changes on: 
plugins/sfImageTransformExtraPlugin/trunk/test/fixtures/project/cache
___________________________________________________________________
Added: svn:ignore
   + *



Property changes on: 
plugins/sfImageTransformExtraPlugin/trunk/test/fixtures/project/log
___________________________________________________________________
Added: svn:ignore
   + *


Modified: 
plugins/sfImageTransformExtraPlugin/trunk/test/unit/config/sfImageTransformExtraPluginConfigurationTest.php
===================================================================
--- 
plugins/sfImageTransformExtraPlugin/trunk/test/unit/config/sfImageTransformExtraPluginConfigurationTest.php
 2010-03-16 01:00:05 UTC (rev 28538)
+++ 
plugins/sfImageTransformExtraPlugin/trunk/test/unit/config/sfImageTransformExtraPluginConfigurationTest.php
 2010-03-16 06:08:11 UTC (rev 28539)
@@ -29,14 +29,12 @@
   {
     $dispatcher = $this->projectConfiguration->getEventDispatcher();
     $load_factories = 
count($dispatcher->getListeners('context.load_factories'));
-    $load_configuration = 
count($dispatcher->getListeners('routing.load_configuration'));
     $change_action = 
count($dispatcher->getListeners('controller.change_action'));
     $changed_source = 
count($dispatcher->getListeners('sf_image_transform.changed_source'));
 
     $this->pluginConfiguration->initialize();
 
     $this->assertEquals($load_factories + 1, 
count($dispatcher->getListeners('context.load_factories')));
-    $this->assertEquals($load_configuration + 1, 
count($dispatcher->getListeners('routing.load_configuration')));
     $this->assertEquals($change_action + 1, 
count($dispatcher->getListeners('controller.change_action')));
     $this->assertEquals($changed_source + 1, 
count($dispatcher->getListeners('sf_image_transform.changed_source')));
   }
@@ -67,15 +65,6 @@
     $this->assertTrue(in_array('sfImageSource', stream_get_wrappers()));
   }
 
-  public function testPrependRoutes()
-  {
-    $routing = new 
sfPatternRouting($this->projectConfiguration->getEventDispatcher());
-    $routing->clearRoutes();
-    $event = new sfEvent($routing, 'routing.load_configuration', array());
-    sfImageTransformExtraPluginConfiguration::prependRoutes($event);
-    $this->assertTrue($routing->hasRouteName('sf_image'));
-  }
-
   public function testRemoveOldThumbnails()
   {
     //$event = new sfEvent($this, 'sf_image_transform.changed_source', 
array());

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to