Skip to content

Commit d1ce0c3

Browse files
committed
Merge remote-tracking branch 'PHPOffice/develop' into develop
2 parents 3f8892e + c5d0f71 commit d1ce0c3

File tree

430 files changed

+7780
-1296
lines changed

Some content is hidden

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

430 files changed

+7780
-1296
lines changed

.scrutinizer.yml

Lines changed: 7 additions & 2 deletions
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,8 +19,8 @@ tools:
1419
config:
1520
ruleset: phpmd.xml.dist
1621
external_code_coverage:
17-
enabled: true
18-
timeout: 900
22+
enabled: false
23+
timeout: 1200
1924
php_cpd: true
2025
# php_sim: # Temporarily disabled to allow focus on things other than duplicates
2126
# min_mass: 40

.travis.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,15 @@ php:
99
- 5.6
1010
- 7.0
1111
- 7.1
12+
- 7.2
1213

1314
matrix:
1415
include:
1516
- php: 5.6
1617
env: COVERAGE=1
17-
allow_failures:
18-
- php: 7.0
19-
- php: 7.1
2018

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

@@ -38,7 +35,7 @@ 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
4340
- mkdir -p build/docs
4441
- mkdir -p build/coverage
@@ -57,8 +54,6 @@ script:
5754
## PHPDocumentor
5855
- 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

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

CHANGELOG.md

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,50 @@ 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.15.0 (?? ??? 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+
27+
### Fixed
28+
- Fix reading of docx default style - @troosan #1238
29+
- Fix the size unit of when parsing html images - @troosan #1254
30+
- Fixed HTML parsing of nested lists - @troosan #1265
31+
- Save PNG alpha information when using remote images. @samsullivan #779
32+
- Fix parsing of `<w:br/>` tag. @troosan #1274
33+
- Bookmark are not writton as internal link in html writer @troosan #1263
34+
- It should be possible to add a Footnote in a ListItemRun @troosan #1287 #1287
35+
- Fix colspan and rowspan for tables in HTML Writer @mattbolt #1292
36+
- Fix parsing of Heading and Title formating @troosan @gthomas2 #465
37+
- Fix Dateformat typo, fix hours casing, add Month-Day-Year formats @ComputerTinker #591
38+
39+
### Changed
40+
- Remove zend-stdlib dependency @Trainmaster #1284
41+
- The default unit for `\PhpOffice\PhpWord\Style\Image` changed from `px` to `pt`.
42+
43+
### Miscelaneous
44+
- Drop GitHub pages, switch to coveralls for code coverage analysis @czosel #1360
45+
46+
v0.14.0 (29 Dec 2017)
747
----------------------
848
This release fixes several bugs and adds some new features.
9-
This is the last version to support PHP 5.3
49+
This version brings compatibility with PHP 7.0 & 7.1
1050

1151
### Added
1252
- Possibility to control the footnote numbering - @troosan #1068
@@ -17,11 +57,21 @@ This is the last version to support PHP 5.3
1757
- Possiblity to set default document language as well as changing the language for each text element - @troosan #1108
1858
- Support for Comments - @troosan #1067
1959
- Support for paragraph textAlignment - @troosan #1165
60+
- Add support for HTML underline tag <u> in addHtml - @zNightFalLz #1186
61+
- Add support for HTML <br> in addHtml - @anrikun @troosan #659
62+
- Allow to change cell width unit - guillaume-ro-fr #986
63+
- Allow to change the line height rule @troosan
64+
- Implement PageBreak for odt writer @cookiekiller #863 #824
65+
- Allow to force an update of all fields on opening a document - @troosan #951
66+
- Allow adding a CheckBox in a TextRun - @irond #727
67+
- Add support for HTML img tag - @srggroup #934
68+
- Add support for password protection for docx - @mariahaubner #1019
2069

2170
### Fixed
2271
- Loosen dependency to Zend
2372
- Images are not being printed when generating PDF - @hubertinio #1074 #431
2473
- Fixed some PHP 7 warnings - @ likeuntomurphy #927
74+
- Fixed PHP 7.2 compatibility (renamed `Object` class names to `ObjectElement`) - @SailorMax #1185
2575
- Fixed Word 97 reader - @alsofronie @Benpxpx @mario-rivera #912 #920 #892
2676
- Fixed image loading over https - @troosan #988
2777
- Impossibility to set different even and odd page headers - @troosan #981
@@ -34,6 +84,15 @@ This is the last version to support PHP 5.3
3484
- Fixed read docx error when document contains image from remote url - @FBnil #1173 #1176
3585
- Padded the $args array to remove error - @kaigoh #1150, @reformed #870
3686
- Fix incorrect image size between windows and mac - @bskrtich #874
87+
- Fix adding HTML table to document - @mogilvie @arivanbastos #324
88+
- Fix parsing on/off values (w:val="true|false|1|0|on|off") - @troosan #1221 #1219
89+
- Fix error on Empty Dropdown Entry - @ComputerTinker #592
90+
91+
### Deprecated
92+
- PhpWord->getProtection(), get it from the settings instead PhpWord->getSettings()->getDocumentProtection();
93+
94+
95+
3796
v0.13.0 (31 July 2016)
3897
-------------------
3998
This release brings several improvements in `TemplateProcessor`, automatic output escaping feature for OOXML, ODF, HTML, and RTF (turned off, by default).
@@ -53,7 +112,7 @@ Manual installation feature has been dropped since the release. Please, use [Com
53112
- Improved error message for the case when `autoload.php` is not found. - @RomanSyroeshko #371
54113
- Renamed the `align` option of `NumberingLevel`, `Frame`, `Table`, and `Paragraph` styles into `alignment`. - @RomanSyroeshko
55114
- Improved performance of `TemplateProcessor::setValue()`. - @kazitanvirahsan #614, #617
56-
- Fixed some HTML tags not rendering any output (p, header & table) - #257, #324 - @twmobius and @garethellis
115+
- Fixed some HTML tags not rendering any output (p, header & table) - #257, #324 - @twmobius and @garethellis
57116

58117
### Deprecated
59118
- `getAlign` and `setAlign` methods of `NumberingLevel`, `Frame`, `Table`, and `Paragraph` styles.
@@ -431,4 +490,4 @@ This is the first release after a long development hiatus in [CodePlex](https://
431490
- Basic CI with Travis - @Progi1984
432491
- Added PHPWord_Exception and exception when could not copy the template - @Progi1984
433492
- IMPROVED: Moved examples out of Classes directory - @Progi1984
434-
- IMPROVED: Advanced string replace in setValue for Template - @Esmeraldo [#49](http://phpword.codeplex.com/workitem/49)
493+
- IMPROVED: Advanced string replace in setValue for Template - @Esmeraldo [#49](http://phpword.codeplex.com/workitem/49)

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
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

Lines changed: 15 additions & 7 deletions
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

@@ -22,7 +22,6 @@ Read more about PHPWord:
2222
- [Getting started](#getting-started)
2323
- [Contributing](#contributing)
2424
- [Developers' Documentation](http://phpword.readthedocs.org/)
25-
- [API Documentation](http://phpoffice.github.io/PHPWord/docs/master/)
2625

2726
## Features
2827

@@ -67,14 +66,22 @@ PHPWord requires the following:
6766
## Installation
6867

6968
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.
69+
To [add a dependency](https://getcomposer.org/doc/04-schema.md#package-links>) to PHPWord in your project, either
7170

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

80+
You can of course also manually edit your composer.json file
7481
```json
7582
{
7683
"require": {
77-
"phpoffice/phpword": "v0.13.*"
84+
"phpoffice/phpword": "v0.14.*"
7885
}
7986
}
8087
```
@@ -153,7 +160,8 @@ $objWriter->save('helloWorld.html');
153160
/* Note: we skip PDF, because "HTML-to-PDF" approach is used to create PDF documents. */
154161
```
155162

156-
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.
157165

158166
## Contributing
159167

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

bootstrap.php

Lines changed: 1 addition & 1 deletion
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

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,46 @@
3434
"name": "Antoine de Troostembergh"
3535
}
3636
],
37+
"scripts": {
38+
"test": [
39+
"phpunit --color=always"
40+
],
41+
"test-no-coverage": [
42+
"phpunit --color=always --no-coverage"
43+
],
44+
"check": [
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"
49+
],
50+
"fix": [
51+
"php-cs-fixer fix --ansi"
52+
]
53+
},
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+
},
3760
"require": {
38-
"php": ">=5.3.3",
61+
"php": "^5.3.3 || ^7.0",
3962
"ext-xml": "*",
4063
"zendframework/zend-escaper": "^2.2",
41-
"zendframework/zend-stdlib": "^2.2",
4264
"phpoffice/common": "^0.2"
4365
},
4466
"require-dev": {
45-
"phpunit/phpunit": "^4.8.36",
67+
"phpunit/phpunit": "^4.8.36 || ^5.0",
4668
"phpdocumentor/phpdocumentor":"2.*",
47-
"twig/twig":"1.27",
4869
"squizlabs/php_codesniffer": "^2.7",
4970
"friendsofphp/php-cs-fixer": "^2.0",
5071
"phpmd/phpmd": "2.*",
51-
"phploc/phploc": "2.*",
72+
"phploc/phploc": "2.* || 3.* || 4.*",
5273
"dompdf/dompdf":"0.8.*",
5374
"tecnickcom/tcpdf": "6.*",
54-
"mpdf/mpdf": "5.*"
75+
"mpdf/mpdf": "5.* || 6.* || 7.*",
76+
"php-coveralls/php-coveralls": "1.1.0 || ^2.0"
5577
},
5678
"suggest": {
5779
"ext-zip": "Allows writing OOXML and ODF",
@@ -64,5 +86,10 @@
6486
"psr-4": {
6587
"PhpOffice\\PhpWord\\": "src/PhpWord"
6688
}
89+
},
90+
"extra": {
91+
"branch-alias": {
92+
"dev-develop": "0.15-dev"
93+
}
6794
}
6895
}

docs/ISSUE_TEMPLATE.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
This is:
2+
3+
- [ ] a bug report
4+
- [ ] a feature request
5+
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpword)
6+
7+
### Expected Behavior
8+
9+
Please describe the behavior you are expecting.
10+
11+
### Current Behavior
12+
13+
What is the current behavior?
14+
15+
### Failure Information
16+
17+
Please help provide information about the failure.
18+
19+
### How to Reproduce
20+
21+
Please provide a code sample that reproduces the issue.
22+
23+
```php
24+
<?php
25+
require __DIR__ . '/vendor/autoload.php';
26+
27+
$phpWord = new \PhpOffice\PhpWord\PhpWord();
28+
$section = $phpWord->addSection();
29+
$section->...
30+
```
31+
32+
### Context
33+
34+
* PHP version:
35+
* PHPWord version: 0.14

0 commit comments

Comments
 (0)