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 81767f6bfb..5bb99634fd 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 d603eecd0a..79d506c4d0 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 0000000000..bd38cd5d9d
--- /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 0000000000..9908b2b726
--- /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 0614cee094..43ba3e7ea7 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 74d1a50022..aa36efc88b 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 3fc097b4e0..1e64adf402 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 91b5d54f22..d6a90510d9 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 81b64049b8..33860bbf91 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 22c602b8ca..5db4b8c051 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 aac0be877c..aa2e798c0b 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 8229413216..0332818460 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 18392f8bb8..8c185cb2ae 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 f51eed77bd..703db57620 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 4d372f2717..b217a01874 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 95bb9db00c..07a17a31b9 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 ae2e21194c..238bae1b07 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 b162977066..7244374386 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 7b2159e46e..652a3873f3 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 e2f5b2be3d..5e1c6bfe73 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 a8fcde46e8..fcaa1cc9ab 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 42b9d7b37d..620b08a1bf 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 ac5263b3fd..83384a9490 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 f1488c4543..9d4ed97c0e 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 acf14e5533..33d8cad9bc 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 35f8b5c014..76536304cb 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 38af6410c5..1ff3bf64cc 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 dd93c95ee3..f5a8a79900 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 983f4a2451..f8d6d3400b 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 d174ef8f46..dd8ea65c12 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 296084e648..8631b66e1a 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 0438bd4fc7..85f53edc9d 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 a708a1197f..fcb2bd482b 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 8dd5f1c353..067370f2f2 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 af400551c3..241694f649 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 064e6fcc6d..9930b44ee5 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 3e3e147d06..26a206ba6a 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 9e6dc44f9f..3bb783b879 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 64abdf1d8d..0f0d072196 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 91a9d53079..6e6e636058 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 bfdc791b17..fe4ff372d3 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 060ce1be73..8366b6583b 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 10d4a9be23..b07eb4c237 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 bc5ee511e8..f26f392468 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 4453463a38..9bec4d5bd7 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 9429b47e64..5fbff0d6fb 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 754589cb39..32a44929bf 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 c7140d5897..93b5f86265 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 e7adfc41df..482ae868fe 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 f8ee4b9b8e..8db7abae17 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 5f4f60c1ab..c3ef2e0140 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 11f094e076..573ae53b66 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 144d2a5d01..a5e1a8bba1 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 ae514a54d1..c81fca228e 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 840d22950a..9db3edba96 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 eb561d1b00..f5ca82992b 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 6ec25cbaac..7d8c2e4b20 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 c33635cc2b..0899990b16 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 c3c2898121..89e802dc61 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 79624d8220..5397861496 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 def40db4e0..af3b33485b 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 7f38880942..b5f87332d6 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 1e05cd5081..c65269a2c5 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 80889ebe78..a090fb175c 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 bd574eb202..e62341bf9a 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 4bb8908db3..e9249120e5 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 eeaeb84dba..8a6e39ef85 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 be63341967..2e8f8b5a63 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 9991179d5c..abdd92cc75 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 e5aaffbd45..9817a31fa9 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 f9b4763e5f..6ee18d66c7 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 fe7ced0ed9..28d087c7d2 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 6c81b3c95e..0e562b593a 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 6bb6f7844e..59eebd9178 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 97f28d2225..06eb59cc9f 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 c87d94bfa2..3724323e10 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 91a863e01b..cc004254f3 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 | 81 +++++++++-------
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, 212 insertions(+), 207 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 43ba3e7ea7..d591b94ecf 100755
--- a/Classes/PHPWord.php
+++ b/Classes/PHPWord.php
@@ -34,6 +34,8 @@
}
// @codeCoverageIgnoreEnd
+use PhpOffice\PhpWord\Exceptions\Exception;
+
/**
* PHPWord
*/
@@ -252,17 +254,15 @@ public function getSections()
*
* @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 d6a90510d9..0000000000
--- 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 0000000000..11cb05168f
--- /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 8c185cb2ae..ba7f6565c1 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 @@ public function getReadDataOnly()
/**
* 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 @@ public function setReadDataOnly($pValue = true)
* 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 @@ public function canRead($pFilename)
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 b217a01874..1aa94f86aa 100644
--- a/Classes/PHPWord/Reader/Word2007.php
+++ b/Classes/PHPWord/Reader/Word2007.php
@@ -31,32 +31,25 @@
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 @@ public function canRead($pFilename)
/**
* 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 @@ public function getFromZipArchive(
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 @@ public function load($pFilename)
$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 @@ public function load($pFilename)
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 @@ public function load($pFilename)
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 @@ public function load($pFilename)
$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 @@ public function load($pFilename)
);
}
}
- // No, it's a textbreak
+ // No, it's a textbreak
} else {
$section->addTextBreak();
}
@@ -282,8 +272,8 @@ public function load($pFilename)
/**
* 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 @@ private function loadSectionSettings($elm)
}
}
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 @@ private function loadParagraphStyle($elm)
$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 @@ private function loadFontStyle($elm)
}
}
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 07a17a31b9..a9402dab72 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 @@ public function __construct($sectionCount, $settings = null)
/**
* Set Section Settings
*
- * @param array $settings
+ * @param array $settings
*/
public function setSettings($settings = null)
{
@@ -157,8 +158,8 @@ public function addLink($linkSrc, $linkName = null, $styleFont = null, $stylePar
* 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 @@ public function addListItem($text, $depth = 0, $styleFont = null, $styleList = n
* @param string $src
* @param mixed $style
* @return PHPWord_Section_Object
+ * @throws Exception
*/
public function addObject($src, $style = null)
{
@@ -244,11 +246,8 @@ public function addObject($src, $style = null)
$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 @@ public function addObject($src, $style = null)
* @param string $src
* @param mixed $style
* @return PHPWord_Section_Image
+ * @throws Exception
*/
public function addImage($src, $style = null)
{
@@ -268,11 +268,8 @@ public function addImage($src, $style = null)
$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 @@ public function addImage($src, $style = null)
* @param string $link
* @param mixed $style
* @return PHPWord_Section_MemoryImage
+ * @throws Exception
*/
public function addMemoryImage($link, $style = null)
{
@@ -291,11 +289,8 @@ public function addMemoryImage($link, $style = null)
$this->_elementCollection[] = $memoryImage;
return $memoryImage;
- } else {
- throw new PHPWord_Exception(
- 'Unsupported image type.'
- );
}
+ throw new Exception('Unsupported image type.');
}
/**
@@ -347,6 +342,7 @@ public function addTitle($text, $depth = 1)
/**
* Create a new TextRun
*
+ * @param mixed $styleParagraph
* @return PHPWord_Section_TextRun
*/
public function createTextRun($styleParagraph = null)
@@ -430,7 +426,7 @@ public function getFooter()
/**
* Create a new Footnote Element
*
- * @param string $text
+ * @param mixed $styleParagraph
* @return PHPWord_Section_Footnote
*/
public function createFootnote($styleParagraph = null)
@@ -441,4 +437,4 @@ public function createFootnote($styleParagraph = null)
$this->_elementCollection[] = $footnote;
return $footnote;
}
-}
+}
\ No newline at end of file
diff --git a/Classes/PHPWord/Settings.php b/Classes/PHPWord/Settings.php
index 241694f649..0869f215fe 100644
--- a/Classes/PHPWord/Settings.php
+++ b/Classes/PHPWord/Settings.php
@@ -50,8 +50,7 @@ public static function setCompatibility($compatibility)
return true;
}
return false;
- } // function setCompatibility()
-
+ }
/**
* Return the compatibility option used by the XMLWriter
@@ -61,5 +60,5 @@ public static function setCompatibility($compatibility)
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 9db3edba96..752fa79222 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);
+ if ($this->_tempFileName === false) {
+ throw new Exception('Could not create temporary file with unique name in the default temporary directory.');
+ }
- $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.');
+ // 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 @@ public function getVariables()
/**
* 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 @@ private function _findRowStart($offset)
}
if (!$rowStart) {
throw new Exception("Can not find the start position of the row to clone.");
- return false;
}
return $rowStart;
}
@@ -173,7 +178,8 @@ private function _findRowStart($offset)
/**
* 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 @@ private function _findRowEnd($offset)
/**
* 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 @@ private function _getSlice($startPosition, $endPosition = 0)
/**
* 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 @@ public function cloneRow($search, $numberOfClones)
}
// 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 @@ public function cloneRow($search, $numberOfClones)
$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 @@ public function cloneRow($search, $numberOfClones)
* Save Template
*
* @return string
+ * @throws Exception
*/
public function save()
{
@@ -281,4 +290,4 @@ public function saveAs($strFilename)
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 0000000000..a403aa28e6
--- /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 @@ public function testCreateWriter()
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 99f33a2065..5613304904 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 10f129dbfa..a6d593ec2f 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 @@
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 e9e2d84bcb..dc0fea42ff 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 @@
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 1e49629e9c..383bf4e782 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 @@
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 b30db7a56f..d3e577bd6c 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 @@
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 3877defeff..e636f8ad76 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 @@
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 daaa6b4636..3c52cfcfeb 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 @@
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 f797b986e5..e322001e74 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('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 edd1992c43..79879ad12e 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 @@
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 96e411a020..62e5045759 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 @@
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 8be721091c..164cf4950c 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 @@
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 d96e92644c..fff1057263 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 @@
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 b0d0e13792..367076c681 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 @@
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 0f64cb7bb8..e0f943239f 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 @@
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 fa64878407..40fcea9e0a 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 @@
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 ef631906d9..8fcd181651 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 @@
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 e04c49e54d..dda23be2ff 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 @@
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 efa756e4df..3edf03e00b 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 @@
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 8332bd0330..df1d581a2e 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 @@
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 17299601c6..6aad699f77 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 @@
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 0000000000..2bff9273ab
--- /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 '
';
+?>
+
+
+
+