Przeglądaj źródła

[Process] tweaked php doc and fixed PhpProcess::run() return value

Fabien Potencier 14 lat temu
rodzic
commit
d70ce5b9aa

+ 6 - 2
src/Symfony/Component/Process/PhpProcess.php

@@ -14,6 +14,10 @@ namespace Symfony\Component\Process;
 /**
  * PhpProcess runs a PHP script in an independent process.
  *
+ * $p = new PhpProcess('<?php echo "foo"; ?>');
+ * $p->run();
+ * print $p->getOutput()."\n";
+ *
  * @author Fabien Potencier <fabien.potencier@symfony-project.com>
  */
 class PhpProcess extends Process
@@ -41,7 +45,7 @@ class PhpProcess extends Process
     }
 
     /**
-     * run the process.
+     * Runs the process.
      *
      * @param Closure|string|array $callback A PHP callback to run whenever there is some
      *                                       output available on STDOUT or STDERR
@@ -54,7 +58,7 @@ class PhpProcess extends Process
             $this->commandline = $this->getPhpBinary();
         }
 
-        parent::run($callback);
+        return parent::run($callback);
     }
 
     /**

+ 1 - 1
src/Symfony/Component/Process/Process.php

@@ -60,7 +60,7 @@ class Process
     }
 
     /**
-     * run the process.
+     * Runs the process.
      *
      * The callback receives the type of output (out or err) and
      * some bytes from the output in real-time. It allows to have feedback