Skip to content

Commit 9d3c2e8

Browse files
committed
Update changelog and documentation for PCLZip
1 parent 71b60e9 commit 9d3c2e8

File tree

3 files changed

+41
-2
lines changed

3 files changed

+41
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This is the changelog between releases of PHPWord. Releases are listed in revers
1313
- Font: Add `bgColor` to font style to define background using HEX color - @jcarignan GH-168
1414
- Table: Add `exactHeight` to row style to define whether row height should be exact or atLeast - @jcarignan GH-168
1515
- Element: New `CheckBox` element for sections and table cells - @ozilion GH-156
16+
- Settings: Ability to use PCLZip as alternative to ZipArchive - @bskrtich @ivanlanin GH-106 GH-140 GH-185
1617

1718
### Bugfixes
1819

docs/general.rst

+39-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Basic example
77
-------------
88

99
The following is a basic example of the PHPWord library. More examples
10-
are provided in the `samples folder <https://github.com/PHPOffice/PHPWord/tree/master/samples/>`__.
10+
are provided in the `samples
11+
folder <https://github.com/PHPOffice/PHPWord/tree/master/samples/>`__.
1112

1213
.. code-block:: php
1314
@@ -52,6 +53,42 @@ are provided in the `samples folder <https://github.com/PHPOffice/PHPWord/tree/m
5253
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'RTF');
5354
$objWriter->save('helloWorld.rtf');
5455
56+
Settings
57+
--------
58+
59+
The ``PhpOffice\PhpWord\Settings`` class provides some options that will
60+
affect the behavior of PHPWord. Below are the options.
61+
62+
XML Writer compatibility
63+
~~~~~~~~~~~~~~~~~~~~~~~~
64+
65+
This option sets
66+
```XMLWriter::setIndent`` <http://www.php.net/manual/en/function.xmlwriter-set-indent.php>`__
67+
and
68+
```XMLWriter::setIndentString`` <http://www.php.net/manual/en/function.xmlwriter-set-indent-string.php>`__.
69+
The default value of this option is ``true`` (compatible), which is
70+
`required for OpenOffice <https://github.com/PHPOffice/PHPWord/issues/103>`__ to
71+
render OOXML document correctly. You can set this option to ``false``
72+
during development to make the resulting XML file easier to read.
73+
74+
.. code-block:: php
75+
76+
PhpOffice\PhpWord\Settings::setCompatibility(false);
77+
78+
Zip class
79+
~~~~~~~~~
80+
81+
By default, PHPWord uses PHP
82+
`ZipArchive <http://php.net/manual/en/book.zip.php>`__ to read or write
83+
ZIP compressed archive and the files inside them. If you can't have
84+
ZipArchive installed on your server, you can use pure PHP library
85+
alternative, `PCLZip <http://www.phpconcept.net/pclzip/>`__, which
86+
included with PHPWord.
87+
88+
.. code-block:: php
89+
90+
PhpOffice\PhpWord\Settings::setZipClass(PhpOffice\PhpWord\Settings::PCLZIP);
91+
5592
Default font
5693
------------
5794

@@ -105,3 +142,4 @@ points to twips.
105142
$sectionStyle->setMarginLeft(\PhpOffice\PhpWord\Shared\Font::inchSizeToTwips(.5));
106143
// 2 cm right margin
107144
$sectionStyle->setMarginRight(\PhpOffice\PhpWord\Shared\Font::centimeterSizeToTwips(2));
145+

src/PhpWord/Template.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Template
2121
/**
2222
* ZipArchive object
2323
*
24-
* @var \ZipArchive
24+
* @var mixed
2525
*/
2626
private $_objZip;
2727

0 commit comments

Comments
 (0)