http://www.mediawiki.org/wiki/Special:Code/MediaWiki/56677

Revision: 56677
Author:   avar
Date:     2009-09-20 18:07:20 +0000 (Sun, 20 Sep 2009)

Log Message:
-----------
Use wfShellExec

Modified Paths:
--------------
    trunk/extensions/Translate/utils/TranslateYaml.php

Modified: trunk/extensions/Translate/utils/TranslateYaml.php
===================================================================
--- trunk/extensions/Translate/utils/TranslateYaml.php  2009-09-20 16:51:45 UTC 
(rev 56676)
+++ trunk/extensions/Translate/utils/TranslateYaml.php  2009-09-20 18:07:20 UTC 
(rev 56677)
@@ -45,9 +45,9 @@
                       "open my \$fh, q[>], q[$tf.serialized] or die qq[Can not 
open $tf.serialized];" .
                       "print \$fh serialize(\$yaml);" .
                       "close(\$fh);'";
-               $ret = shell_exec($cmd);
-               if (!isset($ret)) {
-                       die("The command '$cmd' died in execution");
+               wfShellExec( $cmd, &$ret );
+               if ( $ret != 0 )
+                       die("The command '$cmd' died in execution with exit 
code '$ret'");
                }
 
                $serialized = file_get_contents("$tf.serialized");
@@ -71,9 +71,9 @@
                $cmd = "perl -MYAML::Syck=DumpFile 
-MPHP::Serialization=unserialize -MFile::Slurp=slurp -le '" .
                       "my \$serialized = slurp(\"$tf\");" .
                           "DumpFile(q[$tf.yaml], \$serialized);'";
-               $ret = shell_exec($cmd);
-               if (!isset($ret)) {
-                       die("The command '$cmd' died in execution");
+               wfShellExec( $cmd, &$ret );
+               if ( $ret != 0 )
+                       die("The command '$cmd' died in execution with exit 
code '$ret'");
                }
 
                $yaml = file_get_contents("$tf.yaml");



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to