diff --git a/src/JasperPHP/JasperPHP.php b/src/JasperPHP/JasperPHP.php index 251abc3..36751e0 100644 --- a/src/JasperPHP/JasperPHP.php +++ b/src/JasperPHP/JasperPHP.php @@ -85,7 +85,7 @@ public function process($input_file, $output_file = false, $format = array('pdf' if( $output_file !== false ) $command .= ' -o ' . "\"$output_file\""; - if( is_array($format) ) + if( is_array($format) ) $command .= ' -f ' . join(' ', $format); else $command .= ' -f ' . $format; @@ -96,11 +96,13 @@ public function process($input_file, $output_file = false, $format = array('pdf' if( count($parameters) > 0 ) { $command .= ' -P '; + foreach ($parameters as $key => $value) { - $param = $key . '=' . $value . ' '; - $command .= "\"$param\""; + $param = $key . '="' . $value . '" '; + $command .= " " .$param. " "; } + } if( count($db_connection) > 0 ) @@ -128,7 +130,7 @@ public function process($input_file, $output_file = false, $format = array('pdf' if( isset($db_connection['jdbc_url']) && !empty($db_connection['jdbc_url']) ) $command .= ' --db-url ' . $db_connection['jdbc_url']; - if ( isset($db_connection['jdbc_dir']) && !empty($db_connection['jdbc_dir']) ) + if ( isset($db_connection['jdbc_dir']) && !empty($db_connection['jdbc_dir']) ) $command .= ' --jdbc-dir ' . $db_connection['jdbc_dir']; if ( isset($db_connection['db_sid']) && !empty($db_connection['db_sid']) ) @@ -137,7 +139,7 @@ public function process($input_file, $output_file = false, $format = array('pdf' if ( isset($db_connection['xml_xpath']) ) $command .= ' --xml-xpath ' . $db_connection['xml_xpath']; - if ( isset($db_connection['data_file']) ) + if ( isset($db_connection['data_file']) ) $command .= ' --data-file ' . $db_connection['data_file']; }