/** * Convenience method to execute the command and format the output. * * @param[in] string $command command to execute. * * @return Array well formated array output based on the input parameters. * returns null is nothing was found for given command parmeters. * */ private static function _executeAndFormat(&$command) { // execute query $command_output = shell_exec($command); // parse output // split each line output $lines = split("\n", $command_output); $i = 0; $count = count($lines) - 1; $output = array(); while ($i < $count) { PACS::_parseEOL($output, $lines, $i); } // return null if array is enpty (prolly a wrong parameter) if (empty($output)) { return null; } return $output; }