Created
January 2, 2018 23:25
-
-
Save lloc/bec4cc6f55e56020886ef99897d38927 to your computer and use it in GitHub Desktop.
Class of the changelog.php post
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 | |
namespace lloc\changelog; | |
/** | |
* Class ArrayOutput | |
* @package lloc\changelog | |
*/ | |
class ArrayOutput { | |
/** | |
* @var string | |
*/ | |
protected $cmd; | |
/** | |
* @param string $cmd | |
*/ | |
public function __construct( $cmd ) { | |
$this->cmd = $cmd; | |
} | |
/** | |
* @return array | |
*/ | |
function get() { | |
$output = shell_exec( $this->cmd ); | |
return (array) preg_split( "#[\r\n]+#", $output ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment