Skip to content

Commit 8931ab1

Browse files
authored
Merge branch 'develop' into html_writer_auto_invert_text_color
2 parents 57ae700 + 81af913 commit 8931ab1

File tree

129 files changed

+3578
-661
lines changed

Some content is hidden

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

129 files changed

+3578
-661
lines changed

.gitattributes

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

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ composer.phar
1313
vendor
1414
/report
1515
/build
16-
/samples/resources
1716
/samples/results
1817
/.settings
1918
phpword.ini
2019
/.buildpath
20+
/.scannerwork
2121
/.project
2222
/nbproject
2323
/.php_cs.cache

.travis.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,20 @@ php:
1010
- 7.0
1111
- 7.1
1212
- 7.2
13+
- 7.3
1314

1415
matrix:
1516
include:
16-
- php: 5.6
17+
- php: 7.0
1718
env: COVERAGE=1
19+
- php: 5.3
20+
env: COMPOSER_MEMORY_LIMIT=2G
21+
- php: 7.3
22+
env: DEPENDENCIES="--ignore-platform-reqs"
23+
exclude:
24+
- php: 5.3
25+
- php: 7.0
26+
- php: 7.3
1827

1928
cache:
2029
directories:
@@ -32,12 +41,12 @@ before_install:
3241

3342
before_script:
3443
## Deactivate xdebug if we don't do code coverage
35-
- if [ -z "$COVERAGE" ]; then phpenv config-rm xdebug.ini ; fi
44+
- if [ -z "$COVERAGE" ]; then phpenv config-rm xdebug.ini || echo "xdebug not available" ; fi
3645
## Composer
3746
- composer self-update
38-
- travis_wait composer install --prefer-source
47+
- travis_wait composer install --prefer-source $(if [ -n "$DEPENDENCIES" ]; then echo $DEPENDENCIES; fi)
3948
## PHPDocumentor
40-
- mkdir -p build/docs
49+
##- mkdir -p build/docs
4150
- mkdir -p build/coverage
4251

4352
script:
@@ -52,7 +61,7 @@ script:
5261
## PHPLOC
5362
- if [ -z "$COVERAGE" ]; then ./vendor/bin/phploc src/ ; fi
5463
## PHPDocumentor
55-
- if [ -z "$COVERAGE" ]; then ./vendor/bin/phpdoc -q -d ./src -t ./build/docs --ignore "*/src/PhpWord/Shared/*/*" --template="responsive-twig" ; fi
64+
##- if [ -z "$COVERAGE" ]; then ./vendor/bin/phpdoc -q -d ./src -t ./build/docs --ignore "*/src/PhpWord/Shared/*/*" --template="responsive-twig" ; fi
5665

5766
after_success:
5867
## Coveralls

CHANGELOG.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,47 @@ 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 (?? ??? 2018)
6+
v0.17.0 (?? ??? 2019)
7+
----------------------
8+
### Added
9+
- Add RightToLeft table presentation. @troosan #1550
10+
- Set complex type in template @troosan #1565
11+
- Add support for page vertical alignment. @troosan #672 #1569
12+
13+
### Fixed
14+
- Fix HTML border-color parsing. @troosan #1551 #1570
15+
16+
### Miscelaneous
17+
- Use embedded http server to test loading of remote images @troosan #
18+
19+
v0.16.0 (30 dec 2018)
20+
----------------------
21+
### Added
22+
- Add getVariableCount method in TemplateProcessor. @nicoder #1272
23+
- Add setting Chart Title and Legend visibility @Tom-Magill #1433
24+
- Add ability to pass a Style object in Section constructor @ndench #1416
25+
- Add support for hidden text @Alexmg86 #1527
26+
- Add support for setting images in TemplateProcessor @SailorMax #1170
27+
- Add "Plain Text" type to SDT (Structured Document Tags) @morrisdj #1541
28+
- Added possibility to index variables inside cloned block in TemplateProcessor @JPBetley #817
29+
- Added possibility to replace variables inside cloned block with values in TemplateProcessor @DIDoS #1392
30+
31+
### Fixed
32+
- Fix regex in `cloneBlock` function @nicoder #1269
33+
- HTML Title Writer loses text when Title contains a TextRun instead a string. @begnini #1436
34+
- Fix regex in fixBrokenMacros, make it less greedy @MuriloSo @brainwood @yurii-sio2 #1502 #1345
35+
- 240 twips are being added to line spacing, should not happen when using lineRule fixed @troosan #1509 #1505
36+
- Adding table layout to the generated HTML @aarangara #1441
37+
- Fix loading of Sharepoint document @Garrcomm #1498
38+
- RTF writer: Round getPageSizeW and getPageSizeH to avoid decimals @Patrick64 #1493
39+
- Fix parsing of Office 365 documents @Timanx #1485
40+
- For RTF writers, sizes should should never have decimals @Samuel-BF #1536
41+
- Style Name Parsing fails if document generated by a non-english word version @begnini #1434
42+
43+
### Miscelaneous
44+
- Get rid of duplicated code in TemplateProcessor @abcdmitry #1161
45+
46+
v0.15.0 (14 Jul 2018)
747
----------------------
848
### Added
949
- Parsing of `align` HTML attribute - @troosan #1231
@@ -23,6 +63,9 @@ v0.15.0 (?? ??? 2018)
2363
- Add support for table indent (tblInd) @Trainmaster #1343
2464
- Added parsing of internal links in HTML reader @lalop #1336
2565
- Several improvements to charts @JAEK-S #1332
66+
- Add parsing of html image in base64 format @jgpATs2w #1382
67+
- Added Support for Indentation & Tabs on RTF Writer. @smaug1985 #1405
68+
- Allows decimal numbers in HTML line-height style @jgpATs2w #1413
2669

