Skip to content

Commit a664b07

Browse files
authored
Merge pull request #48 from PHPJasper/php7
v2
2 parents 88ef738 + f39e095 commit a664b07

15 files changed

+167
-173
lines changed

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ This package is the solution to compile and process JasperReports (.jrxml & .jas
1919
Do not forget to grant the correct permissions for the directory
2020
**/vendor/geekcom/phpjasper/bin/jasperstarter/bin** and the file binary **jasperstarter**
2121

22-
**Do you need to generate Python reports?**
23-
24-
Meet the **[pyreport](https://github.com/jadsonbr/pyreport)**
25-
2622
### Why PHPJasper?
2723

2824
Did you ever had to create a good looking Invoice with a lot of fields for your great web app?
@@ -51,8 +47,8 @@ Package to generate reports with [JasperReports 6.3.1](http://community.jasperso
5147

5248
## Requirements
5349

50+
* PHP 7.1 or above
5451
* Java JDK 1.8
55-
* PHP [exec()](http://php.net/manual/function.exec.php) function
5652

5753
## Optional
5854

composer.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,22 @@
1414
"role": "lead"
1515
}
1616
],
17-
"minimum-stability": "dev",
17+
"minimum-stability": "stable",
1818
"require": {
19-
"php": ">=5.4.0",
19+
"php": ">=7.1",
2020
"symfony/console": "^3.2"
2121
},
2222
"require-dev": {
23-
"phpunit/phpunit": "4.8.*"
23+
"phpunit/phpunit": "^6.1"
2424
},
2525
"autoload": {
2626
"psr-4": {
27-
"JasperPHP\\": "src/"
27+
"PHPJasper\\": "src/"
28+
}
29+
},
30+
"autoload-dev": {
31+
"psr-4": {
32+
"PHPJasper\\": "tests/"
2833
}
2934
}
30-
}
35+
}

docs/pt_BR/LEIA-ME_pt_BR.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ Este pacote é a solução perfeita para compilar e processar relatórios Jasper
2121
Não esqueça de fornecer as permissões devidas para o diretório
2222
**/vendor/geekcom/phpjasper/bin/jasperstarter/bin** e para o arquivo binário **jasperstarter**
2323

