Skip to content

Commit

Permalink
Update Multiples param
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrocopam committed Mar 17, 2016
1 parent 1605617 commit 2f1a3b1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/JasperPHP/JasperPHP.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 )
Expand Down Expand Up @@ -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']) )
Expand All @@ -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'];

}
Expand Down

0 comments on commit 2f1a3b1

Please sign in to comment.