Created
July 27, 2014 13:30
-
-
Save edouard-lopez/a68b9bc8e6f2931db214 to your computer and use it in GitHub Desktop.
php cli
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: ed8 | |
* Date: 7/27/14 | |
* Time: 12:02 PM | |
*/ | |
class Utils { | |
public function shell($command = null, $debug=true) { | |
$command = $debug ? $command." 2>&1" : $command; | |
exec("$command", $output, $exitCode); | |
foreach($output as $k => $line) { | |
if ($line == '1') { continue; } | |
echo "$line"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment