Author: rande
Date: 2010-04-28 00:09:22 +0200 (Wed, 28 Apr 2010)
New Revision: 29273

Modified:
   plugins/sfSolrPlugin/branches/sf1.2/lib/task/sfLuceneServiceTask.class.php
   
plugins/sfSolrPlugin/branches/sf1.2/lib/task/sfLuceneUpdateModelSystemTask.class.php
Log:
[sfSolrPlugin] update tasks to work with symfony 1.3 or greater

Modified: 
plugins/sfSolrPlugin/branches/sf1.2/lib/task/sfLuceneServiceTask.class.php
===================================================================
--- plugins/sfSolrPlugin/branches/sf1.2/lib/task/sfLuceneServiceTask.class.php  
2010-04-27 21:55:54 UTC (rev 29272)
+++ plugins/sfSolrPlugin/branches/sf1.2/lib/task/sfLuceneServiceTask.class.php  
2010-04-27 22:09:22 UTC (rev 29273)
@@ -170,10 +170,20 @@
     $this->logSection('exec ', $command);
     exec($command ,$op);
 
-    $this->getFilesystem()->sh(sprintf('cd %s',
-      sfConfig::get('sf_root_dir')
-    ));
+    if(method_exists($this->getFilesystem(), 'execute')) // sf1.3 or greater
+    {
+      $this->getFilesystem()->execute(sprintf('cd %s',
+        sfConfig::get('sf_root_dir')
+      ));      
+    }
+    else
+    {
+      $this->getFilesystem()->sh(sprintf('cd %s',
+        sfConfig::get('sf_root_dir')
+      ));
+    }
 
+
     $pid = (int)$op[0];
     file_put_contents($this->getPidFile($app, $env), $pid);
 
@@ -197,7 +207,14 @@
       throw new sfException('Invalid pid provided : '.$pid);
     }
 
-    $this->getFilesystem()->sh("kill -15 ".$pid);
+    if(method_exists($this->getFilesystem(), 'execute')) // sf1.3 or greater
+    {
+      $this->getFilesystem()->execute("kill -15 ".$pid);
+    }
+    else
+    {
+      $this->getFilesystem()->sh("kill -15 ".$pid);
+    }
 
     unlink($this->getPidFile($app, $env));
   }

Modified: 
plugins/sfSolrPlugin/branches/sf1.2/lib/task/sfLuceneUpdateModelSystemTask.class.php
===================================================================
--- 
plugins/sfSolrPlugin/branches/sf1.2/lib/task/sfLuceneUpdateModelSystemTask.class.php
        2010-04-27 21:55:54 UTC (rev 29272)
+++ 
plugins/sfSolrPlugin/branches/sf1.2/lib/task/sfLuceneUpdateModelSystemTask.class.php
        2010-04-27 22:09:22 UTC (rev 29273)
@@ -138,7 +138,15 @@
 
       try
       {
-        $return_code = $this->getFilesystem()->sh($command);
+        if(method_exists($this->getFilesystem(), 'execute')) // sf1.3 or 
greater
+        {
+          $this->getFilesystem()->execute($command);
+        }
+        else
+        {
+          $this->getFilesystem()->sh($command);
+        }
+
         $this->logSection('lucene', 'end indexing model : '.$model);
 
         return 0;

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