Skip to content

Commit 7a3bdd8

Browse files
committed
Use Symfony BinaryFileResponse instead of Contao for downloading files
1 parent 996b417 commit 7a3bdd8

File tree

18 files changed

+299
-250
lines changed

18 files changed

+299
-250
lines changed

.ecs/batch/check/default.bat

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
:: Run easy-coding-standard (ecs) via this batch file inside your IDE e.g. PhpStorm (Windows only)
2+
:: Install inside PhpStorm the "Batch Script Support" plugin
3+
cd..
4+
cd..
5+
cd..
6+
cd..
7+
cd..
8+
cd..
9+
vendor\bin\ecs check vendor/markocupic/phpoffice-bundle/src --config vendor/markocupic/phpoffice-bundle/.ecs/config/default.php
10+
cd vendor/markocupic/phpoffice-bundle/.ecs./batch/check

.ecs/batch/check/tests.bat

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
:: Run easy-coding-standard (ecs) via this batch file inside your IDE e.g. PhpStorm (Windows only)
2+
:: Install inside PhpStorm the "Batch Script Support" plugin
3+
cd..
4+
cd..
5+
cd..
6+
cd..
7+
cd..
8+
cd..
9+
vendor\bin\ecs check vendor/markocupic/phpoffice-bundle/tests --config vendor/markocupic/phpoffice-bundle/.ecs/config/default.php
10+
cd vendor/markocupic/phpoffice-bundle/.ecs./batch/check

.ecs/batch/fix/default.bat

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
:: Run easy-coding-standard (ecs) via this batch file inside your IDE e.g. PhpStorm (Windows only)
2+
:: Install inside PhpStorm the "Batch Script Support" plugin
3+
cd..
4+
cd..
5+
cd..
6+
cd..
7+
cd..
8+
cd..
9+
vendor\bin\ecs check vendor/markocupic/phpoffice-bundle/src --fix --config vendor/markocupic/phpoffice-bundle/.ecs/config/default.php
10+
cd vendor/markocupic/phpoffice-bundle/.ecs./batch/fix

.ecs/batch/fix/tests.bat

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
:: Run easy-coding-standard (ecs) via this batch file inside your IDE e.g. PhpStorm (Windows only)
2+
:: Install inside PhpStorm the "Batch Script Support" plugin
3+
cd..
4+
cd..
5+
cd..
6+
cd..
7+
cd..
8+
cd..
9+
vendor\bin\ecs check vendor/markocupic/phpoffice-bundle/tests --fix --config vendor/markocupic/phpoffice-bundle/.ecs/config/default.php
10+
cd vendor/markocupic/phpoffice-bundle/.ecs./batch/fix

.ecs/config/default.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
6+
7+
return static function (ContainerConfigurator $containerConfigurator): void {
8+
// Contao
9+
$containerConfigurator->import(__DIR__ . '../../../../../contao/easy-coding-standard/config/contao.php');
10+
// Custom
11+
$containerConfigurator->import(__DIR__.'/set/header_comment_fixer.php');
12+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
6+
use PhpCsFixer\Fixer\Comment\HeaderCommentFixer;
7+
8+
return static function (ContainerConfigurator $containerConfigurator): void {
9+
10+
$services = $containerConfigurator->services();
11+
12+
$services
13+
->set(HeaderCommentFixer::class)
14+
->call('configure', [[
15+
'header' => "This file is part of Php Office Bundle.\n\n(c) Marko Cupic ".date('Y')." <m.cupic@gmx.ch>\n@license GPL-3.0-or-later\nFor the full copyright and license information,\nplease view the LICENSE file that was distributed with this source code.\n@link https://github.com/markocupic/phpoffice-bundle",
16+
]])
17+
;
18+
};

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
## MsWordTemplateProcessor
44
#### Generate easily Microsoft Word documents:
55

6-
Watch the [demo template](https://github.com/markocupic/phpfoffice-bundle/blob/master/src/example/templates/ms_word_template.docx)
7-
and the [result](https://github.com/markocupic/phpfoffice-bundle/blob/master/src/example/results/msword_result.docx)
6+
Watch the [demo template](https://github.com/markocupic/phpfoffice-bundle/blob/master/docs/example/templates/ms_word_template.docx)
7+
and the [result](https://github.com/markocupic/phpfoffice-bundle/blob/master/docs/example/results/msword_result.docx)
88

99

1010
```php
@@ -55,7 +55,7 @@ $objPhpWord->addToClone('rank', 'avatar', 'vendor/markocupic/phpoffice-bundle/sr
5555
// .... etc.
5656

5757
// Create & send file to browser
58-
$objPhpWord->sendToBrowser(true)
58+
$objPhpWord->sendToBrowser(true,true)
5959
->generateUncached(true)
6060
->generate();
6161

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "PhpOffice helper classes",
44
"keywords": [
55
"docx",
6-
"template processor"
6+
"template processor helper"
77
],
88
"type": "contao-bundle",
99
"license": "LGPL-3.0+",
@@ -20,8 +20,8 @@
2020
"source": "https://github.com/markocupic/phpoffice-bundle"
2121
},
2222
"require": {
23-
"php": "^7.0||^8.0",
24-
"contao/core-bundle": "^4.9",
23+
"php": "^7.4||^8.0",
24+
"contao/core-bundle": "^4.12",
2525
"phpoffice/phpword": "^0.18"
2626
},
2727
"autoload": {
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)