Skip to content

Commit dfa2f36

Browse files
authored
Merge pull request #1429 from PHPOffice/develop
Merge 0.15 to master
2 parents bdca366 + 4c9e750 commit dfa2f36

File tree

434 files changed

+6355
-1367
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

434 files changed

+6355
-1367
lines changed

.gitattributes

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# build config
2+
/.scrutinizer.yml export-ignore
3+
/.travis.yml export-ignore
4+
/php_cs.dist export-ignore
5+
/phpmd.xml.dist export-ignore
6+
/phpstan.neon export-ignore
7+
8+
/composer.lock export-ignore
9+
10+
# git files
11+
/.gitignore export-ignore
12+
/.gitattributes export-ignore
13+
14+
# project directories
15+
/build export-ignore
16+
/docs export-ignore
17+
/samples export-ignore
18+
19+
# tests
20+
/phpunit.xml.dist export-ignore
21+
/tests export-ignore

.scrutinizer.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
build:
2+
nodes:
3+
analysis:
4+
tests:
5+
override: [php-scrutinizer-run]
16
filter:
27
excluded_paths: [ 'vendor/*', 'tests/*', 'samples/*', 'src/PhpWord/Shared/PCLZip/*' ]
38

@@ -14,7 +19,7 @@ tools:
1419
config:
1520
ruleset: phpmd.xml.dist
1621
external_code_coverage:
17-
enabled: true
22+
enabled: false
1823
timeout: 1200
1924
php_cpd: true
2025
# php_sim: # Temporarily disabled to allow focus on things other than duplicates

.travis.yml

+7-12
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,11 @@ php:
1313

1414
matrix:
1515
include:
16-
- php: 5.6
16+
- php: 7.0
1717
env: COVERAGE=1
18-
allow_failures:
19-
- php: 7.2
2018

2119
cache:
2220
directories:
23-
- vendor
2421
- $HOME/.composer/cache
2522
- .php-cs.cache
2623

@@ -38,9 +35,9 @@ before_script:
3835
- if [ -z "$COVERAGE" ]; then phpenv config-rm xdebug.ini ; fi
3936
## Composer
4037
- composer self-update
41-
- composer install --prefer-source
38+
- travis_wait composer install --prefer-source
4239
## PHPDocumentor
43-
- mkdir -p build/docs
40+
##- mkdir -p build/docs
4441
- mkdir -p build/coverage
4542

4643
script:
@@ -55,10 +52,8 @@ script:
5552
## PHPLOC
5653
- if [ -z "$COVERAGE" ]; then ./vendor/bin/phploc src/ ; fi
5754
## PHPDocumentor
58-
- if [ -z "$COVERAGE" ]; then ./vendor/bin/phpdoc -q -d ./src -t ./build/docs --ignore "*/src/PhpWord/Shared/*/*" --template="responsive-twig" ; fi
55+
##- if [ -z "$COVERAGE" ]; then ./vendor/bin/phpdoc -q -d ./src -t ./build/docs --ignore "*/src/PhpWord/Shared/*/*" --template="responsive-twig" ; fi
5956

60-
after_script:
61-
## PHPDocumentor
62-
- bash .travis_shell_after_success.sh
63-
## Scrutinizer
64-
- if [ -n "$COVERAGE" ]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml ; fi
57+
after_success:
58+
## Coveralls
59+
- if [ -n "$COVERAGE" ]; then travis_retry php vendor/bin/php-coveralls -v ; fi

.travis_shell_after_success.sh

-39
This file was deleted.

CHANGELOG.md

+52-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,52 @@ 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.15.0 (14 Jul 2018)
7+
----------------------
8+
### Added
9+
- Parsing of `align` HTML attribute - @troosan #1231
10+
- Parse formatting inside HTML lists - @troosan @samimussbach #1239 #945 #1215 #508
11+
- Parsing of CSS `direction` instruction, HTML `lang` attribute, formatting inside table cell - @troosan #1273 #1252 #1254
12+
- Add support for Track changes @Cip @troosan #354 #1262
13+
- Add support for fixed Table Layout @aoloe @ekopach @troosan #841 #1276
14+
- Add support for Cell Spacing @dox07 @troosan #1040
15+
- Add parsing of formatting inside lists @atomicalnet @troosan #594
16+
- Added support for Vertically Raised or Lowered Text (w:position) @anrikun @troosan #640
17+
- Add support for MACROBUTTON field @phryneas @troosan #1021
18+
- Add support for Hyphenation @Trainmaster #1282 (Document: `autoHyphenation`, `consecutiveHyphenLimit`, `hyphenationZone`, `doNotHyphenateCaps`, Paragraph: `suppressAutoHyphens`)
19+
- Added support for Floating Table Positioning (tblpPr) @anrikun #639
20+
- Added support for Image text wrapping distance @troosan #1310
21+
- Added parsing of CSS line-height and text-indent in HTML reader @troosan #1316
22+
- Added the ability to enable gridlines and axislabels on charts @FrankMeyer #576
23+
- Add support for table indent (tblInd) @Trainmaster #1343
24+
- Added parsing of internal links in HTML reader @lalop #1336
25+
- Several improvements to charts @JAEK-S #1332
26+
- Add parsing of html image in base64 format @jgpATs2w #1382
27+
- Added Support for Indentation & Tabs on RTF Writer. @smaug1985 #1405
28+
- Allows decimal numbers in HTML line-height style @jgpATs2w #1413
29+
30+
### Fixed
31+
- Fix reading of docx default style - @troosan #1238
32+
- Fix the size unit of when parsing html images - @troosan #1254
33+
- Fixed HTML parsing of nested lists - @troosan #1265
34+
- Save PNG alpha information when using remote images. @samsullivan #779
35+
- Fix parsing of `<w:br/>` tag. @troosan #1274
36+
- Bookmark are not writton as internal link in html writer @troosan #1263
37+
- It should be possible to add a Footnote in a ListItemRun @troosan #1287 #1287
38+
- Fix colspan and rowspan for tables in HTML Writer @mattbolt #1292
39+
- Fix parsing of Heading and Title formating @troosan @gthomas2 #465
40+
- Fix Dateformat typo, fix hours casing, add Month-Day-Year formats @ComputerTinker #591
41+
- Support reading of w:drawing for documents produced by word 2011+ @gthomas2 #464 #1324
42+
- Fix missing column width in ODText writer @potofcoffee #413
43+
- Disable entity loader before parsing XML to avoid XXE injection @Tom4t0 #1427
44+
45+
### Changed
46+
- Remove zend-stdlib dependency @Trainmaster #1284
47+
- The default unit for `\PhpOffice\PhpWord\Style\Image` changed from `px` to `pt`.
48+
49+
### Miscelaneous
50+
- Drop GitHub pages, switch to coveralls for code coverage analysis @czosel #1360
51+
652
v0.14.0 (29 Dec 2017)
753
----------------------
854
This release fixes several bugs and adds some new features.
@@ -30,7 +76,8 @@ This version brings compatibility with PHP 7.0 & 7.1
3076
### Fixed
3177
- Loosen dependency to Zend
3278
- Images are not being printed when generating PDF - @hubertinio #1074 #431
33-
- Fixed some PHP 7 warnings - @likeuntomurphy #927
79+
- Fixed some PHP 7 warnings - @ likeuntomurphy #927
80+
- Fixed PHP 7.2 compatibility (renamed `Object` class names to `ObjectElement`) - @SailorMax #1185
3481
- Fixed Word 97 reader - @alsofronie @Benpxpx @mario-rivera #912 #920 #892
3582
- Fixed image loading over https - @troosan #988
3683
- Impossibility to set different even and odd page headers - @troosan #981
@@ -50,6 +97,8 @@ This version brings compatibility with PHP 7.0 & 7.1
5097
### Deprecated
5198
- PhpWord->getProtection(), get it from the settings instead PhpWord->getSettings()->getDocumentProtection();
5299

