From 5bc74eb64f2471c93455623291f6b66fa432370b Mon Sep 17 00:00:00 2001
From: Progi1984
Date: Sat, 15 Mar 2014 10:00:09 +0100
Subject: [PATCH 01/85] ADDED : Docs
---
.gitignore | 1 -
changelog.txt | 3 +
docs/Makefile | 153 ++++++++++++++++++++++++++
docs/conf.py | 290 +++++++++++++++++++++++++++++++++++++++++++++++++
docs/index.rst | 29 +++++
docs/intro.rst | 39 +++++++
docs/setup.rst | 14 +++
7 files changed, 528 insertions(+), 1 deletion(-)
create mode 100644 docs/Makefile
create mode 100644 docs/conf.py
create mode 100644 docs/index.rst
create mode 100644 docs/intro.rst
create mode 100644 docs/setup.rst
diff --git a/.gitignore b/.gitignore
index 81767f6b..5bb99634 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,7 +13,6 @@ vendor
/.settings
/.buildpath
/.project
-/docs
*.odt
*.docx
*.rtf
diff --git a/changelog.txt b/changelog.txt
index d603eecd..79d506c4 100755
--- a/changelog.txt
+++ b/changelog.txt
@@ -22,6 +22,9 @@
* @version ##VERSION##, ##DATE##
**************************************************************************************
+Changes in branch for release 0.9.0 :
+- QA: (Progi1984) - Documentation
+
Changes in branch for release 0.8.0 :
- Bugfix: (gabrielbull) - Fixed bug with cell styling
- Bugfix: (gabrielbull) - Fixed bug list items inside of cells
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 00000000..bd38cd5d
--- /dev/null
+++ b/docs/Makefile
@@ -0,0 +1,153 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+BUILDDIR = _build
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+
+help:
+ @echo "Please use \`make ' where is one of"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " texinfo to make Texinfo files"
+ @echo " info to make Texinfo files and run them through makeinfo"
+ @echo " gettext to make PO message catalogs"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+ -rm -rf $(BUILDDIR)/*
+
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PHPWord.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PHPWord.qhc"
+
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/PHPWord"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PHPWord"
+ @echo "# devhelp"
+
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo
+ @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+ @echo "Run \`make' in that directory to run these through makeinfo" \
+ "(use \`make info' here to do that automatically)."
+
+info:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo "Running Texinfo files through makeinfo..."
+ make -C $(BUILDDIR)/texinfo info
+ @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+ $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+ @echo
+ @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+ @echo
+ @echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 00000000..9908b2b7
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,290 @@
+# -*- coding: utf-8 -*-
+#
+# PHPWord documentation build configuration file, created by
+# sphinx-quickstart on Fri Mar 14 23:09:26 2014.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = []
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'PHPWord'
+copyright = u'2014, Progi1984'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '0.9.0'
+# The full version, including alpha/beta/rc tags.
+release = version
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# " v documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'PHPWorddoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
+
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+ ('index', 'PHPWord.tex', u'PHPWord Documentation',
+ u'The PHPWord Team', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('index', 'phpword', u'PHPWord Documentation',
+ [u'The PHPWord Team'], 1)
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output ------------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+# dir menu entry, description, category)
+texinfo_documents = [
+ ('index', 'PHPWord', u'PHPWord Documentation',
+ u'The PHPWord Team', 'PHPWord', 'One line description of project.',
+ 'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
+
+# -- Options for Epub output ---------------------------------------------------
+
+# Bibliographic Dublin Core info.
+epub_title = u'PHPWord'
+epub_author = u'The PHPWord Team'
+epub_publisher = u'The PHPWord Team'
+epub_copyright = copyright
+
+# The language of the text. It defaults to the language option
+# or en if the language is not set.
+#epub_language = ''
+
+# The scheme of the identifier. Typical schemes are ISBN or URL.
+#epub_scheme = ''
+
+# The unique identifier of the text. This can be a ISBN number
+# or the project homepage.
+#epub_identifier = ''
+
+# A unique identification for the text.
+#epub_uid = ''
+
+# A tuple containing the cover image and cover page html template filenames.
+#epub_cover = ()
+
+# HTML files that should be inserted before the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_pre_files = []
+
+# HTML files shat should be inserted after the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_post_files = []
+
+# A list of files that should not be packed into the epub file.
+#epub_exclude_files = []
+
+# The depth of the table of contents in toc.ncx.
+#epub_tocdepth = 3
+
+# Allow duplicate toc entries.
+#epub_tocdup = True
+
+# Highlight PHP without starting
Date: Sat, 15 Mar 2014 16:17:05 +0700
Subject: [PATCH 02/85] Version number: 0.7.0 > 0.8.0
---
Classes/PHPWord.php | 2 +-
Classes/PHPWord/Autoloader.php | 2 +-
Classes/PHPWord/DocumentProperties.php | 2 +-
Classes/PHPWord/Exception.php | 2 +-
Classes/PHPWord/Footnote.php | 2 +-
Classes/PHPWord/HashTable.php | 2 +-
Classes/PHPWord/IOFactory.php | 2 +-
Classes/PHPWord/Media.php | 2 +-
Classes/PHPWord/Reader/Abstract.php | 2 +-
Classes/PHPWord/Reader/IReader.php | 2 +-
Classes/PHPWord/Reader/Word2007.php | 2 +-
Classes/PHPWord/Section.php | 2 +-
Classes/PHPWord/Section/Footer.php | 2 +-
Classes/PHPWord/Section/Footer/PreserveText.php | 2 +-
Classes/PHPWord/Section/Footnote.php | 2 +-
Classes/PHPWord/Section/Header.php | 2 +-
Classes/PHPWord/Section/Image.php | 2 +-
Classes/PHPWord/Section/Link.php | 2 +-
Classes/PHPWord/Section/ListItem.php | 2 +-
Classes/PHPWord/Section/MemoryImage.php | 2 +-
Classes/PHPWord/Section/Object.php | 2 +-
Classes/PHPWord/Section/PageBreak.php | 2 +-
Classes/PHPWord/Section/Settings.php | 2 +-
Classes/PHPWord/Section/Table.php | 2 +-
Classes/PHPWord/Section/Table/Cell.php | 2 +-
Classes/PHPWord/Section/Table/Row.php | 2 +-
Classes/PHPWord/Section/Text.php | 2 +-
Classes/PHPWord/Section/TextBreak.php | 2 +-
Classes/PHPWord/Section/TextRun.php | 2 +-
Classes/PHPWord/Section/Title.php | 2 +-
Classes/PHPWord/Settings.php | 2 +-
Classes/PHPWord/Shared/Drawing.php | 2 +-
Classes/PHPWord/Shared/File.php | 2 +-
Classes/PHPWord/Shared/Font.php | 2 +-
Classes/PHPWord/Shared/String.php | 2 +-
Classes/PHPWord/Shared/XMLWriter.php | 2 +-
Classes/PHPWord/Shared/ZipStreamWrapper.php | 2 +-
Classes/PHPWord/Style.php | 2 +-
Classes/PHPWord/Style/Cell.php | 2 +-
Classes/PHPWord/Style/Font.php | 2 +-
Classes/PHPWord/Style/Image.php | 2 +-
Classes/PHPWord/Style/ListItem.php | 2 +-
Classes/PHPWord/Style/Paragraph.php | 2 +-
Classes/PHPWord/Style/Row.php | 2 +-
Classes/PHPWord/Style/TOC.php | 2 +-
Classes/PHPWord/Style/Tab.php | 2 +-
Classes/PHPWord/Style/Table.php | 2 +-
Classes/PHPWord/Style/TableFull.php | 2 +-
Classes/PHPWord/Style/Tabs.php | 2 +-
Classes/PHPWord/TOC.php | 2 +-
Classes/PHPWord/Template.php | 2 +-
Classes/PHPWord/Writer/IWriter.php | 2 +-
Classes/PHPWord/Writer/ODText.php | 2 +-
Classes/PHPWord/Writer/ODText/Content.php | 2 +-
Classes/PHPWord/Writer/ODText/Manifest.php | 2 +-
Classes/PHPWord/Writer/ODText/Meta.php | 2 +-
Classes/PHPWord/Writer/ODText/Mimetype.php | 2 +-
Classes/PHPWord/Writer/ODText/Styles.php | 2 +-
Classes/PHPWord/Writer/ODText/WriterPart.php | 2 +-
Classes/PHPWord/Writer/RTF.php | 2 +-
Classes/PHPWord/Writer/Word2007.php | 2 +-
Classes/PHPWord/Writer/Word2007/Base.php | 2 +-
Classes/PHPWord/Writer/Word2007/ContentTypes.php | 2 +-
Classes/PHPWord/Writer/Word2007/DocProps.php | 2 +-
Classes/PHPWord/Writer/Word2007/Document.php | 2 +-
Classes/PHPWord/Writer/Word2007/DocumentRels.php | 2 +-
Classes/PHPWord/Writer/Word2007/Footer.php | 2 +-
Classes/PHPWord/Writer/Word2007/Footnotes.php | 6 +++---
Classes/PHPWord/Writer/Word2007/FootnotesRels.php | 6 +++---
Classes/PHPWord/Writer/Word2007/Header.php | 2 +-
Classes/PHPWord/Writer/Word2007/Rels.php | 2 +-
Classes/PHPWord/Writer/Word2007/Styles.php | 2 +-
Classes/PHPWord/Writer/Word2007/WriterPart.php | 2 +-
73 files changed, 77 insertions(+), 77 deletions(-)
diff --git a/Classes/PHPWord.php b/Classes/PHPWord.php
index 0614cee0..43ba3e7e 100755
--- a/Classes/PHPWord.php
+++ b/Classes/PHPWord.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/** PHPWORD_BASE_PATH */
diff --git a/Classes/PHPWord/Autoloader.php b/Classes/PHPWord/Autoloader.php
index 74d1a500..aa36efc8 100755
--- a/Classes/PHPWord/Autoloader.php
+++ b/Classes/PHPWord/Autoloader.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
if (!defined('PHPWORD_BASE_PATH')) {
diff --git a/Classes/PHPWord/DocumentProperties.php b/Classes/PHPWord/DocumentProperties.php
index 3fc097b4..1e64adf4 100755
--- a/Classes/PHPWord/DocumentProperties.php
+++ b/Classes/PHPWord/DocumentProperties.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Exception.php b/Classes/PHPWord/Exception.php
index 91b5d54f..d6a90510 100755
--- a/Classes/PHPWord/Exception.php
+++ b/Classes/PHPWord/Exception.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Footnote.php b/Classes/PHPWord/Footnote.php
index 81b64049..33860bbf 100644
--- a/Classes/PHPWord/Footnote.php
+++ b/Classes/PHPWord/Footnote.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
diff --git a/Classes/PHPWord/HashTable.php b/Classes/PHPWord/HashTable.php
index 22c602b8..5db4b8c0 100755
--- a/Classes/PHPWord/HashTable.php
+++ b/Classes/PHPWord/HashTable.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/IOFactory.php b/Classes/PHPWord/IOFactory.php
index aac0be87..aa2e798c 100755
--- a/Classes/PHPWord/IOFactory.php
+++ b/Classes/PHPWord/IOFactory.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Media.php b/Classes/PHPWord/Media.php
index 82294132..03328184 100755
--- a/Classes/PHPWord/Media.php
+++ b/Classes/PHPWord/Media.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Reader/Abstract.php b/Classes/PHPWord/Reader/Abstract.php
index 18392f8b..8c185cb2 100644
--- a/Classes/PHPWord/Reader/Abstract.php
+++ b/Classes/PHPWord/Reader/Abstract.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Reader/IReader.php b/Classes/PHPWord/Reader/IReader.php
index f51eed77..703db576 100644
--- a/Classes/PHPWord/Reader/IReader.php
+++ b/Classes/PHPWord/Reader/IReader.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Reader/Word2007.php b/Classes/PHPWord/Reader/Word2007.php
index 4d372f27..b217a018 100644
--- a/Classes/PHPWord/Reader/Word2007.php
+++ b/Classes/PHPWord/Reader/Word2007.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/** PHPWord root directory */
diff --git a/Classes/PHPWord/Section.php b/Classes/PHPWord/Section.php
index 95bb9db0..07a17a31 100755
--- a/Classes/PHPWord/Section.php
+++ b/Classes/PHPWord/Section.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Section/Footer.php b/Classes/PHPWord/Section/Footer.php
index ae2e2119..238bae1b 100755
--- a/Classes/PHPWord/Section/Footer.php
+++ b/Classes/PHPWord/Section/Footer.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Section/Footer/PreserveText.php b/Classes/PHPWord/Section/Footer/PreserveText.php
index b1629770..72443743 100755
--- a/Classes/PHPWord/Section/Footer/PreserveText.php
+++ b/Classes/PHPWord/Section/Footer/PreserveText.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Section/Footnote.php b/Classes/PHPWord/Section/Footnote.php
index 7b2159e4..652a3873 100644
--- a/Classes/PHPWord/Section/Footnote.php
+++ b/Classes/PHPWord/Section/Footnote.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Section/Header.php b/Classes/PHPWord/Section/Header.php
index e2f5b2be..5e1c6bfe 100755
--- a/Classes/PHPWord/Section/Header.php
+++ b/Classes/PHPWord/Section/Header.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Section/Image.php b/Classes/PHPWord/Section/Image.php
index a8fcde46..fcaa1cc9 100755
--- a/Classes/PHPWord/Section/Image.php
+++ b/Classes/PHPWord/Section/Image.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
use PhpOffice\PhpWord\Exceptions\InvalidImageException;
diff --git a/Classes/PHPWord/Section/Link.php b/Classes/PHPWord/Section/Link.php
index 42b9d7b3..620b08a1 100755
--- a/Classes/PHPWord/Section/Link.php
+++ b/Classes/PHPWord/Section/Link.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Section/ListItem.php b/Classes/PHPWord/Section/ListItem.php
index ac5263b3..83384a94 100755
--- a/Classes/PHPWord/Section/ListItem.php
+++ b/Classes/PHPWord/Section/ListItem.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Section/MemoryImage.php b/Classes/PHPWord/Section/MemoryImage.php
index f1488c45..9d4ed97c 100755
--- a/Classes/PHPWord/Section/MemoryImage.php
+++ b/Classes/PHPWord/Section/MemoryImage.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Section/Object.php b/Classes/PHPWord/Section/Object.php
index acf14e55..33d8cad9 100755
--- a/Classes/PHPWord/Section/Object.php
+++ b/Classes/PHPWord/Section/Object.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Section/PageBreak.php b/Classes/PHPWord/Section/PageBreak.php
index 35f8b5c0..76536304 100755
--- a/Classes/PHPWord/Section/PageBreak.php
+++ b/Classes/PHPWord/Section/PageBreak.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Section/Settings.php b/Classes/PHPWord/Section/Settings.php
index 38af6410..1ff3bf64 100755
--- a/Classes/PHPWord/Section/Settings.php
+++ b/Classes/PHPWord/Section/Settings.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Section/Table.php b/Classes/PHPWord/Section/Table.php
index dd93c95e..f5a8a799 100755
--- a/Classes/PHPWord/Section/Table.php
+++ b/Classes/PHPWord/Section/Table.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Section/Table/Cell.php b/Classes/PHPWord/Section/Table/Cell.php
index 983f4a24..f8d6d340 100755
--- a/Classes/PHPWord/Section/Table/Cell.php
+++ b/Classes/PHPWord/Section/Table/Cell.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Section/Table/Row.php b/Classes/PHPWord/Section/Table/Row.php
index d174ef8f..dd8ea65c 100644
--- a/Classes/PHPWord/Section/Table/Row.php
+++ b/Classes/PHPWord/Section/Table/Row.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Section/Text.php b/Classes/PHPWord/Section/Text.php
index 296084e6..8631b66e 100755
--- a/Classes/PHPWord/Section/Text.php
+++ b/Classes/PHPWord/Section/Text.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Section/TextBreak.php b/Classes/PHPWord/Section/TextBreak.php
index 0438bd4f..85f53edc 100755
--- a/Classes/PHPWord/Section/TextBreak.php
+++ b/Classes/PHPWord/Section/TextBreak.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Section/TextRun.php b/Classes/PHPWord/Section/TextRun.php
index a708a119..fcb2bd48 100755
--- a/Classes/PHPWord/Section/TextRun.php
+++ b/Classes/PHPWord/Section/TextRun.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Section/Title.php b/Classes/PHPWord/Section/Title.php
index 8dd5f1c3..067370f2 100755
--- a/Classes/PHPWord/Section/Title.php
+++ b/Classes/PHPWord/Section/Title.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Settings.php b/Classes/PHPWord/Settings.php
index af400551..241694f6 100644
--- a/Classes/PHPWord/Settings.php
+++ b/Classes/PHPWord/Settings.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Shared/Drawing.php b/Classes/PHPWord/Shared/Drawing.php
index 064e6fcc..9930b44e 100755
--- a/Classes/PHPWord/Shared/Drawing.php
+++ b/Classes/PHPWord/Shared/Drawing.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Shared/File.php b/Classes/PHPWord/Shared/File.php
index 3e3e147d..26a206ba 100755
--- a/Classes/PHPWord/Shared/File.php
+++ b/Classes/PHPWord/Shared/File.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Shared/Font.php b/Classes/PHPWord/Shared/Font.php
index 9e6dc44f..3bb783b8 100755
--- a/Classes/PHPWord/Shared/Font.php
+++ b/Classes/PHPWord/Shared/Font.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Shared/String.php b/Classes/PHPWord/Shared/String.php
index 64abdf1d..0f0d0721 100755
--- a/Classes/PHPWord/Shared/String.php
+++ b/Classes/PHPWord/Shared/String.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Shared/XMLWriter.php b/Classes/PHPWord/Shared/XMLWriter.php
index 91a9d530..6e6e6360 100755
--- a/Classes/PHPWord/Shared/XMLWriter.php
+++ b/Classes/PHPWord/Shared/XMLWriter.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
if (!defined('DATE_W3C')) {
diff --git a/Classes/PHPWord/Shared/ZipStreamWrapper.php b/Classes/PHPWord/Shared/ZipStreamWrapper.php
index bfdc791b..fe4ff372 100755
--- a/Classes/PHPWord/Shared/ZipStreamWrapper.php
+++ b/Classes/PHPWord/Shared/ZipStreamWrapper.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Style.php b/Classes/PHPWord/Style.php
index 060ce1be..8366b658 100755
--- a/Classes/PHPWord/Style.php
+++ b/Classes/PHPWord/Style.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Style/Cell.php b/Classes/PHPWord/Style/Cell.php
index 10d4a9be..b07eb4c2 100755
--- a/Classes/PHPWord/Style/Cell.php
+++ b/Classes/PHPWord/Style/Cell.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Style/Font.php b/Classes/PHPWord/Style/Font.php
index bc5ee511..f26f3924 100755
--- a/Classes/PHPWord/Style/Font.php
+++ b/Classes/PHPWord/Style/Font.php
@@ -23,7 +23,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
use PhpOffice\PhpWord\Exceptions\InvalidStyleException;
diff --git a/Classes/PHPWord/Style/Image.php b/Classes/PHPWord/Style/Image.php
index 4453463a..9bec4d5b 100755
--- a/Classes/PHPWord/Style/Image.php
+++ b/Classes/PHPWord/Style/Image.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Style/ListItem.php b/Classes/PHPWord/Style/ListItem.php
index 9429b47e..5fbff0d6 100755
--- a/Classes/PHPWord/Style/ListItem.php
+++ b/Classes/PHPWord/Style/ListItem.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Style/Paragraph.php b/Classes/PHPWord/Style/Paragraph.php
index 754589cb..32a44929 100755
--- a/Classes/PHPWord/Style/Paragraph.php
+++ b/Classes/PHPWord/Style/Paragraph.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
use PhpOffice\PhpWord\Exceptions\InvalidStyleException;
diff --git a/Classes/PHPWord/Style/Row.php b/Classes/PHPWord/Style/Row.php
index c7140d58..93b5f862 100644
--- a/Classes/PHPWord/Style/Row.php
+++ b/Classes/PHPWord/Style/Row.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Style/TOC.php b/Classes/PHPWord/Style/TOC.php
index e7adfc41..482ae868 100755
--- a/Classes/PHPWord/Style/TOC.php
+++ b/Classes/PHPWord/Style/TOC.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Style/Tab.php b/Classes/PHPWord/Style/Tab.php
index f8ee4b9b..8db7abae 100755
--- a/Classes/PHPWord/Style/Tab.php
+++ b/Classes/PHPWord/Style/Tab.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Style/Table.php b/Classes/PHPWord/Style/Table.php
index 5f4f60c1..c3ef2e01 100755
--- a/Classes/PHPWord/Style/Table.php
+++ b/Classes/PHPWord/Style/Table.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Style/TableFull.php b/Classes/PHPWord/Style/TableFull.php
index 11f094e0..573ae53b 100755
--- a/Classes/PHPWord/Style/TableFull.php
+++ b/Classes/PHPWord/Style/TableFull.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Style/Tabs.php b/Classes/PHPWord/Style/Tabs.php
index 144d2a5d..a5e1a8bb 100755
--- a/Classes/PHPWord/Style/Tabs.php
+++ b/Classes/PHPWord/Style/Tabs.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/TOC.php b/Classes/PHPWord/TOC.php
index ae514a54..c81fca22 100755
--- a/Classes/PHPWord/TOC.php
+++ b/Classes/PHPWord/TOC.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Template.php b/Classes/PHPWord/Template.php
index 840d2295..9db3edba 100755
--- a/Classes/PHPWord/Template.php
+++ b/Classes/PHPWord/Template.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Writer/IWriter.php b/Classes/PHPWord/Writer/IWriter.php
index eb561d1b..f5ca8299 100755
--- a/Classes/PHPWord/Writer/IWriter.php
+++ b/Classes/PHPWord/Writer/IWriter.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Writer/ODText.php b/Classes/PHPWord/Writer/ODText.php
index 6ec25cba..7d8c2e4b 100755
--- a/Classes/PHPWord/Writer/ODText.php
+++ b/Classes/PHPWord/Writer/ODText.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Writer/ODText/Content.php b/Classes/PHPWord/Writer/ODText/Content.php
index c33635cc..0899990b 100755
--- a/Classes/PHPWord/Writer/ODText/Content.php
+++ b/Classes/PHPWord/Writer/ODText/Content.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Writer/ODText/Manifest.php b/Classes/PHPWord/Writer/ODText/Manifest.php
index c3c28981..89e802dc 100755
--- a/Classes/PHPWord/Writer/ODText/Manifest.php
+++ b/Classes/PHPWord/Writer/ODText/Manifest.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Writer/ODText/Meta.php b/Classes/PHPWord/Writer/ODText/Meta.php
index 79624d82..53978614 100755
--- a/Classes/PHPWord/Writer/ODText/Meta.php
+++ b/Classes/PHPWord/Writer/ODText/Meta.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Writer/ODText/Mimetype.php b/Classes/PHPWord/Writer/ODText/Mimetype.php
index def40db4..af3b3348 100755
--- a/Classes/PHPWord/Writer/ODText/Mimetype.php
+++ b/Classes/PHPWord/Writer/ODText/Mimetype.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Writer/ODText/Styles.php b/Classes/PHPWord/Writer/ODText/Styles.php
index 7f388809..b5f87332 100755
--- a/Classes/PHPWord/Writer/ODText/Styles.php
+++ b/Classes/PHPWord/Writer/ODText/Styles.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Writer/ODText/WriterPart.php b/Classes/PHPWord/Writer/ODText/WriterPart.php
index 1e05cd50..c65269a2 100755
--- a/Classes/PHPWord/Writer/ODText/WriterPart.php
+++ b/Classes/PHPWord/Writer/ODText/WriterPart.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Writer/RTF.php b/Classes/PHPWord/Writer/RTF.php
index 80889ebe..a090fb17 100755
--- a/Classes/PHPWord/Writer/RTF.php
+++ b/Classes/PHPWord/Writer/RTF.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Writer/Word2007.php b/Classes/PHPWord/Writer/Word2007.php
index bd574eb2..e62341bf 100755
--- a/Classes/PHPWord/Writer/Word2007.php
+++ b/Classes/PHPWord/Writer/Word2007.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
use PhpOffice\PhpWord\Exceptions\InvalidImageException;
diff --git a/Classes/PHPWord/Writer/Word2007/Base.php b/Classes/PHPWord/Writer/Word2007/Base.php
index 4bb8908d..e9249120 100755
--- a/Classes/PHPWord/Writer/Word2007/Base.php
+++ b/Classes/PHPWord/Writer/Word2007/Base.php
@@ -23,7 +23,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Writer/Word2007/ContentTypes.php b/Classes/PHPWord/Writer/Word2007/ContentTypes.php
index eeaeb84d..8a6e39ef 100755
--- a/Classes/PHPWord/Writer/Word2007/ContentTypes.php
+++ b/Classes/PHPWord/Writer/Word2007/ContentTypes.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Writer/Word2007/DocProps.php b/Classes/PHPWord/Writer/Word2007/DocProps.php
index be633419..2e8f8b5a 100755
--- a/Classes/PHPWord/Writer/Word2007/DocProps.php
+++ b/Classes/PHPWord/Writer/Word2007/DocProps.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Writer/Word2007/Document.php b/Classes/PHPWord/Writer/Word2007/Document.php
index 9991179d..abdd92cc 100755
--- a/Classes/PHPWord/Writer/Word2007/Document.php
+++ b/Classes/PHPWord/Writer/Word2007/Document.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Writer/Word2007/DocumentRels.php b/Classes/PHPWord/Writer/Word2007/DocumentRels.php
index e5aaffbd..9817a31f 100755
--- a/Classes/PHPWord/Writer/Word2007/DocumentRels.php
+++ b/Classes/PHPWord/Writer/Word2007/DocumentRels.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Writer/Word2007/Footer.php b/Classes/PHPWord/Writer/Word2007/Footer.php
index f9b4763e..6ee18d66 100755
--- a/Classes/PHPWord/Writer/Word2007/Footer.php
+++ b/Classes/PHPWord/Writer/Word2007/Footer.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Writer/Word2007/Footnotes.php b/Classes/PHPWord/Writer/Word2007/Footnotes.php
index fe7ced0e..28d087c7 100644
--- a/Classes/PHPWord/Writer/Word2007/Footnotes.php
+++ b/Classes/PHPWord/Writer/Word2007/Footnotes.php
@@ -2,7 +2,7 @@
/**
* PHPWord
*
- * Copyright (c) 2011 PHPWord
+ * Copyright (c) 2014 PHPWord
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,9 +20,9 @@
*
* @category PHPWord
* @package PHPWord
- * @copyright Copyright (c) 010 PHPWord
+ * @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version Beta 0.6.3, 08.07.2011
+ * @version 0.8.0
*/
diff --git a/Classes/PHPWord/Writer/Word2007/FootnotesRels.php b/Classes/PHPWord/Writer/Word2007/FootnotesRels.php
index 6c81b3c9..0e562b59 100644
--- a/Classes/PHPWord/Writer/Word2007/FootnotesRels.php
+++ b/Classes/PHPWord/Writer/Word2007/FootnotesRels.php
@@ -2,7 +2,7 @@
/**
* PHPWord
*
- * Copyright (c) 2011 PHPWord
+ * Copyright (c) 2014 PHPWord
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,9 +20,9 @@
*
* @category PHPWord
* @package PHPWord
- * @copyright Copyright (c) 010 PHPWord
+ * @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version Beta 0.6.3, 08.07.2011
+ * @version 0.8.0
*/
diff --git a/Classes/PHPWord/Writer/Word2007/Header.php b/Classes/PHPWord/Writer/Word2007/Header.php
index 6bb6f784..59eebd91 100755
--- a/Classes/PHPWord/Writer/Word2007/Header.php
+++ b/Classes/PHPWord/Writer/Word2007/Header.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Writer/Word2007/Rels.php b/Classes/PHPWord/Writer/Word2007/Rels.php
index 97f28d22..06eb59cc 100755
--- a/Classes/PHPWord/Writer/Word2007/Rels.php
+++ b/Classes/PHPWord/Writer/Word2007/Rels.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Writer/Word2007/Styles.php b/Classes/PHPWord/Writer/Word2007/Styles.php
index c87d94bf..3724323e 100755
--- a/Classes/PHPWord/Writer/Word2007/Styles.php
+++ b/Classes/PHPWord/Writer/Word2007/Styles.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
diff --git a/Classes/PHPWord/Writer/Word2007/WriterPart.php b/Classes/PHPWord/Writer/Word2007/WriterPart.php
index 91a863e0..cc004254 100755
--- a/Classes/PHPWord/Writer/Word2007/WriterPart.php
+++ b/Classes/PHPWord/Writer/Word2007/WriterPart.php
@@ -22,7 +22,7 @@
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.7.0
+ * @version 0.8.0
*/
/**
From 3b7dac452bba46c740b202a659e5fb09c13d7ace Mon Sep 17 00:00:00 2001
From: Gabriel Bull
Date: Sat, 15 Mar 2014 09:27:48 -0400
Subject: [PATCH 03/85] Refactored PHPWord_Exception to namespaces
---
Classes/PHPWord.php | 8 +-
Classes/PHPWord/Exception.php | 49 ----------
Classes/PHPWord/Exceptions/Exception.php | 9 ++
.../Exceptions/InvalidImageException.php | 2 -
.../Exceptions/InvalidStyleException.php | 2 +-
.../UnsupportedImageTypeException.php | 2 -
Classes/PHPWord/IOFactory.php | 26 ++---
Classes/PHPWord/Reader/Abstract.php | 29 +++---
Classes/PHPWord/Reader/Word2007.php | 97 ++++++++-----------
Classes/PHPWord/Section.php | 32 +++---
Classes/PHPWord/Settings.php | 7 +-
Classes/PHPWord/Template.php | 83 +++++++++-------
Tests/PHPWord/Exceptions/ExceptionTest.php | 16 +++
.../Exceptions/InvalidImageExceptionTest.php | 16 +++
.../Exceptions/InvalidStyleExceptionTest.php | 16 +++
.../UnsupportedImageTypeExceptionTest.php | 16 +++
Tests/PHPWord/IOFactoryTest.php | 11 +--
17 files changed, 213 insertions(+), 208 deletions(-)
delete mode 100755 Classes/PHPWord/Exception.php
create mode 100755 Classes/PHPWord/Exceptions/Exception.php
create mode 100644 Tests/PHPWord/Exceptions/ExceptionTest.php
create mode 100644 Tests/PHPWord/Exceptions/InvalidImageExceptionTest.php
create mode 100644 Tests/PHPWord/Exceptions/InvalidStyleExceptionTest.php
create mode 100644 Tests/PHPWord/Exceptions/UnsupportedImageTypeExceptionTest.php
diff --git a/Classes/PHPWord.php b/Classes/PHPWord.php
index 43ba3e7e..d591b94e 100755
--- a/Classes/PHPWord.php
+++ b/Classes/PHPWord.php
@@ -34,6 +34,8 @@ if (!defined('PHPWORD_BASE_PATH')) {
}
// @codeCoverageIgnoreEnd
+use PhpOffice\PhpWord\Exceptions\Exception;
+
/**
* PHPWord
*/
@@ -252,17 +254,15 @@ class PHPWord
*
* @param string $strFilename
* @return PHPWord_Template
+ * @throws Exception
*/
public function loadTemplate($strFilename)
{
if (file_exists($strFilename)) {
$template = new PHPWord_Template($strFilename);
return $template;
- } else {
- throw new PHPWord_Exception(
- "Template file {$strFilename} not found."
- );
}
+ throw new Exception("Template file {$strFilename} not found.");
}
/**
diff --git a/Classes/PHPWord/Exception.php b/Classes/PHPWord/Exception.php
deleted file mode 100755
index d6a90510..00000000
--- a/Classes/PHPWord/Exception.php
+++ /dev/null
@@ -1,49 +0,0 @@
-line = $line;
- $e->file = $file;
- throw $e;
- }
-}
diff --git a/Classes/PHPWord/Exceptions/Exception.php b/Classes/PHPWord/Exceptions/Exception.php
new file mode 100755
index 00000000..11cb0516
--- /dev/null
+++ b/Classes/PHPWord/Exceptions/Exception.php
@@ -0,0 +1,9 @@
+load($pFilename);
}
-}
+}
\ No newline at end of file
diff --git a/Classes/PHPWord/Reader/Abstract.php b/Classes/PHPWord/Reader/Abstract.php
index 8c185cb2..ba7f6565 100644
--- a/Classes/PHPWord/Reader/Abstract.php
+++ b/Classes/PHPWord/Reader/Abstract.php
@@ -25,6 +25,8 @@
* @version 0.8.0
*/
+use PhpOffice\PhpWord\Exceptions\Exception;
+
/**
* PHPWord_Reader_Abstract
*
@@ -35,17 +37,19 @@ abstract class PHPWord_Reader_Abstract implements PHPWord_Reader_IReader
/**
* Read data only?
*
- * @var boolean
+ * @var bool
*/
protected $readDataOnly = true;
+ /**
+ * @var bool|resource
+ */
protected $fileHandle = true;
-
/**
* Read data only?
*
- * @return boolean
+ * @return bool
*/
public function getReadDataOnly()
{
@@ -56,8 +60,8 @@ abstract class PHPWord_Reader_Abstract implements PHPWord_Reader_IReader
/**
* Set read data only
*
- * @param boolean $pValue
- * @return PHPWord_Reader_IReader
+ * @param bool $pValue
+ * @return PHPWord_Reader_IReader
*/
public function setReadDataOnly($pValue = true)
{
@@ -69,29 +73,28 @@ abstract class PHPWord_Reader_Abstract implements PHPWord_Reader_IReader
* Open file for reading
*
* @param string $pFilename
- * @throws PHPWord_Exception
* @return resource
+ * @throws Exception
*/
protected function openFile($pFilename)
{
// Check if file exists
if (!file_exists($pFilename) || !is_readable($pFilename)) {
- throw new PHPWord_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
+ throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
}
// Open file
$this->fileHandle = fopen($pFilename, 'r');
if ($this->fileHandle === false) {
- throw new PHPWord_Exception("Could not open file " . $pFilename . " for reading.");
+ throw new Exception("Could not open file " . $pFilename . " for reading.");
}
}
/**
* Can the current PHPWord_Reader_IReader read the file?
*
- * @param string $pFilename
- * @return boolean
- * @throws PHPWord_Exception
+ * @param string $pFilename
+ * @return bool
*/
public function canRead($pFilename)
{
@@ -102,6 +105,6 @@ abstract class PHPWord_Reader_Abstract implements PHPWord_Reader_IReader
return false;
}
fclose($this->fileHandle);
- return $readable;
+ return true;
}
-}
+}
\ No newline at end of file
diff --git a/Classes/PHPWord/Reader/Word2007.php b/Classes/PHPWord/Reader/Word2007.php
index b217a018..1aa94f86 100644
--- a/Classes/PHPWord/Reader/Word2007.php
+++ b/Classes/PHPWord/Reader/Word2007.php
@@ -31,32 +31,25 @@ if (!defined('PHPWORD_BASE_PATH')) {
require(PHPWORD_BASE_PATH . 'PHPWord/Autoloader.php');
}
+use PhpOffice\PhpWord\Exceptions\Exception;
+
/**
* PHPWord_Reader_Word2007
*/
-class PHPWord_Reader_Word2007 extends PHPWord_Reader_Abstract implements
- PHPWord_Reader_IReader
+class PHPWord_Reader_Word2007 extends PHPWord_Reader_Abstract implements PHPWord_Reader_IReader
{
- /**
- * Create a new PHPWord_Reader_Word2007 instance
- */
- public function __construct()
- {
- }
-
/**
* Can the current PHPWord_Reader_IReader read the file?
*
- * @param string $pFilename
- * @return bool
+ * @param string $pFilename
+ * @return bool
+ * @throws Exception
*/
public function canRead($pFilename)
{
// Check if file exists
if (!file_exists($pFilename)) {
- throw new PHPWord_Exception(
- "Could not open {$pFilename} for reading! File does not exist."
- );
+ throw new Exception("Could not open {$pFilename} for reading! File does not exist.");
}
$return = false;
@@ -86,15 +79,13 @@ class PHPWord_Reader_Word2007 extends PHPWord_Reader_Abstract implements
/**
* Get from zip archive
*
- * @param ZipArchive $archive
- * @param string $fileName
- * @param bool $removeNamespace
+ * @param ZipArchive $archive
+ * @param string $fileName
+ * @param bool $removeNamespace
+ * @return mixed
*/
- public function getFromZipArchive(
- $archive,
- $fileName = '',
- $removeNamespace = false
- ) {
+ public function getFromZipArchive($archive, $fileName = '', $removeNamespace = false)
+ {
// Root-relative paths
if (strpos($fileName, '//') !== false) {
$fileName = substr($fileName, strpos($fileName, '//') + 1);
@@ -115,18 +106,17 @@ class PHPWord_Reader_Word2007 extends PHPWord_Reader_Abstract implements
return $contents;
}
-
/**
* Loads PHPWord from file
*
- * @param string $pFilename
- * @return PHPWord|null
+ * @param string $pFilename
+ * @return PHPWord|null
*/
public function load($pFilename)
{
// Check if file exists and can be read
if (!$this->canRead($pFilename)) {
- return;
+ return null;
}
// Initialisations
@@ -146,15 +136,15 @@ class PHPWord_Reader_Word2007 extends PHPWord_Reader_Abstract implements
$xmlCore->registerXPathNamespace("dcterms", "http://purl.org/dc/terms/");
$xmlCore->registerXPathNamespace("cp", "http://schemas.openxmlformats.org/package/2006/metadata/core-properties");
$docProps = $word->getProperties();
- $docProps->setCreator((string) self::arrayItem($xmlCore->xpath("dc:creator")));
- $docProps->setLastModifiedBy((string) self::arrayItem($xmlCore->xpath("cp:lastModifiedBy")));
+ $docProps->setCreator((string)self::arrayItem($xmlCore->xpath("dc:creator")));
+ $docProps->setLastModifiedBy((string)self::arrayItem($xmlCore->xpath("cp:lastModifiedBy")));
$docProps->setCreated(strtotime(self::arrayItem($xmlCore->xpath("dcterms:created"))));
$docProps->setModified(strtotime(self::arrayItem($xmlCore->xpath("dcterms:modified"))));
- $docProps->setTitle((string) self::arrayItem($xmlCore->xpath("dc:title")));
- $docProps->setDescription((string) self::arrayItem($xmlCore->xpath("dc:description")));
- $docProps->setSubject((string) self::arrayItem($xmlCore->xpath("dc:subject")));
- $docProps->setKeywords((string) self::arrayItem($xmlCore->xpath("cp:keywords")));
- $docProps->setCategory((string) self::arrayItem($xmlCore->xpath("cp:category")));
+ $docProps->setTitle((string)self::arrayItem($xmlCore->xpath("dc:title")));
+ $docProps->setDescription((string)self::arrayItem($xmlCore->xpath("dc:description")));
+ $docProps->setSubject((string)self::arrayItem($xmlCore->xpath("dc:subject")));
+ $docProps->setKeywords((string)self::arrayItem($xmlCore->xpath("cp:keywords")));
+ $docProps->setCategory((string)self::arrayItem($xmlCore->xpath("cp:category")));
}
break;
// Extended properties
@@ -163,10 +153,10 @@ class PHPWord_Reader_Word2007 extends PHPWord_Reader_Abstract implements
if (is_object($xmlCore)) {
$docProps = $word->getProperties();
if (isset($xmlCore->Company)) {
- $docProps->setCompany((string) $xmlCore->Company);
+ $docProps->setCompany((string)$xmlCore->Company);
}
if (isset($xmlCore->Manager)) {
- $docProps->setManager((string) $xmlCore->Manager);
+ $docProps->setManager((string)$xmlCore->Manager);
}
}
break;
@@ -178,10 +168,10 @@ class PHPWord_Reader_Word2007 extends PHPWord_Reader_Abstract implements
foreach ($xmlCore as $xmlProperty) {
$cellDataOfficeAttributes = $xmlProperty->attributes();
if (isset($cellDataOfficeAttributes['name'])) {
- $propertyName = (string) $cellDataOfficeAttributes['name'];
+ $propertyName = (string)$cellDataOfficeAttributes['name'];
$cellDataOfficeChildren = $xmlProperty->children("http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes");
$attributeType = $cellDataOfficeChildren->getName();
- $attributeValue = (string) $cellDataOfficeChildren->{$attributeType};
+ $attributeValue = (string)$cellDataOfficeChildren->{$attributeType};
$attributeValue = PHPWord_DocumentProperties::convertProperty($attributeValue, $attributeType);
$attributeType = PHPWord_DocumentProperties::convertPropertyType($attributeType);
$docProps->setCustomProperty($propertyName, $attributeValue, $attributeType);
@@ -219,7 +209,7 @@ class PHPWord_Reader_Word2007 extends PHPWord_Reader_Abstract implements
$elm->r->t,
$this->loadFontStyle($elm->r)
);
- // w:r more than 1? It's a textrun
+ // w:r more than 1? It's a textrun
} else {
$textRun = $section->createTextRun();
foreach ($elm->r as $r) {
@@ -229,7 +219,7 @@ class PHPWord_Reader_Word2007 extends PHPWord_Reader_Abstract implements
);
}
}
- // No, it's a textbreak
+ // No, it's a textbreak
} else {
$section->addTextBreak();
}
@@ -282,8 +272,8 @@ class PHPWord_Reader_Word2007 extends PHPWord_Reader_Abstract implements
/**
* Load section settings from SimpleXMLElement
*
- * @param SimpleXMLElement $elm
- * @return array|string|null
+ * @param SimpleXMLElement $elm
+ * @return array|string|null
*
* @todo Implement gutter
*/
@@ -337,16 +327,15 @@ class PHPWord_Reader_Word2007 extends PHPWord_Reader_Abstract implements
}
}
return $setting;
- } else {
- return null;
}
+ return null;
}
/**
* Load paragraph style from SimpleXMLElement
*
- * @param SimpleXMLElement $elm
- * @return array|string|null
+ * @param SimpleXMLElement $elm
+ * @return array|string|null
*/
private function loadParagraphStyle($elm)
{
@@ -399,16 +388,15 @@ class PHPWord_Reader_Word2007 extends PHPWord_Reader_Abstract implements
$style['pageBreakBefore'] = true;
}
return $style;
- } else {
- return null;
}
+ return null;
}
/**
* Load font style from SimpleXMLElement
*
- * @param SimpleXMLElement $elm
- * @return array|string|null
+ * @param SimpleXMLElement $elm
+ * @return array|string|null
*/
private function loadFontStyle($elm)
{
@@ -449,20 +437,19 @@ class PHPWord_Reader_Word2007 extends PHPWord_Reader_Abstract implements
}
}
return $style;
- } else {
- return null;
}
+ return null;
}
/**
* Get array item
*
- * @param array $array
- * @param mixed $key
- * @return mixed|null
+ * @param array $array
+ * @param mixed $key
+ * @return mixed|null
*/
private static function arrayItem($array, $key = 0)
{
return (isset($array[$key]) ? $array[$key] : null);
}
-}
+}
\ No newline at end of file
diff --git a/Classes/PHPWord/Section.php b/Classes/PHPWord/Section.php
index 07a17a31..a9402dab 100755
--- a/Classes/PHPWord/Section.php
+++ b/Classes/PHPWord/Section.php
@@ -25,12 +25,13 @@
* @version 0.8.0
*/
+use PhpOffice\PhpWord\Exceptions\Exception;
+
/**
* Class PHPWord_Section
*/
class PHPWord_Section
{
-
/**
* Section count
*
@@ -83,7 +84,7 @@ class PHPWord_Section
/**
* Set Section Settings
*
- * @param array $settings
+ * @param array $settings
*/
public function setSettings($settings = null)
{
@@ -157,8 +158,8 @@ class PHPWord_Section
* Add a TextBreak Element
*
* @param int $count
- * @param null|string|array|PHPWord_Style_Font $fontStyle
- * @param null|string|array|PHPWord_Style_Paragraph $paragraphStyle
+ * @param null|string|array|PHPWord_Style_Font $fontStyle
+ * @param null|string|array|PHPWord_Style_Paragraph $paragraphStyle
*/
public function addTextBreak($count = 1, $fontStyle = null, $paragraphStyle = null)
{
@@ -214,6 +215,7 @@ class PHPWord_Section
* @param string $src
* @param mixed $style
* @return PHPWord_Section_Object
+ * @throws Exception
*/
public function addObject($src, $style = null)
{
@@ -244,11 +246,8 @@ class PHPWord_Section
$this->_elementCollection[] = $object;
return $object;
- } else {
- throw new PHPWord_Exception(
- 'Source does not exist or unsupported object type.'
- );
}
+ throw new Exception('Source does not exist or unsupported object type.');
}
/**
@@ -257,6 +256,7 @@ class PHPWord_Section
* @param string $src
* @param mixed $style
* @return PHPWord_Section_Image
+ * @throws Exception
*/
public function addImage($src, $style = null)
{
@@ -268,11 +268,8 @@ class PHPWord_Section
$this->_elementCollection[] = $image;
return $image;
- } else {
- throw new PHPWord_Exception(
- 'Source does not exist or unsupported image type.'
- );
}
+ throw new Exception('Source does not exist or unsupported image type.');
}
/**
@@ -281,6 +278,7 @@ class PHPWord_Section
* @param string $link
* @param mixed $style
* @return PHPWord_Section_MemoryImage
+ * @throws Exception
*/
public function addMemoryImage($link, $style = null)
{
@@ -291,11 +289,8 @@ class PHPWord_Section
$this->_elementCollection[] = $memoryImage;
return $memoryImage;
- } else {
- throw new PHPWord_Exception(
- 'Unsupported image type.'
- );
}
+ throw new Exception('Unsupported image type.');
}
/**
@@ -347,6 +342,7 @@ class PHPWord_Section
/**
* Create a new TextRun
*
+ * @param mixed $styleParagraph
* @return PHPWord_Section_TextRun
*/
public function createTextRun($styleParagraph = null)
@@ -430,7 +426,7 @@ class PHPWord_Section
/**
* Create a new Footnote Element
*
- * @param string $text
+ * @param mixed $styleParagraph
* @return PHPWord_Section_Footnote
*/
public function createFootnote($styleParagraph = null)
@@ -441,4 +437,4 @@ class PHPWord_Section
$this->_elementCollection[] = $footnote;
return $footnote;
}
-}
+}
\ No newline at end of file
diff --git a/Classes/PHPWord/Settings.php b/Classes/PHPWord/Settings.php
index 241694f6..0869f215 100644
--- a/Classes/PHPWord/Settings.php
+++ b/Classes/PHPWord/Settings.php
@@ -50,8 +50,7 @@ class PHPWord_Settings
return true;
}
return false;
- } // function setCompatibility()
-
+ }
/**
* Return the compatibility option used by the XMLWriter
@@ -61,5 +60,5 @@ class PHPWord_Settings
public static function getCompatibility()
{
return self::$_xmlWriterCompatibility;
- } // function getCompatibility()
-}
+ }
+}
\ No newline at end of file
diff --git a/Classes/PHPWord/Template.php b/Classes/PHPWord/Template.php
index 9db3edba..752fa792 100755
--- a/Classes/PHPWord/Template.php
+++ b/Classes/PHPWord/Template.php
@@ -25,6 +25,8 @@
* @version 0.8.0
*/
+use PhpOffice\PhpWord\Exceptions\Exception;
+
/**
* PHPWord_DocumentProperties
*/
@@ -57,50 +59,52 @@ class PHPWord_Template
* Create a new Template Object
*
* @param string $strFilename
+ * @throws Exception
*/
public function __construct($strFilename)
{
$this->_tempFileName = tempnam(sys_get_temp_dir(), '');
- if ($this->_tempFileName !== false) {
- // Copy the source File to the temp File
- if (!copy($strFilename, $this->_tempFileName)) {
- throw new PHPWord_Exception("Could not copy the template from {$strFilename} to {$this->_tempFileName}.");
- }
-
- $this->_objZip = new ZipArchive();
- $this->_objZip->open($this->_tempFileName);
-
- $this->_documentXML = $this->_objZip->getFromName('word/document.xml');
- } else {
- throw new PHPWord_Exception('Could not create temporary file with unique name in the default temporary directory.');
+ if ($this->_tempFileName === false) {
+ throw new Exception('Could not create temporary file with unique name in the default temporary directory.');
}
+
+ // Copy the source File to the temp File
+ if (!copy($strFilename, $this->_tempFileName)) {
+ throw new Exception("Could not copy the template from {$strFilename} to {$this->_tempFileName}.");
+ }
+
+ $this->_objZip = new ZipArchive();
+ $this->_objZip->open($this->_tempFileName);
+
+ $this->_documentXML = $this->_objZip->getFromName('word/document.xml');
}
/**
* Applies XSL style sheet to template's parts
*
- * @param DOMDocument &$xslDOMDocument
- * @param array $xslOptions = array()
- * @param string $xslOptionsURI = ''
+ * @param DOMDocument $xslDOMDocument
+ * @param array $xslOptions
+ * @param string $xslOptionsURI
+ * @throws Exception
*/
public function applyXslStyleSheet(&$xslDOMDocument, $xslOptions = array(), $xslOptionsURI = '')
{
- $processor = new \XSLTProcessor();
+ $processor = new XSLTProcessor();
$processor->importStylesheet($xslDOMDocument);
if ($processor->setParameter($xslOptionsURI, $xslOptions) === false) {
- throw new \Exception('Could not set values for the given XSL style sheet parameters.');
+ throw new Exception('Could not set values for the given XSL style sheet parameters.');
}
- $xmlDOMDocument = new \DOMDocument();
+ $xmlDOMDocument = new DOMDocument();
if ($xmlDOMDocument->loadXML($this->_documentXML) === false) {
- throw new \Exception('Could not load XML from the given template.');
+ throw new Exception('Could not load XML from the given template.');
}
$xmlTransformed = $processor->transformToXml($xmlDOMDocument);
if ($xmlTransformed === false) {
- throw new \Exception('Could not transform the given XML document.');
+ throw new Exception('Could not transform the given XML document.');
}
$this->_documentXML = $xmlTransformed;
@@ -155,7 +159,9 @@ class PHPWord_Template
/**
* Find the start position of the nearest table row before $offset
*
- * @param mixed $offset
+ * @param int $offset
+ * @return int
+ * @throws Exception
*/
private function _findRowStart($offset)
{
@@ -165,7 +171,6 @@ class PHPWord_Template
}
if (!$rowStart) {
throw new Exception("Can not find the start position of the row to clone.");
- return false;
}
return $rowStart;
}
@@ -173,7 +178,8 @@ class PHPWord_Template
/**
* Find the end position of the nearest table row after $offset
*
- * @param mixed $offset
+ * @param int $offset
+ * @return int
*/
private function _findRowEnd($offset)
{
@@ -184,7 +190,9 @@ class PHPWord_Template
/**
* Get a slice of a string
*
- * @param mixed $offset
+ * @param int $startPosition
+ * @param int $endPosition
+ * @return string
*/
private function _getSlice($startPosition, $endPosition = 0)
{
@@ -197,32 +205,32 @@ class PHPWord_Template
/**
* Clone a table row in a template document
*
- * @param mixed $search
- * @param mixed $numberOfClones
+ * @param string $search
+ * @param int $numberOfClones
+ * @throws Exception
*/
public function cloneRow($search, $numberOfClones)
{
if (substr($search, 0, 2) !== '${' && substr($search, -1) !== '}') {
- $search = '${'.$search.'}';
+ $search = '${' . $search . '}';
}
$tagPos = strpos($this->_documentXML, $search);
if (!$tagPos) {
throw new Exception("Can not clone row, template variable not found or variable contains markup.");
- return false;
}
$rowStart = $this->_findRowStart($tagPos);
- $rowEnd = $this->_findRowEnd($tagPos);
- $xmlRow = $this->_getSlice($rowStart, $rowEnd);
+ $rowEnd = $this->_findRowEnd($tagPos);
+ $xmlRow = $this->_getSlice($rowStart, $rowEnd);
// Check if there's a cell spanning multiple rows.
if (preg_match('##', $xmlRow)) {
- $extraRowStart = $rowEnd;
- $extraRowEnd = $rowEnd;
+ $extraRowStart = $rowEnd;
+ $extraRowEnd = $rowEnd;
while (true) {
- $extraRowStart = $this->_findRowStart($extraRowEnd + 1);
- $extraRowEnd = $this->_findRowEnd($extraRowEnd + 1);
+ $extraRowStart = $this->_findRowStart($extraRowEnd + 1);
+ $extraRowEnd = $this->_findRowEnd($extraRowEnd + 1);
// If extraRowEnd is lower then 7, there was no next row found.
if ($extraRowEnd < 7) {
@@ -230,7 +238,7 @@ class PHPWord_Template
}
// If tmpXmlRow doesn't contain continue, this row is no longer part of the spanned row.
- $tmpXmlRow = $this->_getSlice($extraRowStart, $extraRowEnd);
+ $tmpXmlRow = $this->_getSlice($extraRowStart, $extraRowEnd);
if (!preg_match('##', $tmpXmlRow) && !preg_match('##', $tmpXmlRow)) {
break;
}
@@ -242,7 +250,7 @@ class PHPWord_Template
$result = $this->_getSlice(0, $rowStart);
for ($i = 1; $i <= $numberOfClones; $i++) {
- $result .= preg_replace('/\$\{(.*?)\}/', '\${\\1#'.$i.'}', $xmlRow);
+ $result .= preg_replace('/\$\{(.*?)\}/', '\${\\1#' . $i . '}', $xmlRow);
}
$result .= $this->_getSlice($rowEnd);
@@ -253,6 +261,7 @@ class PHPWord_Template
* Save Template
*
* @return string
+ * @throws Exception
*/
public function save()
{
@@ -281,4 +290,4 @@ class PHPWord_Template
rename($tempFilename, $strFilename);
}
-}
+}
\ No newline at end of file
diff --git a/Tests/PHPWord/Exceptions/ExceptionTest.php b/Tests/PHPWord/Exceptions/ExceptionTest.php
new file mode 100644
index 00000000..a403aa28
--- /dev/null
+++ b/Tests/PHPWord/Exceptions/ExceptionTest.php
@@ -0,0 +1,16 @@
+assertAttributeEquals(array(), '_searchLocations', 'PHPWord_IOFactory');
}
- /**
- * @expectedException Exception
- * @expectedExceptionMessage Invalid parameter passed.
- */
- public function testSetSearchLocationsWithNotArray()
- {
- PHPWord_IOFactory::setSearchLocations('String');
- }
-
public function testAddSearchLocation()
{
PHPWord_IOFactory::setSearchLocations(array());
@@ -69,4 +60,4 @@ class IOFactoryTest extends \PHPUnit_Framework_TestCase
new PHPWord_Writer_Word2007($oPHPWord)
);
}
-}
+}
\ No newline at end of file
From f4d7fa427d179355ba26383ab904c049737b80d1 Mon Sep 17 00:00:00 2001
From: Gabriel Bull
Date: Sat, 15 Mar 2014 09:45:57 -0400
Subject: [PATCH 04/85] Added PHP 5.6 to travis-ci and removed namespace
checking before we make the change to namespaces
---
.travis.yml | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 99f33a20..56133049 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,12 +1,15 @@
language: php
+
php:
- 5.3
- 5.4
- 5.5
- ## @reference https://github.com/travis-ci/travis-ci/issues/1749
+ - 5.6
- hhvm
+
matrix:
allow_failures:
+ - php: 5.6
- php: hhvm
before_script:
@@ -30,8 +33,8 @@ before_script:
script:
## PHP_CodeSniffer
- - phpcs --standard=PSR1 Classes/
- - phpcs --standard=PSR2 Classes/
+ ## - phpcs --standard=PSR1 Classes/
+ ## - phpcs --standard=PSR2 Classes/
## PHP Copy/Paste Detector
- php phpcpd.phar --verbose Classes/
## PHP Mess Detector
@@ -40,7 +43,3 @@ script:
- php phploc.phar Classes/
## PHPUnit
- phpunit -c ./ --coverage-text
-
-notifications:
- email:
- - progi1984@gmail.com
From 59eec587fce55519edb3295fe4379aaad823e4f9 Mon Sep 17 00:00:00 2001
From: Ivan Lanin
Date: Sat, 15 Mar 2014 22:39:57 +0700
Subject: [PATCH 05/85] Convert samples
---
samples/Sample_01_SimpleText.php | 9 +--
samples/Sample_02_TabStops.php | 9 +--
samples/Sample_03_Sections.php | 9 +--
samples/Sample_04_Textrun.php | 9 +--
samples/Sample_05_Multicolumn.php | 9 +--
samples/Sample_06_Footnote.php | 9 +--
samples/Sample_07_TemplateCloneRow.php | 11 +---
samples/Sample_08_ParagraphPagination.php | 9 +--
samples/Sample_09_Tables.php | 9 +--
samples/Sample_10_EastAsianFontStyle.php | 9 +--
samples/Sample_11_ReadWord2007.php | 9 +--
samples/Sample_12_HeaderFooter.php | 9 +--
samples/Sample_13_Images.php | 10 +---
samples/Sample_14_ListItem.php | 10 +---
samples/Sample_15_Link.php | 10 +---
samples/Sample_16_Object.php | 10 +---
samples/Sample_17_TitleTOC.php | 12 +---
samples/Sample_18_Watermark.php | 12 +---
samples/Sample_19_TextBreak.php | 12 +---
samples/Sample_Footer.php | 33 +++++++++++
samples/Sample_Header.php | 68 +++++++++++++++++++++++
samples/bootstrap/css/bootstrap.min.css | 9 +++
samples/bootstrap/css/phpword.css | 8 +++
samples/bootstrap/js/bootstrap.min.js | 9 +++
samples/bootstrap/js/jquery.min.js | 6 ++
samples/index.php | 15 +++++
26 files changed, 190 insertions(+), 144 deletions(-)
create mode 100644 samples/Sample_Footer.php
create mode 100644 samples/Sample_Header.php
create mode 100644 samples/bootstrap/css/bootstrap.min.css
create mode 100644 samples/bootstrap/css/phpword.css
create mode 100644 samples/bootstrap/js/bootstrap.min.js
create mode 100644 samples/bootstrap/js/jquery.min.js
create mode 100644 samples/index.php
diff --git a/samples/Sample_01_SimpleText.php b/samples/Sample_01_SimpleText.php
index 10f129db..a6d593ec 100755
--- a/samples/Sample_01_SimpleText.php
+++ b/samples/Sample_01_SimpleText.php
@@ -1,8 +1,5 @@
');
-require_once '../Classes/PHPWord.php';
+include_once 'Sample_Header.php';
// New Word Document
echo date('H:i:s') , " Create new PHPWord object" , EOL;
@@ -57,6 +54,4 @@ foreach ($writers as $writer => $extension) {
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
}
-// Done
-echo date('H:i:s'), " Done writing file(s)", EOL;
-echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
+include_once 'Sample_Footer.php';
diff --git a/samples/Sample_02_TabStops.php b/samples/Sample_02_TabStops.php
index e9e2d84b..dc0fea42 100755
--- a/samples/Sample_02_TabStops.php
+++ b/samples/Sample_02_TabStops.php
@@ -1,8 +1,5 @@
');
-require_once '../Classes/PHPWord.php';
+include_once 'Sample_Header.php';
// New Word Document
echo date('H:i:s') , ' Create new PHPWord object' , EOL;
@@ -45,6 +42,4 @@ foreach ($writers as $writer => $extension) {
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
}
-// Done
-echo date('H:i:s'), " Done writing file(s)", EOL;
-echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
+include_once 'Sample_Footer.php';
diff --git a/samples/Sample_03_Sections.php b/samples/Sample_03_Sections.php
index 1e49629e..383bf4e7 100755
--- a/samples/Sample_03_Sections.php
+++ b/samples/Sample_03_Sections.php
@@ -1,8 +1,5 @@
');
-require_once '../Classes/PHPWord.php';
+include_once 'Sample_Header.php';
// New Word Document
echo date('H:i:s') , ' Create new PHPWord object' , EOL;
@@ -38,6 +35,4 @@ foreach ($writers as $writer => $extension) {
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
}
-// Done
-echo date('H:i:s'), " Done writing file(s)", EOL;
-echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
+include_once 'Sample_Footer.php';
diff --git a/samples/Sample_04_Textrun.php b/samples/Sample_04_Textrun.php
index b30db7a5..d3e577bd 100644
--- a/samples/Sample_04_Textrun.php
+++ b/samples/Sample_04_Textrun.php
@@ -1,8 +1,5 @@
');
-require_once '../Classes/PHPWord.php';
+include_once 'Sample_Header.php';
// New Word Document
echo date('H:i:s') , ' Create new PHPWord object' , EOL;
@@ -45,6 +42,4 @@ foreach ($writers as $writer => $extension) {
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
}
-// Done
-echo date('H:i:s'), " Done writing file(s)", EOL;
-echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
+include_once 'Sample_Footer.php';
diff --git a/samples/Sample_05_Multicolumn.php b/samples/Sample_05_Multicolumn.php
index 3877defe..e636f8ad 100644
--- a/samples/Sample_05_Multicolumn.php
+++ b/samples/Sample_05_Multicolumn.php
@@ -1,8 +1,5 @@
');
-require_once '../Classes/PHPWord.php';
+include_once 'Sample_Header.php';
// New Word Document
echo date('H:i:s') , " Create new PHPWord object" , EOL;
@@ -48,6 +45,4 @@ foreach ($writers as $writer => $extension) {
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
}
-// Done
-echo date('H:i:s'), " Done writing file(s)", EOL;
-echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
+include_once 'Sample_Footer.php';
diff --git a/samples/Sample_06_Footnote.php b/samples/Sample_06_Footnote.php
index daaa6b46..3c52cfcf 100755
--- a/samples/Sample_06_Footnote.php
+++ b/samples/Sample_06_Footnote.php
@@ -1,8 +1,5 @@
');
-require_once '../Classes/PHPWord.php';
+include_once 'Sample_Header.php';
// New Word Document
echo date('H:i:s') , " Create new PHPWord object" , EOL;
@@ -46,6 +43,4 @@ foreach ($writers as $writer => $extension) {
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
}
-// Done
-echo date('H:i:s'), " Done writing file(s)", EOL;
-echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
+include_once 'Sample_Footer.php';
diff --git a/samples/Sample_07_TemplateCloneRow.php b/samples/Sample_07_TemplateCloneRow.php
index f797b986..e322001e 100755
--- a/samples/Sample_07_TemplateCloneRow.php
+++ b/samples/Sample_07_TemplateCloneRow.php
@@ -1,8 +1,5 @@
');
-require_once '../Classes/PHPWord.php';
+include_once 'Sample_Header.php';
// New Word document
echo date('H:i:s') , " Create new PHPWord object" , EOL;
@@ -56,11 +53,9 @@ $document->setValue('userFirstName#3', 'Michael');
$document->setValue('userName#3', 'Ray');
$document->setValue('userPhone#3', '+1 428 889 775');
-$name = 'Sample_07_TemplateCloneRow_result.docx';
+$name = 'Sample_07_TemplateCloneRow.docx';
echo date('H:i:s'), " Write to Word2007 format", EOL;
$document->saveAs($name);
rename($name, "results/{$name}");
-// Done
-echo date('H:i:s'), " Done writing file(s)", EOL;
-echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
+include_once 'Sample_Footer.php';
diff --git a/samples/Sample_08_ParagraphPagination.php b/samples/Sample_08_ParagraphPagination.php
index edd1992c..79879ad1 100644
--- a/samples/Sample_08_ParagraphPagination.php
+++ b/samples/Sample_08_ParagraphPagination.php
@@ -1,8 +1,5 @@
');
-require_once '../Classes/PHPWord.php';
+include_once 'Sample_Header.php';
// New Word document
echo date('H:i:s') , " Create new PHPWord object" , EOL;
@@ -58,6 +55,4 @@ foreach ($writers as $writer => $extension) {
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
}
-// Done
-echo date('H:i:s'), " Done writing file(s)", EOL;
-echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
+include_once 'Sample_Footer.php';
diff --git a/samples/Sample_09_Tables.php b/samples/Sample_09_Tables.php
index 96e411a0..62e50457 100644
--- a/samples/Sample_09_Tables.php
+++ b/samples/Sample_09_Tables.php
@@ -1,8 +1,5 @@
');
-require_once '../Classes/PHPWord.php';
+include_once 'Sample_Header.php';
// New Word Document
echo date('H:i:s') , ' Create new PHPWord object' , EOL;
@@ -86,6 +83,4 @@ foreach ($writers as $writer => $extension) {
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
}
-// Done
-echo date('H:i:s'), " Done writing file(s)", EOL;
-echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
+include_once 'Sample_Footer.php';
diff --git a/samples/Sample_10_EastAsianFontStyle.php b/samples/Sample_10_EastAsianFontStyle.php
index 8be72109..164cf495 100644
--- a/samples/Sample_10_EastAsianFontStyle.php
+++ b/samples/Sample_10_EastAsianFontStyle.php
@@ -1,8 +1,5 @@
');
-require_once '../Classes/PHPWord.php';
+include_once 'Sample_Header.php';
// New Word Document
echo date('H:i:s') , ' Create new PHPWord object' , EOL;
@@ -22,6 +19,4 @@ foreach ($writers as $writer => $extension) {
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
}
-// Done
-echo date('H:i:s'), " Done writing file(s)", EOL;
-echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
+include_once 'Sample_Footer.php';
diff --git a/samples/Sample_11_ReadWord2007.php b/samples/Sample_11_ReadWord2007.php
index d96e9264..fff10572 100644
--- a/samples/Sample_11_ReadWord2007.php
+++ b/samples/Sample_11_ReadWord2007.php
@@ -1,8 +1,5 @@
');
-require_once '../Classes/PHPWord.php';
+include_once 'Sample_Header.php';
// Read contents
$name = basename(__FILE__, '.php');
@@ -19,6 +16,4 @@ foreach ($writers as $writer => $extension) {
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
}
-// Done
-echo date('H:i:s'), " Done writing file(s)", EOL;
-echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
+include_once 'Sample_Footer.php';
diff --git a/samples/Sample_12_HeaderFooter.php b/samples/Sample_12_HeaderFooter.php
index b0d0e137..367076c6 100644
--- a/samples/Sample_12_HeaderFooter.php
+++ b/samples/Sample_12_HeaderFooter.php
@@ -1,8 +1,5 @@
');
-require_once '../Classes/PHPWord.php';
+include_once 'Sample_Header.php';
// New Word document
echo date('H:i:s') , " Create new PHPWord object" , EOL;
@@ -69,6 +66,4 @@ foreach ($writers as $writer => $extension) {
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
}
-// Done
-echo date('H:i:s'), " Done writing file(s)", EOL;
-echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
+include_once 'Sample_Footer.php';
diff --git a/samples/Sample_13_Images.php b/samples/Sample_13_Images.php
index 0f64cb7b..e0f94323 100644
--- a/samples/Sample_13_Images.php
+++ b/samples/Sample_13_Images.php
@@ -2,11 +2,7 @@
/**
* Image creation
*/
-
-// Init
-error_reporting(E_ALL);
-define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '
');
-require_once '../Classes/PHPWord.php';
+include_once 'Sample_Header.php';
// New Word document
echo date('H:i:s'), " Create new PHPWord object", EOL;
@@ -37,6 +33,4 @@ foreach ($writers as $writer => $extension) {
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
}
-// Done
-echo date('H:i:s'), " Done writing file(s)", EOL;
-echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
+include_once 'Sample_Footer.php';
diff --git a/samples/Sample_14_ListItem.php b/samples/Sample_14_ListItem.php
index fa648784..40fcea9e 100644
--- a/samples/Sample_14_ListItem.php
+++ b/samples/Sample_14_ListItem.php
@@ -2,11 +2,7 @@
/**
* List item sample
*/
-
-// Init
-error_reporting(E_ALL);
-define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '
');
-require_once '../Classes/PHPWord.php';
+include_once 'Sample_Header.php';
// New Word document
echo date('H:i:s'), " Create new PHPWord object", EOL;
@@ -61,6 +57,4 @@ foreach ($writers as $writer => $extension) {
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
}
-// Done
-echo date('H:i:s'), " Done writing file(s)", EOL;
-echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
+include_once 'Sample_Footer.php';
diff --git a/samples/Sample_15_Link.php b/samples/Sample_15_Link.php
index ef631906..8fcd1816 100644
--- a/samples/Sample_15_Link.php
+++ b/samples/Sample_15_Link.php
@@ -2,11 +2,7 @@
/**
* Link sample
*/
-
-// Init
-error_reporting(E_ALL);
-define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '
');
-require_once '../Classes/PHPWord.php';
+include_once 'Sample_Header.php';
// New Word document
echo date('H:i:s'), " Create new PHPWord object", EOL;
@@ -35,6 +31,4 @@ foreach ($writers as $writer => $extension) {
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
}
-// Done
-echo date('H:i:s'), " Done writing file(s)", EOL;
-echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
+include_once 'Sample_Footer.php';
diff --git a/samples/Sample_16_Object.php b/samples/Sample_16_Object.php
index e04c49e5..dda23be2 100644
--- a/samples/Sample_16_Object.php
+++ b/samples/Sample_16_Object.php
@@ -2,11 +2,7 @@
/**
* Object sample
*/
-
-// Init
-error_reporting(E_ALL);
-define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '
');
-require_once '../Classes/PHPWord.php';
+include_once 'Sample_Header.php';
// New Word document
echo date('H:i:s'), " Create new PHPWord object", EOL;
@@ -30,6 +26,4 @@ foreach ($writers as $writer => $extension) {
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
}
-// Done
-echo date('H:i:s'), " Done writing file(s)", EOL;
-echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
+include_once 'Sample_Footer.php';
diff --git a/samples/Sample_17_TitleTOC.php b/samples/Sample_17_TitleTOC.php
index efa756e4..3edf03e0 100644
--- a/samples/Sample_17_TitleTOC.php
+++ b/samples/Sample_17_TitleTOC.php
@@ -1,12 +1,8 @@
');
-require_once '../Classes/PHPWord.php';
+include_once 'Sample_Header.php';
// New Word document
echo date('H:i:s'), " Create new PHPWord object", EOL;
@@ -62,6 +58,4 @@ foreach ($writers as $writer => $extension) {
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
}
-// Done
-echo date('H:i:s'), " Done writing file(s)", EOL;
-echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
+include_once 'Sample_Footer.php';
diff --git a/samples/Sample_18_Watermark.php b/samples/Sample_18_Watermark.php
index 8332bd03..df1d581a 100644
--- a/samples/Sample_18_Watermark.php
+++ b/samples/Sample_18_Watermark.php
@@ -1,12 +1,8 @@
');
-require_once '../Classes/PHPWord.php';
+include_once 'Sample_Header.php';
// New Word document
echo date('H:i:s'), " Create new PHPWord object", EOL;
@@ -31,6 +27,4 @@ foreach ($writers as $writer => $extension) {
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
}
-// Done
-echo date('H:i:s'), " Done writing file(s)", EOL;
-echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
+include_once 'Sample_Footer.php';
diff --git a/samples/Sample_19_TextBreak.php b/samples/Sample_19_TextBreak.php
index 17299601..6aad699f 100644
--- a/samples/Sample_19_TextBreak.php
+++ b/samples/Sample_19_TextBreak.php
@@ -1,12 +1,8 @@
');
-require_once '../Classes/PHPWord.php';
+include_once 'Sample_Header.php';
// New Word document
echo date('H:i:s'), " Create new PHPWord object", EOL;
@@ -44,6 +40,4 @@ foreach ($writers as $writer => $extension) {
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
}
-// Done
-echo date('H:i:s'), " Done writing file(s)", EOL;
-echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
+include_once 'Sample_Footer.php';
diff --git a/samples/Sample_Footer.php b/samples/Sample_Footer.php
new file mode 100644
index 00000000..2bff9273
--- /dev/null
+++ b/samples/Sample_Footer.php
@@ -0,0 +1,33 @@
+
';
+ echo 'Results: ';
+ foreach ($types as $type) {
+ $result = "results/{$sampleFile}.{$type}";
+ if (file_exists($result)) {
+ echo "{$type} ";
+ }
+ }
+ echo '
';
+?>
+
+
+
+