Skip to content

Instantly share code, notes, and snippets.

@lloc
Created January 2, 2018 23:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lloc/bec4cc6f55e56020886ef99897d38927 to your computer and use it in GitHub Desktop.
Save lloc/bec4cc6f55e56020886ef99897d38927 to your computer and use it in GitHub Desktop.
Class of the changelog.php post
<?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