100+
101+
53102
v0.13.0 (31 July 2016)
54103
-------------------
55104
This release brings several improvements in `TemplateProcessor`, automatic output escaping feature for OOXML, ODF, HTML, and RTF (turned off, by default).
@@ -69,7 +118,7 @@ Manual installation feature has been dropped since the release. Please, use [Com
69118
- Improved error message for the case when `autoload.php` is not found. - @RomanSyroeshko #371
70119
- Renamed the `align` option of `NumberingLevel`, `Frame`, `Table`, and `Paragraph` styles into `alignment`. - @RomanSyroeshko
71120
- Improved performance of `TemplateProcessor::setValue()`. - @kazitanvirahsan #614, #617
72-
- Fixed some HTML tags not rendering any output (p, header & table) - #257, #324 - @twmobius and @garethellis
121+
- Fixed some HTML tags not rendering any output (p, header & table) - #257, #324 - @twmobius and @garethellis
73122

74123
### Deprecated
75124
- `getAlign` and `setAlign` methods of `NumberingLevel`, `Frame`, `Table`, and `Paragraph` styles.
@@ -447,4 +496,4 @@ This is the first release after a long development hiatus in [CodePlex](https://
447496
- Basic CI with Travis - @Progi1984
448497
- Added PHPWord_Exception and exception when could not copy the template - @Progi1984
449498
- IMPROVED: Moved examples out of Classes directory - @Progi1984
450-
- IMPROVED: Advanced string replace in setValue for Template - @Esmeraldo [#49](http://phpword.codeplex.com/workitem/49)
499+
- IMPROVED: Advanced string replace in setValue for Template - @Esmeraldo [#49](http://phpword.codeplex.com/workitem/49)

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ We want to create a high quality document writer and reader library that people
66

77
- **Be brief, but be bold**. State your issues briefly. But speak out your ideas loudly, even if you can't or don't know how to implement it right away. The world will be better with limitless innovations.
88
- **Follow PHP-FIG standards**. We follow PHP Standards Recommendations (PSRs) by [PHP Framework Interoperability Group](http://www.php-fig.org/). If you're not familiar with these standards, please, [familiarize yourself now](https://github.com/php-fig/fig-standards). Also, please, use [PHPCodeSniffer](http://pear.php.net/package/PHP_CodeSniffer/) to validate your code against PSRs.
9-
- **Test your code**. Nobody else knows your code better than you. So, it's completely yours mission to test the changes you made before pull request submission. We use [PHPUnit](https://phpunit.de/) for our testing purposes and recommend you using this tool too. [Here](https://phpunit.de/presentations.html) you can find PHPUnit best practices and additional information on effective unit testing, which helps us making PHPWord better day to day. Do not hesitate to smoke it carefully. It's a great investment in quality of your work, and it saves you years of life.
9+
- **Test your code**. Nobody else knows your code better than you. So, it's completely your mission to test the changes you made before pull request submission. We use [PHPUnit](https://phpunit.de/) for our testing purposes and recommend you using this tool too. [Here](https://phpunit.de/presentations.html) you can find PHPUnit best practices and additional information on effective unit testing, which helps us making PHPWord better day to day. Do not hesitate to smoke it carefully. It's a great investment in quality of your work, and it saves you years of life.
1010
- **Request pull in separate branch**. Do not submit your request to the master branch. But create a separate branch named specifically for the issue that you addressed. Read [GitHub manual](https://help.github.com/articles/using-pull-requests) to find out more about this. If you are new to GitHub, read [this short manual](https://help.github.com/articles/fork-a-repo) to get yourself familiar with forks and how git works in general. [This video](http://www.youtube.com/watch?v=-zvHQXnBO6c) explains how to synchronize your Github Fork with the Branch of PHPWord.
1111

1212
That's it. Thank you for your interest in PHPWord, and welcome!

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
[![Latest Stable Version](https://poser.pugx.org/phpoffice/phpword/v/stable.png)](https://packagist.org/packages/phpoffice/phpword)
44
[![Build Status](https://travis-ci.org/PHPOffice/PHPWord.svg?branch=master)](https://travis-ci.org/PHPOffice/PHPWord)
55
[![Code Quality](https://scrutinizer-ci.com/g/PHPOffice/PHPWord/badges/quality-score.png?s=b5997ce59ac2816b4514f3a38de9900f6d492c1d)](https://scrutinizer-ci.com/g/PHPOffice/PHPWord/)
6-
[![Code Coverage](https://scrutinizer-ci.com/g/PHPOffice/PHPWord/badges/coverage.png?s=742a98745725c562955440edc8d2c39d7ff5ae25)](https://scrutinizer-ci.com/g/PHPOffice/PHPWord/)
6+
[![Coverage Status](https://coveralls.io/repos/github/PHPOffice/PHPWord/badge.svg?branch=develop)](https://coveralls.io/github/PHPOffice/PHPWord?branch=develop)
77
[![Total Downloads](https://poser.pugx.org/phpoffice/phpword/downloads.png)](https://packagist.org/packages/phpoffice/phpword)
88
[![License](https://poser.pugx.org/phpoffice/phpword/license.png)](https://packagist.org/packages/phpoffice/phpword)
99
[![Join the chat at https://gitter.im/PHPOffice/PHPWord](https://img.shields.io/badge/GITTER-join%20chat-green.svg)](https://gitter.im/PHPOffice/PHPWord)
1010

1111
PHPWord is a library written in pure PHP that provides a set of classes to write to and read from different document file formats. The current version of PHPWord supports Microsoft [Office Open XML](http://en.wikipedia.org/wiki/Office_Open_XML) (OOXML or OpenXML), OASIS [Open Document Format for Office Applications](http://en.wikipedia.org/wiki/OpenDocument) (OpenDocument or ODF), [Rich Text Format](http://en.wikipedia.org/wiki/Rich_Text_Format) (RTF), HTML, and PDF.
1212

13-
PHPWord is an open source project licensed under the terms of [LGPL version 3](https://github.com/PHPOffice/PHPWord/blob/develop/COPYING.LESSER). PHPWord is aimed to be a high quality software product by incorporating [continuous integration](https://travis-ci.org/PHPOffice/PHPWord) and [unit testing](http://phpoffice.github.io/PHPWord/coverage/develop/). You can learn more about PHPWord by reading the [Developers' Documentation](http://phpword.readthedocs.org/) and the [API Documentation](http://phpoffice.github.io/PHPWord/docs/develop/).
13+
PHPWord is an open source project licensed under the terms of [LGPL version 3](https://github.com/PHPOffice/PHPWord/blob/develop/COPYING.LESSER). PHPWord is aimed to be a high quality software product by incorporating [continuous integration](https://travis-ci.org/PHPOffice/PHPWord) and [unit testing](http://phpoffice.github.io/PHPWord/coverage/develop/). You can learn more about PHPWord by reading the [Developers' Documentation](http://phpword.readthedocs.org/).
1414

1515
If you have any questions, please ask on [StackOverFlow](https://stackoverflow.com/questions/tagged/phpword)
1616

@@ -160,7 +160,8 @@ $objWriter->save('helloWorld.html');
160160
/* Note: we skip PDF, because "HTML-to-PDF" approach is used to create PDF documents. */
161161
```
162162

163-
More examples are provided in the [samples folder](samples/). You can also read the [Developers' Documentation](http://phpword.readthedocs.org/) and the [API Documentation](http://phpoffice.github.io/PHPWord/docs/master/) for more detail.
163+
More examples are provided in the [samples folder](samples/). For an easy access to those samples launch `php -S localhost:8000` in the samples directory then browse to [http://localhost:8000](http://localhost:8000) to view the samples.
164+
You can also read the [Developers' Documentation](http://phpword.readthedocs.org/) and the [API Documentation](http://phpoffice.github.io/PHPWord/docs/master/) for more detail.
164165

165166
## Contributing
166167

VERSION

-1
This file was deleted.

bootstrap.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* contributors, visit https://github.com/PHPOffice/PHPWord/contributors. test bootstrap
1212
*
1313
* @see https://github.com/PHPOffice/PHPWord
14-
* @copyright 2010-2017 PHPWord contributors
14+
* @copyright 2010-2018 PHPWord contributors
1515
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
1616
*/
1717

composer.json

+26-13
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,46 @@
3535
}
3636
],
3737
"scripts": {
38+
"test": [
39+
"phpunit --color=always"
40+
],
41+
"test-no-coverage": [
42+
"phpunit --color=always --no-coverage"
43+
],
3844
"check": [
39-
"./vendor/bin/php-cs-fixer fix --ansi --dry-run --diff",
40-
"./vendor/bin/phpcs --report-width=200 --report-summary --report-full samples/ src/ tests/ --ignore=src/PhpWord/Shared/PCLZip --standard=PSR2 -n",
41-
"./vendor/bin/phpmd src/,tests/ text ./phpmd.xml.dist --exclude pclzip.lib.php",
42-
"./vendor/bin/phpunit --color=always"
45+
"php-cs-fixer fix --ansi --dry-run --diff",
46+
"phpcs --report-width=200 --report-summary --report-full samples/ src/ tests/ --ignore=src/PhpWord/Shared/PCLZip --standard=PSR2 -n",
47+
"phpmd src/,tests/ text ./phpmd.xml.dist --exclude pclzip.lib.php",
48+
"@test"
4349
],
4450
"fix": [
45-
"./vendor/bin/php-cs-fixer fix --ansi"
51+
"php-cs-fixer fix --ansi"
4652
]
4753
},
54+
"scripts-descriptions": {
55+
"test": "Runs all unit tests",
56+
"test-no-coverage": "Runs all unit tests, without code coverage",
57+
"check": "Runs PHP CheckStyle and PHP Mess detector",
58+
"fix": "Fixes issues found by PHP-CS"
59+
},
4860
"require": {
4961
"php": "^5.3.3 || ^7.0",
5062
"ext-xml": "*",
5163
"zendframework/zend-escaper": "^2.2",
52-
"zendframework/zend-stdlib": "^2.2 || ^3.0",
53-
"phpoffice/common": "^0.2"
64+
"phpoffice/common": "^0.2.9"
5465
},
5566
"require-dev": {
56-
"phpunit/phpunit": "^4.8.36 || ^5.0",
57-
"phpdocumentor/phpdocumentor":"2.*",
58-
"squizlabs/php_codesniffer": "^2.7",
59-
"friendsofphp/php-cs-fixer": "^2.0",
67+
"ext-zip": "*",
68+
"ext-gd": "*",
69+
"phpunit/phpunit": "^4.8.36 || ^7.0",
70+
"squizlabs/php_codesniffer": "^2.9",
71+
"friendsofphp/php-cs-fixer": "^2.2",
6072
"phpmd/phpmd": "2.*",
6173
"phploc/phploc": "2.* || 3.* || 4.*",
6274
"dompdf/dompdf":"0.8.*",
6375
"tecnickcom/tcpdf": "6.*",
64-
"mpdf/mpdf": "5.* || 6.* || 7.*"
76+
"mpdf/mpdf": "5.7.4 || 6.* || 7.*",
77+
"php-coveralls/php-coveralls": "1.1.0 || ^2.0"
6578
},
6679
"suggest": {
6780
"ext-zip": "Allows writing OOXML and ODF",
@@ -77,7 +90,7 @@
7790
},
7891
"extra": {
7992
"branch-alias": {
80-
"dev-master": "0.15-dev"
93+
"dev-develop": "0.16-dev"
8194
}
8295
}
8396
}

docs/ISSUE_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is:
44
- [ ] a feature request
55
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpword)
66

7-
# Expected Behavior
7+
### Expected Behavior
88

99
Please describe the behavior you are expecting.
1010

docs/PULL_REQUEST_TEMPLATE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ Fixes # (issue)
66

77
### Checklist:
88

9-
- [ ] I have run `composer check` and no errors were reported
10-
- [ ] The new code is covered by unit tests
9+
- [ ] I have run `composer run-script check --timeout=0` and no errors were reported
10+
- [ ] The new code is covered by unit tests (check build/coverage for coverage report)
1111
- [ ] I have update the documentation to describe the changes

docs/containers.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Below are the properties of the line numbering style.
7979

8080
- ``start`` Line numbering starting value
8181
- ``increment`` Line number increments
82-
- ``distance`` Distance between text and line numbering in twip
82+
- ``distance`` Distance between text and line numbering in *twip*
8383
- ``restart`` Line numbering restart setting
8484
continuous\|newPage\|newSection
8585

0 commit comments

Comments
 (0)