class_mcBash.inc.php 958 Bytes
<?php
/** 
 * @copyright (c) 2014, netz.coop eG
 */
class mcBash  {
	public static function exec($command, array &$output = null, &$return_var = null) {
		$StartTime = time();

			$shell_exec = exec($command, $output, $return_var);	

		$zeit = getdate(time() - $StartTime);
		D::ulli($zeit["minutes"].'m'.$zeit["seconds"].'s: mcBash# '.$command);
		
			return $shell_exec;
	}

	/**
	* (PHP 4, PHP 5)<br/>
	* Execute command via shell and return the complete output as a string
	* @link http://php.net/manual/en/function.shell-exec.php
	* @param string $cmd <p>
	* The command that will be executed.
	* </p>
	* @return string The output from the executed command or <b>NULL</b> if an error occurred.
	*/	
	public static function shell_exec ($cmd) {
		$StartTime = time();
		
			$shell_exec = shell_exec($cmd);	
		
		$zeit = getdate(time() - $StartTime);
		D::ulli($zeit["minutes"].'m'.$zeit["seconds"].'s: mcBash# '.$cmd);
		
			return $shell_exec;	
	}
}


?>