Author: fabien
Date: 2010-03-23 16:28:37 +0100 (Tue, 23 Mar 2010)
New Revision: 28715

Modified:
   branches/1.3/lib/task/project/sfProjectOptimizeTask.class.php
   branches/1.4/lib/task/project/sfProjectOptimizeTask.class.php
Log:
[1.3, 1.4] fixed sfProjectOptimizeTask should optimize only enabled modules 
(closes #8405)

Modified: branches/1.3/lib/task/project/sfProjectOptimizeTask.class.php
===================================================================
--- branches/1.3/lib/task/project/sfProjectOptimizeTask.class.php       
2010-03-23 15:17:06 UTC (rev 28714)
+++ branches/1.3/lib/task/project/sfProjectOptimizeTask.class.php       
2010-03-23 15:28:37 UTC (rev 28715)
@@ -171,9 +171,17 @@
     $dirs = array(sfConfig::get('sf_app_module_dir'));
 
     // plugins
-    foreach ($this->configuration->getPluginPaths() as $path)
+    foreach 
($this->configuration->getPluginSubPaths(DIRECTORY_SEPARATOR.'modules') as 
$path)
     {
-      $dirs[] = $path.'/modules';
+      // parse out the plugin name
+      if 
(preg_match("#plugins".DIRECTORY_SEPARATOR."([^".DIRECTORY_SEPARATOR."]+)".DIRECTORY_SEPARATOR."modules#",
 $path, $matches))
+      {
+        // plugin module enabled?
+        if (in_array($matches[1], sfConfig::get('sf_enabled_modules')))
+        {
+          $dirs[] = $path;
+        }
+      }
     }
 
     // core modules

Modified: branches/1.4/lib/task/project/sfProjectOptimizeTask.class.php
===================================================================
--- branches/1.4/lib/task/project/sfProjectOptimizeTask.class.php       
2010-03-23 15:17:06 UTC (rev 28714)
+++ branches/1.4/lib/task/project/sfProjectOptimizeTask.class.php       
2010-03-23 15:28:37 UTC (rev 28715)
@@ -171,9 +171,17 @@
     $dirs = array(sfConfig::get('sf_app_module_dir'));
 
     // plugins
-    foreach ($this->configuration->getPluginPaths() as $path)
+    foreach 
($this->configuration->getPluginSubPaths(DIRECTORY_SEPARATOR.'modules') as 
$path)
     {
-      $dirs[] = $path.'/modules';
+      // parse out the plugin name
+      if 
(preg_match("#plugins".DIRECTORY_SEPARATOR."([^".DIRECTORY_SEPARATOR."]+)".DIRECTORY_SEPARATOR."modules#",
 $path, $matches))
+      {
+        // plugin module enabled?
+        if (in_array($matches[1], sfConfig::get('sf_enabled_modules')))
+        {
+          $dirs[] = $path;
+        }
+      }
     }
 
     // core modules

-- 
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