svn: /web/doc-editor/trunk/ php/RepositoryManager.php scripts/cron/check_build.php

[email protected] (Yannick Torres)
Newsgroups php.doc.web
Message-ID <[email protected]>
yannick                                  Mon, 27 Dec 2010 21:36:52 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=306763

Log:
Revert to previous version as this change have been handle by configure.php script in version 306762

Changed paths:
    U   web/doc-editor/trunk/php/RepositoryManager.php
    U   web/doc-editor/trunk/scripts/cron/check_build.php

Modified: web/doc-editor/trunk/php/RepositoryManager.php
===================================================================
--- web/doc-editor/trunk/php/RepositoryManager.php	2010-12-27 21:22:45 UTC (rev 306762)
+++ web/doc-editor/trunk/php/RepositoryManager.php	2010-12-27 21:36:52 UTC (rev 306763)
@@ -309,21 +309,6 @@
     }

     /**
-     * Personnal exec to allow STDERR catch.
-     * Found in user's note : http://php.net/manual/fr/function.system.php
-     */
-    public function my_exec($cmd, $input='')
-    {
-        $proc=proc_open($cmd, array(0=>array('pipe', 'r'), 1=>array('pipe', 'w'), 2=>array('pipe', 'w')), $pipes);
-        fwrite($pipes[0], $input);fclose($pipes[0]);
-        $stdout=stream_get_contents($pipes[1]);fclose($pipes[1]);
-        $stderr=stream_get_contents($pipes[2]);fclose($pipes[2]);
-        $rtn=proc_close($proc);
-
-        return $stdout.$stderr;
-    }
-
-    /**
      * Check the build of the documentation (using configure.php script).
      *
      * @param $lang The lang of the documentation we want to check the build. We must take out $lang to be able to use this method from cron script on multiple language
@@ -356,16 +341,16 @@

         $trial_threshold = 3;
         while ($trial_threshold-- > 0) {
-            $output ='';
-            $output = $this->my_exec($cmd);
-            if (strlen(trim($output)) != 0) break;
+            $output =array();
+            exec($cmd, $output);
+            if (strlen(trim(implode('', $output))) != 0) break;
         }

         $return["logContent"] = $output;

         // We save the result of this check only if it failed.
-        if ( strstr($output, 'Eyh man. No worries. Happ shittens. Try again after fixing the errors above.') ||
-             strstr($output, 'There were warnings loading the manual') )
+        if ( strstr(implode(" ", $output), 'Eyh man. No worries. Happ shittens. Try again after fixing the errors above.') ||
+             strstr(implode(" ", $output), 'There were warnings loading the manual') )
         {
             $return["state"] = "ko";
         }

Modified: web/doc-editor/trunk/scripts/cron/check_build.php
===================================================================
--- web/doc-editor/trunk/scripts/cron/check_build.php	2010-12-27 21:22:45 UTC (rev 306762)
+++ web/doc-editor/trunk/scripts/cron/check_build.php	2010-12-27 21:36:52 UTC (rev 306763)
@@ -61,7 +61,7 @@

         =============================

-        ".$return["logContent"]."
+        ".implode("\n", $return["logContent"])."

         --
         This email is send automatically by the Php Docbook Online Editor.
@@ -76,7 +76,7 @@

                 echo "email send !\n";
                 // We store it into DB
-                LogManager::getInstance()->saveFailedBuild($lang, explode("\n",$return["logContent"]));
+                LogManager::getInstance()->saveFailedBuild($lang, $return["logContent"]);

             }
         }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.