24-
**Precisa gerar relatórios em Python?**
25-
26-
Conheça a biblioteca **[pyreport](https://github.com/jadsonbr/pyreport)**
27-
2824
### Por quê preciso do PHPJasper?
2925

3026
Alguma vez você precisou de um relatório simples ou complexo em PHP para seu sistema web?
@@ -48,8 +44,8 @@ Apresento para vocês **JasperReports** a melhor solução open source que exist
4844

4945
## Requisitos
5046

47+
* PHP 7.1 em diante
5148
* Java JDK 1.8
52-
* PHP [exec()](http://php.net/manual/function.exec.php) function
5349

5450
## Opcional
5551

phpunit.xml.dist renamed to phpunit.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
2+
<phpunit bootstrap="./vendor/autoload.php"
3+
backupGlobals="false"
34
backupStaticAttributes="false"
45
colors="true"
56
convertErrorsToExceptions="true"
@@ -11,7 +12,7 @@
1112

1213
<filter>
1314
<whitelist>
14-
<directory>src/JasperPHP</directory>
15+
<directory>src/PHPJasper</directory>
1516
<directory>src/JasperStarter</directory>
1617
</whitelist>
1718
</filter>

src/Command/JasperPHPCommand.php renamed to src/Command/PHPJasperCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
2-
namespace JasperPHP;
2+
namespace PHPJasper;
33

44
use Symfony\Component\Console\Command\Command;
55
use Symfony\Component\Console\Input\InputInterface;
66
use Symfony\Component\Console\Output\OutputInterface;
77

8-
class JasperPHPCommand extends Command
8+
class PHPJasperCommand extends Command
99
{
1010
/**
1111
*

src/Exception/ErrorCommandExecutable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
2-
namespace JasperPHP\Exception;
2+
namespace PHPJasper\Exception;
33
/**
44
* Class ErrorCommandExecutable
5-
* @package JasperPHP\Exception
5+
* @package PHPJasper\Exception
66
*/
77
class ErrorCommandExecutable extends \Exception
88
{

src/Exception/InvalidCommandExecutable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
2-
namespace JasperPHP\Exception;
2+
namespace PHPJasper\Exception;
33
/**
44
* Class InvalidCommandExecutable
5-
* @package JasperPHP\Exception
5+
* @package PHPJasper\Exception
66
*/
77
class InvalidCommandExecutable extends \Exception
88
{

src/Exception/InvalidFormat.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
2-
namespace JasperPHP\Exception;
2+
namespace PHPJasper\Exception;
33
/**
44
* Class InvalidFormat
5-
* @package JasperPHP\Exception
5+
* @package PHPJasper\Exception
66
*/
77
class InvalidFormat extends \Exception
88
{

src/Exception/InvalidInputFile.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
2-
namespace JasperPHP\Exception;
2+
namespace PHPJasper\Exception;
33
/**
44
* Class InvalidInputFile
5-
* @package JasperPHP\Exception
5+
* @package PHPJasper\Exception
66
*/
77
class InvalidInputFile extends \Exception
88
{

src/Exception/InvalidResourceDirectory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
2-
namespace JasperPHP\Exception;
2+
namespace PHPJasper\Exception;
33
/**
44
* Class InvalidResourceDirectory
5-
* @package JasperPHP\Exception
5+
* @package PHPJasper\Exception
66
*/
77
class InvalidResourceDirectory extends \Exception
88
{

src/JasperPHP.php renamed to src/PHPJasper.php

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
2-
namespace JasperPHP;
2+
3+
namespace PHPJasper;
4+
35
/**
4-
* Class JasperPHP
5-
* @package JasperPHP
6+
* Class PHPJasper
7+
* @package PHPJasper
68
*/
7-
class JasperPHP
9+
class PHPJasper
810
{
911

1012
/**
@@ -33,7 +35,7 @@ class JasperPHP
3335
protected $formats = ['pdf', 'rtf', 'xls', 'xlsx', 'docx', 'odt', 'ods', 'pptx', 'csv', 'html', 'xhtml', 'xml', 'jrprint'];
3436

3537
/**
36-
* JasperPHP constructor
38+
* PHPJasper constructor
3739
*/
3840
public function __construct()
3941
{
@@ -51,7 +53,7 @@ public function __construct()
5153
public function compile($input_file, $output_file = false)
5254
{
5355
if (!$input_file) {
54-
throw new \JasperPHP\Exception\InvalidInputFile();
56+
throw new \PHPJasper\Exception\InvalidInputFile();
5557
}
5658

5759
$this->command = $this->windows ? $this->executable : './' . $this->executable;
@@ -78,7 +80,7 @@ public function process($input_file, $output_file = false, $options = [])
7880
{
7981
$options = $this->parseProcessOptions($options);
8082
if (!$input_file) {
81-
throw new \JasperPHP\Exception\InvalidInputFile();
83+
throw new \PHPJasper\Exception\InvalidInputFile();
8284
}
8385
$this->validateFormat($options['format']);
8486

@@ -154,7 +156,7 @@ protected function validateFormat($format)
154156
}
155157
foreach ($format as $value) {
156158
if (!in_array($value, $this->formats)) {
157-
throw new \JasperPHP\Exception\InvalidFormat();
159+
throw new \PHPJasper\Exception\InvalidFormat();
158160
}
159161
}
160162
}
@@ -167,7 +169,7 @@ protected function validateFormat($format)
167169
public function listParameters($input_file)
168170
{
169171
if (!$input_file) {
170-
throw new \JasperPHP\Exception\InvalidInputFile();
172+
throw new \PHPJasper\Exception\InvalidInputFile();
171173
}
172174

173175
$this->command = $this->windows ? $this->executable : './' . $this->executable;
@@ -195,7 +197,7 @@ public function execute($user = false)
195197
chdir($this->path_executable);
196198
exec($this->command, $output, $return_var);
197199
if ($return_var !== 0) {
198-
throw new \JasperPHP\Exception\ErrorCommandExecutable();
200+
throw new \PHPJasper\Exception\ErrorCommandExecutable();
199201
}
200202

201203
return $output;
@@ -226,10 +228,10 @@ protected function addUserToCommand($user)
226228
protected function validateExecute()
227229
{
228230
if (!$this->command) {
229-
throw new \JasperPHP\Exception\InvalidCommandExecutable();
231+
throw new \PHPJasper\Exception\InvalidCommandExecutable();
230232
}
231233
if (!is_dir($this->path_executable)) {
232-
throw new \JasperPHP\Exception\InvalidResourceDirectory();
234+
throw new \PHPJasper\Exception\InvalidResourceDirectory();
233235
}
234236

235237
}

tests/JasperPHP/JasperPHPCommandTest.php

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/JasperPHP/JasperPHPTest.php

Lines changed: 0 additions & 121 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace PHPJasper\Test;
4+
5+
use PHPUnit\Framework\TestCase;
6+
7+
class PHPJasperCommandTest extends TestCase
8+
{
9+
public function testBasic()
10+
{
11+
$this->assertNull(null);
12+
}
13+
}

0 commit comments

Comments
 (0)