2770
### Fixed
2871
- Fix reading of docx default style - @troosan #1238
@@ -35,6 +78,9 @@ v0.15.0 (?? ??? 2018)
3578
- Fix colspan and rowspan for tables in HTML Writer @mattbolt #1292
3679
- Fix parsing of Heading and Title formating @troosan @gthomas2 #465
3780
- Fix Dateformat typo, fix hours casing, add Month-Day-Year formats @ComputerTinker #591
81+
- Support reading of w:drawing for documents produced by word 2011+ @gthomas2 #464 #1324
82+
- Fix missing column width in ODText writer @potofcoffee #413
83+
- Disable entity loader before parsing XML to avoid XXE injection @Tom4t0 #1427
3884

3985
### Changed
4086
- Remove zend-stdlib dependency @Trainmaster #1284

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 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.
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.readthedocs.io) you can find documentation on how to write tests with PHPUnit, 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: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
# ![PHPWord](https://rawgit.com/PHPOffice/PHPWord/develop/docs/images/phpword.svg "PHPWord")
22

3+
Master:
34
[![Latest Stable Version](https://poser.pugx.org/phpoffice/phpword/v/stable.png)](https://packagist.org/packages/phpoffice/phpword)
45
[![Build Status](https://travis-ci.org/PHPOffice/PHPWord.svg?branch=master)](https://travis-ci.org/PHPOffice/PHPWord)
5-
[![Code Quality](https://scrutinizer-ci.com/g/PHPOffice/PHPWord/badges/quality-score.png?s=b5997ce59ac2816b4514f3a38de9900f6d492c1d)](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)
6+
[![Code Quality](https://scrutinizer-ci.com/g/PHPOffice/PHPWord/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/PHPOffice/PHPWord/)
7+
[![Coverage Status](https://coveralls.io/repos/github/PHPOffice/PHPWord/badge.svg?branch=master)](https://coveralls.io/github/PHPOffice/PHPWord?branch=master)
78
[![Total Downloads](https://poser.pugx.org/phpoffice/phpword/downloads.png)](https://packagist.org/packages/phpoffice/phpword)
89
[![License](https://poser.pugx.org/phpoffice/phpword/license.png)](https://packagist.org/packages/phpoffice/phpword)
910
[![Join the chat at https://gitter.im/PHPOffice/PHPWord](https://img.shields.io/badge/GITTER-join%20chat-green.svg)](https://gitter.im/PHPOffice/PHPWord)
1011

12+
Develop:
13+
[![Latest Development Version](https://img.shields.io/badge/unstable-dev--develop-orange.svg)](https://packagist.org/packages/phpoffice/phpword#dev-develop)
14+
[![Build Status](https://travis-ci.org/PHPOffice/PHPWord.svg?branch=develop)](https://travis-ci.org/PHPOffice/PHPWord/branches)
15+
[![Code Quality](https://scrutinizer-ci.com/g/PHPOffice/PHPWord/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/PHPOffice/PHPWord/?branch=develop)
16+
[![Coverage Status](https://coveralls.io/repos/github/PHPOffice/PHPWord/badge.svg?branch=develop)](https://coveralls.io/github/PHPOffice/PHPWord?branch=develop)
17+
1118
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.
1219

1320
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/).
@@ -81,7 +88,7 @@ You can of course also manually edit your composer.json file
8188
```json
8289
{
8390
"require": {
84-
"phpoffice/phpword": "v0.14.*"
91+
"phpoffice/phpword": "v0.16.*"
8592
}
8693
}
8794
```
@@ -161,7 +168,7 @@ $objWriter->save('helloWorld.html');
161168
```
162169

163170
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.
171+
You can also read the [Developers' Documentation](http://phpword.readthedocs.org/) for more detail.
165172

166173
## Contributing
167174

composer.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"php-cs-fixer fix --ansi --dry-run --diff",
4646
"phpcs --report-width=200 --report-summary --report-full samples/ src/ tests/ --ignore=src/PhpWord/Shared/PCLZip --standard=PSR2 -n",
4747
"phpmd src/,tests/ text ./phpmd.xml.dist --exclude pclzip.lib.php",
48-
"@test"
48+
"@test-no-coverage"
4949
],
5050
"fix": [
5151
"php-cs-fixer fix --ansi"
@@ -61,18 +61,19 @@
6161
"php": "^5.3.3 || ^7.0",
6262
"ext-xml": "*",
6363
"zendframework/zend-escaper": "^2.2",
64-
"phpoffice/common": "^0.2"
64+
"phpoffice/common": "^0.2.9"
6565
},
6666
"require-dev": {
67-
"phpunit/phpunit": "^4.8.36 || ^5.0",
68-
"phpdocumentor/phpdocumentor":"2.*",
69-
"squizlabs/php_codesniffer": "^2.7",
70-
"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",
7172
"phpmd/phpmd": "2.*",
7273
"phploc/phploc": "2.* || 3.* || 4.*",
7374
"dompdf/dompdf":"0.8.*",
7475
"tecnickcom/tcpdf": "6.*",
75-
"mpdf/mpdf": "5.* || 6.* || 7.*",
76+
"mpdf/mpdf": "5.7.4 || 6.* || 7.*",
7677
"php-coveralls/php-coveralls": "1.1.0 || ^2.0"
7778
},
7879
"suggest": {
@@ -89,7 +90,7 @@
8990
},
9091
"extra": {
9192
"branch-alias": {
92-
"dev-develop": "0.15-dev"
93+
"dev-develop": "0.17-dev"
9394
}
9495
}
9596
}

docs/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ Fixes # (issue)
88

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

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
# built documents.
4949
#
5050
# The short X.Y version.
51-
version = '0.14.0'
51+
version = '0.16.0'
5252
# The full version, including alpha/beta/rc tags.
5353
release = version
5454

docs/containers.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ You can pass an optional parameter to specify where the header/footer should be
104104
- ``Footer::FIRST`` each first page of the section
105105
- ``Footer::EVEN`` each even page of the section. Will only be applied if the evenAndOddHeaders is set to true in phpWord->settings
106106

107+
To change the evenAndOddHeaders use the ``getSettings`` method to return the Settings object, and then call the ``setEvenAndOddHeaders`` method:
108+
109+
.. code-block:: php
110+
111+
$phpWord->getSettings()->setEvenAndOddHeaders(true);
112+
107113
Footers
108114
-------
109115

docs/elements.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Legend:
6161
Texts
6262
-----
6363

64-
Text can be added by using ``addText`` and ``addTextRun`` method.
64+
Text can be added by using ``addText`` and ``addTextRun`` methods.
6565
``addText`` is used for creating simple paragraphs that only contain texts with the same style.
6666
``addTextRun`` is used for creating complex paragraphs that contain text with different style (some bold, other
6767
italics, etc) or other elements, e.g. images or links. The syntaxes are as follow:
@@ -155,13 +155,18 @@ method or using the ``pageBreakBefore`` style of paragraph.
155155
Lists
156156
-----
157157

158-
To add a list item use the function ``addListItem``.
158+
Lists can be added by using ``addListItem`` and ``addListItemRun`` methods.
159+
``addListItem`` is used for creating lists that only contain plain text.
160+
``addListItemRun`` is used for creating complex list items that contains texts
161+
with different style (some bold, other italics, etc) or other elements, e.g.
162+
images or links. The syntaxes are as follow:
159163

160164
Basic usage:
161165

162166
.. code-block:: php
163167
164168
$section->addListItem($text, [$depth], [$fontStyle], [$listStyle], [$paragraphStyle]);
169+
$listItemRun = $section->addListItemRun([$depth], [$listStyle], [$paragraphStyle])
165170
166171
Parameters:
167172

@@ -172,6 +177,8 @@ Parameters:
172177
TYPE\_ALPHANUM, TYPE\_BULLET\_FILLED, etc. See list of constants in PHPWord\\Style\\ListItem.
173178
- ``$paragraphStyle``. See :ref:`paragraph-style`.
174179

180+
See ``Sample_09_Tables.php`` for more code sample.
181+
175182
Advanced usage:
176183

177184
You can also create your own numbering style by changing the ``$listStyle`` parameter with the name of your numbering style.

0 commit comments

Comments
 (0)