Skip to content

Commit ad38d4c

Browse files
committed
Merge branch 'feature/EnablePasswordProtection' of https://github.com/jun-i-corn/PHPWord into feature/EnablePasswordProtection
2 parents f7d2ad7 + 3b7b894 commit ad38d4c

39 files changed

+253
-86
lines changed

CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Change Log
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55

6-
v0.14.0 (?? ???? 2017)
6+
v0.14.0 (?? Dec 2017)
77
----------------------
88
This release fixes several bugs and adds some new features.
99
This is the last version to support PHP 5.3
@@ -18,13 +18,15 @@ This is the last version to support PHP 5.3
1818
- Support for Comments - @troosan #1067
1919
- Support for paragraph textAlignment - @troosan #1165
2020
- Add support for HTML underline tag <u> in addHtml - @zNightFalLz #1186
21-
- Allow to change cell width unit - guillaume-ro-fr #986
21+
- Allow to change cell width unit - @guillaume-ro-fr #986
2222
- Allow to change the line height rule @troosan
23+
- Implement PageBreak for odt writer @cookiekiller #863 #824
24+
- Allow to force an update of all fields on opening a document - @troosan #951
2325

2426
### Fixed
2527
- Loosen dependency to Zend
2628
- Images are not being printed when generating PDF - @hubertinio #1074 #431
27-
- Fixed some PHP 7 warnings - @ likeuntomurphy #927
29+
- Fixed some PHP 7 warnings - @likeuntomurphy #927
2830
- Fixed Word 97 reader - @alsofronie @Benpxpx @mario-rivera #912 #920 #892
2931
- Fixed image loading over https - @troosan #988
3032
- Impossibility to set different even and odd page headers - @troosan #981
@@ -39,6 +41,9 @@ This is the last version to support PHP 5.3
3941
- Fix incorrect image size between windows and mac - @bskrtich #874
4042
- Fix adding HTML table to document - @mogilvie @arivanbastos #324
4143

44+
###Deprecated
45+
- PhpWord->getProtection(), get it from the settings instead PhpWord->getSettings()->getDocumentProtection();
46+
4247
v0.13.0 (31 July 2016)
4348
-------------------
4449
This release brings several improvements in `TemplateProcessor`, automatic output escaping feature for OOXML, ODF, HTML, and RTF (turned off, by default).

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,18 @@ PHPWord requires the following:
6767
## Installation
6868

6969
PHPWord is installed via [Composer](https://getcomposer.org/).
70-
You just need to [add dependency](https://getcomposer.org/doc/04-schema.md#package-links>) on PHPWord into your package.
70+
To [add a dependency](https://getcomposer.org/doc/04-schema.md#package-links>) to PHPWord in your project, either
7171

72-
Example:
72+
Run the following to use the latest stable version
73+
```sh
74+
composer require phpoffice/phpword
75+
```
76+
or if you want the latest master version
77+
```sh
78+
composer require phpoffice/phpword:dev-master
79+
```
7380

81+
You can of course also manually edit your composer.json file
7482
```json
7583
{
7684
"require": {

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"php": ">=5.3.3",
3939
"ext-xml": "*",
4040
"zendframework/zend-escaper": "^2.2",
41-
"zendframework/zend-stdlib": "^2.2",
41+
"zendframework/zend-stdlib": "^2.2 || ^3.0",
4242
"phpoffice/common": "^0.2"
4343
},
4444
"require-dev": {

docs/ISSUE_TEMPLATE.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Issue tracker is **ONLY** used for reporting bugs. NO NEW FEATURE ACCEPTED! Use [stackoverflow](https://stackoverflow.com/questions/tagged/phpword) for supporting issues.
2+
3+
# Expected Behavior
4+
5+
Please describe the behavior you are expecting.
6+
7+
# Current Behavior
8+
9+
What is the current behavior?
10+
11+
# Failure Information
12+
13+
Please help provide information about the failure.
14+
15+
## How to Reproduce
16+
17+
Please provide a code sample that reproduces the issue.
18+
19+
```php
20+
$phpWord = new \PhpOffice\PhpWord\PhpWord();
21+
$section = $phpWord->addSection();
22+
$section->...
23+
```
24+
25+
## Context
26+
27+
* PHP version:
28+
* PHPWord version: 0.14

docs/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Description
2+
3+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
4+
5+
Fixes # (issue)
6+
7+
# Checklist:
8+
9+
- [ ] I have commented my code, particularly in hard-to-understand areas
10+
- [ ] I have run phpunit, phpcs, php-cs-fixer, phpmd
11+
- [ ] The new code is covered by unit tests
12+
- [ ] I have update the documentation to describe the changes

docs/elements.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ Your TOC can only be generated if you have add at least one title (See "Titles")
297297

298298
Options for ``$tocStyle``:
299299

300-
- ``tabLeader``. Fill type between the title text and the page number. Use the defined constants in PHPWord\\Style\\TOC.
300+
- ``tabLeader``. Fill type between the title text and the page number. Use the defined constants in ``\PhpOffice\PhpWord\Style\TOC``.
301301
- ``tabPos``. The position of the tab where the page number appears in twips.
302302
- ``indent``. The indent factor of the titles in twips.
303303

docs/general.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,3 +282,12 @@ The document (or parts of it) can be password protected.
282282
$documentProtection = $phpWord->getSettings()->getDocumentProtection();
283283
$documentProtection->setEditing(DocProtect::READ_ONLY);
284284
$documentProtection->setPassword('myPassword');
285+
286+
Automatically Recalculate Fields on Open
287+
----------------------------------------
288+
289+
To force an update of the fields present in the document, set updateFields to true
290+
291+
.. code-block:: php
292+
293+
$phpWord->getSettings()->setUpdateFields(true);

phpstan.neon

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
includes:
2+
- vendor/phpstan/phpstan/conf/config.level1.neon
3+
parameters:
4+
memory-limit: 200000
5+
autoload_directories:
6+
- tests
7+
autoload_files:
8+
- tests/bootstrap.php
9+
excludes_analyse:
10+
- */pclzip.lib.php
11+
- src/PhpWord/Shared/OLERead.php
12+
- src/PhpWord/Reader/MsDoc.php
13+
- src/PhpWord/Writer/PDF/MPDF.php

run_tests.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
#!/bin/bash
2+
echo "Running composer update"
3+
composer update
24

35
## PHP_CodeSniffer
6+
echo "Running CodeSniffer"
47
./vendor/bin/phpcs src/ tests/ --standard=PSR2 -n --ignore=src/PhpWord/Shared/PCLZip
58

69
## PHP-CS-Fixer
10+
echo "Running CS Fixer"
711
./vendor/bin/php-cs-fixer fix --diff --verbose --dry-run
812

913
## PHP Mess Detector
14+
echo "Running Mess Detector"
1015
./vendor/bin/phpmd src/,tests/ text ./phpmd.xml.dist --exclude pclzip.lib.php
1116

1217
## PHPUnit
13-
./vendor/bin/phpunit -c ./ --no-coverage
18+
echo "Running PHPUnit"
19+
./vendor/bin/phpunit -c ./
1420

samples/Sample_17_TitleTOC.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// New Word document
55
echo date('H:i:s'), ' Create new PhpWord object', EOL;
66
$phpWord = new \PhpOffice\PhpWord\PhpWord();
7+
$phpWord->getSettings()->setUpdateFields(true);
78

89
// New section
910
$section = $phpWord->addSection();

0 commit comments

Comments
 (0)