Skip to content

Commit ec76006

Browse files
committed
Refactor JasperPHP
1 parent d160daa commit ec76006

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/JasperPHP.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,29 @@ public function process($input_file, $output_file = false, $options = [])
101101
}
102102
}
103103

104+
if ($options['db_connection']) {
105+
106+
$mapDbParams = [
107+
'driver' => '-t',
108+
'username' => '-u',
109+
'password' => '-p',
110+
'host' => '-H',
111+
'database' => '-n',
112+
'port' => '--db-port',
113+
'jdbc_driver' => '--db-driver',
114+
'jdbc_url' => '--db-url',
115+
'jdbc_dir' => '--jdbc-dir',
116+
'db_sid' => '-db-sid',
117+
'xml_xpath' => '--xml-xpath',
118+
'data_file' => '--data-file',
119+
'json_query' => '--json-query'
120+
];
121+
122+
foreach ($options['db_connection'] as $key => $value) {
123+
$this->command .= " {$mapDbParams[$key]} {$value}";
124+
}
125+
}
126+
104127
return $this;
105128
}
106129

0 commit comments

Comments
 (0)