executable;
-
+
$command .= " cp ";
$command .= $input_file;
@@ -46,14 +46,14 @@ class JasperPHP
return $this;
}
- public function process($input_file, $output_file = false, $format = array("pdf"), $parameters = array(), $db_connection = array(), $background = true, $redirect_output = true)
+ public function process($input_file, $output_file = false, $format = array("pdf"), $parameters = array(), $db_connection = array(), $background = true, $redirect_output = true, $filter_params = true)
{
if(is_null($input_file) || empty($input_file))
throw new \Exception("No input file", 1);
if( is_array($format) )
{
- foreach ($format as $key)
+ foreach ($format as $key)
{
if( !in_array($key, $this->formats))
throw new \Exception("Invalid format!", 1);
@@ -61,10 +61,20 @@ class JasperPHP
} else {
if( !in_array($format, $this->formats))
throw new \Exception("Invalid format!", 1);
- }
-
- $command = __DIR__ . $this->executable;
-
+ }
+
+ $params_command = $command = __DIR__ . $this->executable;
+
+ $params_command .= " params " . $input_file . " 2>&1 ";
+
+ if($filter_params){
+ exec($params_command, $params_output);
+ foreach ($params_output as $key => &$param) {
+ $exploded = explode(" ", $param);
+ $param = $exploded[1];
+ }
+ }
+
$command .= " pr ";
$command .= $input_file;
@@ -83,29 +93,33 @@ class JasperPHP
if( count($parameters) > 0 )
{
$command .= " -P";
- foreach ($parameters as $key => $value)
+ foreach ($parameters as $key => $value)
{
- $command .= " " . $key . "=" . $value;
+ if(!$filter_params || in_array($key, $params_output))
+ $command .= " " . $key . "=\"" . $value."\"";
}
- }
+ }
if( count($db_connection) > 0 )
{
$command .= " -t " . $db_connection['driver'];
$command .= " -u " . $db_connection['username'];
-
+
if( isset($db_connection['password']) && !empty($db_connection['password']) )
$command .= " -p " . $db_connection['password'];
if( isset($db_connection['host']) && !empty($db_connection['host']) )
$command .= " -H " . $db_connection['host'];
-
+
if( isset($db_connection['database']) && !empty($db_connection['database']) )
$command .= " -n " . $db_connection['database'];
-
+
+ if( isset($db_connection['port']) && !empty($db_connection['port']) )
+ $command .= " --db-port " . $db_connection['port'];
+
if( isset($db_connection['jdbc_driver']) && !empty($db_connection['jdbc_driver']) )
$command .= " --db-driver " . $db_connection['jdbc_driver'];
-
+
if( isset($db_connection['jdbc_url']) && !empty($db_connection['jdbc_url']) )
$command .= " --db-url " . $db_connection['jdbc_url'];
}
@@ -125,8 +139,8 @@ class JasperPHP
public function execute($run_as_user = false)
{
if( $this->redirect_output && !$this->windows)
- $this->the_command .= " > /dev/null 2>&1";
-
+ $this->the_command .= " 2>&1";
+
if( $this->background && !$this->windows )
$this->the_command .= " &";
@@ -138,8 +152,8 @@ class JasperPHP
exec($this->the_command, $output, $return_var);
- if($return_var != 0)
- throw new \Exception("There was and error executing the report! Time to check the logs!", 1);
+ if($return_var != 0)
+ throw new \Exception("Erro ao executar o relatorio! Detalhes: " . join($output, " "), 1);
return $output;
}
diff --git a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/bin/jasperstarter.exe b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/bin/jasperstarter.exe
old mode 100755
new mode 100644
index b7fda7f..b7fda7f
Binary files a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/bin/jasperstarter.exe and b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/bin/jasperstarter.exe differ
diff --git a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/docs/cs/usage.html b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/docs/cs/usage.html
index 24bb121..bb7a080 100644
--- a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/docs/cs/usage.html
+++ b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/docs/cs/usage.html
@@ -407,7 +407,7 @@ $ jasperstarter -f view -t mysql myreport.jasper -H localhost -u myuser -n mydb<
$ jasperstarter pr myreport.jrprint -f view
Reporty se zdrojem dat ve formátu CSV
-
Znaková sada souborů CSV je defaultně UTF-8. Další často používané znakové sady jsou cp1252 (Windows), ISO-8859-1 or ISO-8859-15 (Linux). Znakovou sadu CSV souboru lze specifikovat parametrem --csv-charset.
+
Znaková sada souborů CSV je defaultně UTF-8. Další často používané znakové sady jsou cp1252 (Windows), or 5 (Linux). Znakovou sadu CSV souboru lze specifikovat parametrem --csv-charset.
Jednotlivé údaje jsou obvykle odděleny novým řádkem, nemusí tak tomu ale být. separátor je závislý na defaultním separátoru celého systému a ten se v každém operačním systému liší. Pokud používáte CSV soubory z jiného systému, musíte tedy zadat správný separátor pomocí parametru --csv-record-del:
- Windows: \r\n
diff --git a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/docs/de/usage.html b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/docs/de/usage.html
index 93f1e36..47b4808 100644
--- a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/docs/de/usage.html
+++ b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/docs/de/usage.html
@@ -408,7 +408,7 @@ $ jasperstarter -f view -t mysql myreport.jasper -H localhost -u myuser -n mydb<
$ jasperstarter pr myreport.jrprint -f view
Reports mit einer CSV Datenquelle
-
Der CSV Datei Zeichensatz ist auf UTF-8 voreingestellt. Andere übliche Zeichensätze sind cp1252 (Windows), ISO-8859-1 oder ISO-8859-15 (Linux). Sie können den CSV Zeichensatz mit dem Parameter --csv-charset angeben.
+
Der CSV Datei Zeichensatz ist auf UTF-8 voreingestellt. Andere übliche Zeichensätze sind cp1252 (Windows), oder 5 (Linux). Sie können den CSV Zeichensatz mit dem Parameter --csv-charset angeben.
Datensätze werden üblicherweise mit einem Zeilenumbruch getrennt, aber dies muss nicht so sein. Das Datensatz-Trennzeichen ist auf den System Zeilenumbruch voreingestellt, welcher abhängig von Ihrem Betriebssystem unterschiedlich ist. Wenn Sie CSV Dateien von einem anderen System verwenden, müssen Sie den richtigen Zeilenumbruch mit dem Parameter --csv-record-del einstellen:
- Windows: \r\n
diff --git a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/docs/usage.html b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/docs/usage.html
index ae8815e..7789d3c 100644
--- a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/docs/usage.html
+++ b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/docs/usage.html
@@ -409,7 +409,7 @@ $ jasperstarter -f view -t mysql myreport.jasper -H localhost -u myuser -n mydb<
$ jasperstarter pr myreport.jrprint -f view
Reports with a CSV datasource
-
The CSV file charset defaults to UTF-8. Other common used charsets are cp1252 (Windows), ISO-8859-1 or ISO-8859-15 (Linux). You can specify the csv file charset with the --csv-charset parameter.
+
The CSV file charset defaults to UTF-8. Other common used charsets are cp1252 (Windows), or 5 (Linux). You can specify the csv file charset with the --csv-charset parameter.
Records are usually delimited by a newline but this is not a must. The record delimiter defaults to the system line separator which is different depending on your operating system. If you use CSV files from other systems you must provide the correct line ending with the --csv-record-del parameter:
- Windows: \r\n
diff --git a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/jdbc/postgresql-9.4-1203.jdbc4.jar b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/jdbc/postgresql-9.4-1203.jdbc4.jar
new file mode 100644
index 0000000..d58b628
Binary files /dev/null and b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/jdbc/postgresql-9.4-1203.jdbc4.jar differ
diff --git a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/argparse4j-0.4.3.jar b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/argparse4j-0.4.3.jar
old mode 100755
new mode 100644
index 73fc574..73fc574
Binary files a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/argparse4j-0.4.3.jar and b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/argparse4j-0.4.3.jar differ
diff --git a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/itext-4.2.1.jar b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/itext-4.2.1.jar
old mode 100755
new mode 100644
index 818d692..818d692
Binary files a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/itext-4.2.1.jar and b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/itext-4.2.1.jar differ
diff --git a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/jcalendar-1.4.jar b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/jcalendar-1.4.jar
old mode 100755
new mode 100644
index 617a335..617a335
Binary files a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/jcalendar-1.4.jar and b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/jcalendar-1.4.jar differ
diff --git a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/lucene-analyzers-common-4.5.1.jar b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/lucene-analyzers-common-4.5.1.jar
old mode 100755
new mode 100644
index b44fae3..b44fae3
Binary files a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/lucene-analyzers-common-4.5.1.jar and b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/lucene-analyzers-common-4.5.1.jar differ
diff --git a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/lucene-core-4.5.1.jar b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/lucene-core-4.5.1.jar
old mode 100755
new mode 100644
index b452cdd..b452cdd
Binary files a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/lucene-core-4.5.1.jar and b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/lucene-core-4.5.1.jar differ
diff --git a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/lucene-queries-4.5.1.jar b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/lucene-queries-4.5.1.jar
old mode 100755
new mode 100644
index c230f02..c230f02
Binary files a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/lucene-queries-4.5.1.jar and b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/lucene-queries-4.5.1.jar differ
diff --git a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/lucene-queryparser-4.5.1.jar b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/lucene-queryparser-4.5.1.jar
old mode 100755
new mode 100644
index 6d53d47..6d53d47
Binary files a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/lucene-queryparser-4.5.1.jar and b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/lucene-queryparser-4.5.1.jar differ
diff --git a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/lucene-sandbox-4.5.1.jar b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/lucene-sandbox-4.5.1.jar
old mode 100755
new mode 100644
index 7301af2..7301af2
Binary files a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/lucene-sandbox-4.5.1.jar and b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/lucene-sandbox-4.5.1.jar differ
diff --git a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/olap4j-0.9.7.309-JS-3.jar b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/olap4j-0.9.7.309-JS-3.jar
old mode 100755
new mode 100644
index 66b5f4d..66b5f4d
Binary files a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/olap4j-0.9.7.309-JS-3.jar and b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/olap4j-0.9.7.309-JS-3.jar differ
diff --git a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/poi-3.10-FINAL.jar b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/poi-3.10-FINAL.jar
old mode 100755
new mode 100644
index 8862e21..8862e21
Binary files a/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/poi-3.10-FINAL.jar and b/ieducar/vendor/cossou/jasperphp/src/JasperStarter/lib/poi-3.10-FINAL.jar differ
diff --git a/phinx.yml b/phinx.yml
index b21c3ac..9b983a5 100644
--- a/phinx.yml
+++ b/phinx.yml
@@ -10,5 +10,5 @@ environments:
name: ieducar
user: postgres
pass: postgres
- port: 5432
+ port: 5430
charset: utf8
--
libgit2 0.21.2