@@ -7,11 +7,9 @@ class JasperPHP
77 protected $executable = 'jasperstarter'; //executable jasperstarter
88 protected $path_executable;
99 protected $the_command;
10- protected $redirect_output;
11- protected $background;
1210 protected $windows = false;
1311
14- protected $formats = array( 'pdf', 'rtf', 'xls', 'xlsx', 'docx', 'odt', 'ods', 'pptx', 'csv', 'html', 'xhtml', 'xml', 'jrprint') ;
12+ protected $formats = [ 'pdf', 'rtf', 'xls', 'xlsx', 'docx', 'odt', 'ods', 'pptx', 'csv', 'html', 'xhtml', 'xml', 'jrprint'] ;
1513 protected $resource_directory; //Path to report resource dir or jar file
1614
1715 function __construct($resource_dir = false)
@@ -41,7 +39,7 @@ public static function __callStatic($method, $parameters)
4139 return call_user_func_array(array(new $model, $method), $parameters);
4240 }
4341
44- public function compile($input_file, $output_file = false, $background = true, $redirect_output = true )
42+ public function compile($input_file, $output_file = false)
4543 {
4644 if (is_null($input_file) || empty($input_file)) {
4745 throw new \Exception('No input file', 1);
@@ -57,14 +55,12 @@ public function compile($input_file, $output_file = false, $background = true, $
5755 $command .= ' -o ' . "\"$output_file\"";
5856 }
5957
60- $this->redirect_output = $redirect_output;
61- $this->background = $background;
6258 $this->the_command = $command;
6359
6460 return $this;
6561 }
6662
67- public function process($input_file, $output_file = false, $format = array( 'pdf') , $parameters = array() , $db_connection = array() , $locale = false, $background = true, $redirect_output = true )
63+ public function process($input_file, $output_file = false, $format = [ 'pdf'] , $parameters = [] , $db_connection = [] , $locale = false)
6864 {
6965 if (is_null($input_file) || empty($input_file)) {
7066 throw new \Exception('No input file', 1);
@@ -100,7 +96,6 @@ public function process($input_file, $output_file = false, $format = array('pdf'
10096 $command .= ' -f ' . $format;
10197 }
10298
103-
10499 if (count($parameters) > 0) {
105100 $command .= ' -P ';
106101
@@ -163,8 +158,6 @@ public function process($input_file, $output_file = false, $format = array('pdf'
163158 }
164159 }
165160
166- $this->redirect_output = $redirect_output;
167- $this->background = $background;
168161 $this->the_command = $command;
169162
170163 return $this;
@@ -194,12 +187,11 @@ public function output()
194187
195188 public function execute($run_as_user = false)
196189 {
197-
198190 if ($run_as_user !== false && strlen($run_as_user > 0) && !$this->windows) {
199191 $this->the_command = 'su -u ' . $run_as_user . " -c \"" . $this->the_command . "\"";
200192 }
201193
202- $output = array() ;
194+ $output = [] ;
203195 $return_var = 0;
204196
205197 if (is_dir($this->path_executable)) {
0 commit comments