-
Notifications
You must be signed in to change notification settings - Fork 453
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4751 from portabilis/community-patch-2018-12-21
Community patch 21/12/2018
- Loading branch information
Showing
12 changed files
with
721 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ matrix: | |
include: | ||
- language: php | ||
php: | ||
- 7.1 | ||
- 7.2 | ||
addons: | ||
postgresql: 9.5 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
namespace App\Console\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
|
||
class ReportsCompileCommand extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'reports:compile'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Compile reports files'; | ||
|
||
/** | ||
* Return the reports source path. | ||
* | ||
* @return string | ||
*/ | ||
protected function getJasperFiles() | ||
{ | ||
return base_path('ieducar/modules/Reports/ReportSources'); | ||
} | ||
|
||
/** | ||
* Return the JasperStarter binary file. | ||
* | ||
* @return string | ||
*/ | ||
protected function getJasperStarter() | ||
{ | ||
return base_path('vendor/cossou/jasperphp/src/JasperStarter/bin/jasperstarter'); | ||
} | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return mixed | ||
*/ | ||
public function handle() | ||
{ | ||
$this->info('Compiling reports files..'); | ||
|
||
$jasperFiles = $this->getJasperFiles(); | ||
$jasperStarter = $this->getJasperStarter(); | ||
|
||
passthru('cd ' . $jasperFiles . '; for line in $(ls -a | sort | grep .jrxml | sed -e "s/\.jrxml//"); do $(' . $jasperStarter . ' cp $line.jrxml -o $line); done'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.