Skip to content
This repository was archived by the owner on Oct 25, 2022. It is now read-only.

Commit 2ed2c0c

Browse files
authored
Merge pull request #70 from ArtisanTinkerer/master
Added .' 2>&1' to the exec command.
2 parents c238012 + 814a949 commit 2ed2c0c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/JasperPHP/JasperPHP.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function output()
161161
public function execute($run_as_user = false)
162162
{
163163
if( $this->redirect_output && !$this->windows)
164-
$this->the_command .= " > /dev/null 2>&1";
164+
$this->the_command .= " 2>&1";
165165

166166
if( $this->background && !$this->windows )
167167
$this->the_command .= " &";
@@ -174,9 +174,12 @@ public function execute($run_as_user = false)
174174

175175
exec($this->the_command, $output, $return_var);
176176

177-
if($return_var != 0)
177+
if( $return_var != 0 && isset($output[0]) )
178+
throw new \Exception($output[0], 1);
179+
180+
elseif( $return_var != 0 )
178181
throw new \Exception("Your report has an error and couldn't be processed! Try to output the command using the function `output();` and run it manually in the console.", 1);
179-
182+
180183
return $output;
181184
}
182185
}

0 commit comments

Comments
 (0)