Skip to content

Instantly share code, notes, and snippets.

@edouard-lopez
Created July 27, 2014 13:30
Show Gist options
  • Save edouard-lopez/a68b9bc8e6f2931db214 to your computer and use it in GitHub Desktop.
Save edouard-lopez/a68b9bc8e6f2931db214 to your computer and use it in GitHub Desktop.
php cli
<?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