Skip to content

Commit

Permalink
Merge pull request #4751 from portabilis/community-patch-2018-12-21
Browse files Browse the repository at this point in the history
Community patch 21/12/2018
  • Loading branch information
edersoares authored Dec 21, 2018
2 parents 7e2958e + de5072c commit 0912b60
Show file tree
Hide file tree
Showing 12 changed files with 721 additions and 146 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ matrix:
include:
- language: php
php:
- 7.1
- 7.2
addons:
postgresql: 9.5
Expand Down
57 changes: 57 additions & 0 deletions app/Console/Commands/ReportsCompileCommand.php
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');
}
}
2 changes: 2 additions & 0 deletions app/Console/Commands/ReportsInstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public function handle(Filesystem $filesystem, Connection $connection)
$filesystem->get($file)
);

$this->call('reports:compile');

$this->call('migrate', [
'--force' => true
]);
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"homepage": "https://github.com/portabilis/i-educar",
"require": {
"php": "^7.2.10",
"php": "^7.1.3",
"ext-pgsql": "*",
"cocur/slugify": "^3.1",
"composer/semver": "^1.4",
Expand Down
Loading

0 comments on commit 0912b60

Please sign in to comment.