From 364131aa5d56b07b3a03936c4f4502be54029d44 Mon Sep 17 00:00:00 2001 From: Bas-Jan 't Jong Date: Wed, 7 May 2014 21:27:51 +0200 Subject: [PATCH] Added TextBox functionality --- .gitignore | 1 - .scrutinizer.yml | 14 + .travis.yml | 2 +- CHANGELOG.md | 4 +- README.md | 71 +- composer.json | 2 +- composer.lock | 3107 +++++++++++++++++ docs/intro.rst | 37 +- docs/references.rst | 14 +- docs/src/documentation.md | 30 +- samples/Sample_12_HeaderFooter.php | 1 + samples/Sample_13_Images.php | 31 + src/PhpWord/Autoloader.php | 12 +- src/PhpWord/Collection/AbstractCollection.php | 12 +- src/PhpWord/Collection/Endnotes.php | 12 +- src/PhpWord/Collection/Footnotes.php | 12 +- src/PhpWord/Collection/Titles.php | 12 +- src/PhpWord/DocumentProperties.php | 12 +- src/PhpWord/Element/AbstractContainer.php | 23 +- src/PhpWord/Element/AbstractElement.php | 18 +- src/PhpWord/Element/Cell.php | 12 +- src/PhpWord/Element/CheckBox.php | 12 +- src/PhpWord/Element/Endnote.php | 12 +- src/PhpWord/Element/Footer.php | 29 +- src/PhpWord/Element/Footnote.php | 12 +- src/PhpWord/Element/Header.php | 12 +- src/PhpWord/Element/Image.php | 12 +- src/PhpWord/Element/Link.php | 12 +- src/PhpWord/Element/ListItem.php | 12 +- src/PhpWord/Element/Object.php | 14 +- src/PhpWord/Element/PageBreak.php | 12 +- src/PhpWord/Element/PreserveText.php | 12 +- src/PhpWord/Element/Row.php | 12 +- src/PhpWord/Element/Section.php | 31 +- src/PhpWord/Element/TOC.php | 12 +- src/PhpWord/Element/Table.php | 12 +- src/PhpWord/Element/Text.php | 12 +- src/PhpWord/Element/TextBox.php | 57 + src/PhpWord/Element/TextBreak.php | 12 +- src/PhpWord/Element/TextRun.php | 12 +- src/PhpWord/Element/Title.php | 14 +- src/PhpWord/Exception/Exception.php | 12 +- .../Exception/InvalidImageException.php | 12 +- .../Exception/InvalidObjectException.php | 12 +- .../Exception/InvalidStyleException.php | 12 +- .../UnsupportedImageTypeException.php | 12 +- src/PhpWord/IOFactory.php | 12 +- src/PhpWord/Media.php | 12 +- src/PhpWord/PhpWord.php | 14 +- src/PhpWord/Reader/AbstractReader.php | 12 +- src/PhpWord/Reader/ODText.php | 12 +- src/PhpWord/Reader/ODText/AbstractPart.php | 12 +- src/PhpWord/Reader/ODText/Content.php | 12 +- src/PhpWord/Reader/ReaderInterface.php | 12 +- src/PhpWord/Reader/Word2007.php | 12 +- src/PhpWord/Reader/Word2007/AbstractPart.php | 12 +- src/PhpWord/Reader/Word2007/DocPropsApp.php | 12 +- src/PhpWord/Reader/Word2007/DocPropsCore.php | 12 +- .../Reader/Word2007/DocPropsCustom.php | 12 +- src/PhpWord/Reader/Word2007/Document.php | 12 +- src/PhpWord/Reader/Word2007/Endnotes.php | 25 +- src/PhpWord/Reader/Word2007/Footnotes.php | 61 +- src/PhpWord/Reader/Word2007/Notes.php | 60 - src/PhpWord/Reader/Word2007/Numbering.php | 12 +- src/PhpWord/Reader/Word2007/Styles.php | 12 +- src/PhpWord/Settings.php | 12 +- src/PhpWord/Shared/Drawing.php | 12 +- src/PhpWord/Shared/Font.php | 12 +- src/PhpWord/Shared/String.php | 12 +- src/PhpWord/Shared/XMLReader.php | 12 +- src/PhpWord/Shared/XMLWriter.php | 12 +- src/PhpWord/Shared/ZipArchive.php | 12 +- src/PhpWord/Style.php | 12 +- src/PhpWord/Style/AbstractStyle.php | 12 +- src/PhpWord/Style/Border.php | 12 +- src/PhpWord/Style/Cell.php | 12 +- src/PhpWord/Style/Font.php | 12 +- src/PhpWord/Style/Image.php | 15 +- src/PhpWord/Style/Indentation.php | 12 +- src/PhpWord/Style/LineNumbering.php | 12 +- src/PhpWord/Style/ListItem.php | 12 +- src/PhpWord/Style/Numbering.php | 12 +- src/PhpWord/Style/NumberingLevel.php | 12 +- src/PhpWord/Style/Paragraph.php | 12 +- src/PhpWord/Style/Row.php | 12 +- src/PhpWord/Style/Section.php | 12 +- src/PhpWord/Style/Shading.php | 35 +- src/PhpWord/Style/Spacing.php | 12 +- src/PhpWord/Style/TOC.php | 22 +- src/PhpWord/Style/Tab.php | 12 +- src/PhpWord/Style/Table.php | 14 +- src/PhpWord/Style/TextBox.php | 641 ++++ src/PhpWord/Template.php | 12 +- src/PhpWord/Writer/AbstractWriter.php | 12 +- src/PhpWord/Writer/HTML.php | 12 +- src/PhpWord/Writer/HTML/Element/Element.php | 12 +- src/PhpWord/Writer/HTML/Element/Endnote.php | 12 +- src/PhpWord/Writer/HTML/Element/Footnote.php | 12 +- src/PhpWord/Writer/HTML/Element/Image.php | 12 +- src/PhpWord/Writer/HTML/Element/Link.php | 12 +- src/PhpWord/Writer/HTML/Element/ListItem.php | 12 +- src/PhpWord/Writer/HTML/Element/PageBreak.php | 12 +- src/PhpWord/Writer/HTML/Element/Table.php | 12 +- src/PhpWord/Writer/HTML/Element/Text.php | 12 +- src/PhpWord/Writer/HTML/Element/TextBreak.php | 12 +- src/PhpWord/Writer/HTML/Element/TextRun.php | 12 +- src/PhpWord/Writer/HTML/Element/Title.php | 12 +- .../Writer/HTML/Style/AbstractStyle.php | 12 +- src/PhpWord/Writer/HTML/Style/Font.php | 12 +- src/PhpWord/Writer/HTML/Style/Generic.php | 12 +- src/PhpWord/Writer/HTML/Style/Image.php | 12 +- src/PhpWord/Writer/HTML/Style/Paragraph.php | 12 +- src/PhpWord/Writer/ODText.php | 12 +- src/PhpWord/Writer/ODText/Element/Element.php | 12 +- src/PhpWord/Writer/ODText/Element/Image.php | 12 +- src/PhpWord/Writer/ODText/Element/Link.php | 12 +- src/PhpWord/Writer/ODText/Element/Table.php | 12 +- src/PhpWord/Writer/ODText/Element/Text.php | 12 +- .../Writer/ODText/Element/TextBreak.php | 12 +- src/PhpWord/Writer/ODText/Element/TextRun.php | 12 +- .../Writer/ODText/Part/AbstractPart.php | 12 +- src/PhpWord/Writer/ODText/Part/Content.php | 12 +- src/PhpWord/Writer/ODText/Part/Manifest.php | 12 +- src/PhpWord/Writer/ODText/Part/Meta.php | 12 +- src/PhpWord/Writer/ODText/Part/Mimetype.php | 12 +- src/PhpWord/Writer/ODText/Part/Styles.php | 12 +- .../Writer/ODText/Style/AbstractStyle.php | 12 +- src/PhpWord/Writer/ODText/Style/Font.php | 12 +- src/PhpWord/Writer/ODText/Style/Paragraph.php | 12 +- src/PhpWord/Writer/PDF.php | 12 +- src/PhpWord/Writer/PDF/AbstractRenderer.php | 12 +- src/PhpWord/Writer/PDF/DomPDF.php | 12 +- src/PhpWord/Writer/RTF.php | 12 +- src/PhpWord/Writer/RTF/Element/Element.php | 12 +- src/PhpWord/Writer/RTF/Element/Text.php | 12 +- src/PhpWord/Writer/RTF/Element/TextBreak.php | 12 +- src/PhpWord/Writer/RTF/Element/TextRun.php | 12 +- src/PhpWord/Writer/RTF/Element/Title.php | 12 +- src/PhpWord/Writer/Word2007.php | 12 +- .../Writer/Word2007/Element/CheckBox.php | 12 +- .../Writer/Word2007/Element/Element.php | 12 +- .../Writer/Word2007/Element/Endnote.php | 12 +- .../Writer/Word2007/Element/Footnote.php | 12 +- src/PhpWord/Writer/Word2007/Element/Image.php | 12 +- src/PhpWord/Writer/Word2007/Element/Link.php | 12 +- .../Writer/Word2007/Element/ListItem.php | 12 +- .../Writer/Word2007/Element/Object.php | 12 +- .../Writer/Word2007/Element/PageBreak.php | 12 +- .../Writer/Word2007/Element/PreserveText.php | 12 +- src/PhpWord/Writer/Word2007/Element/TOC.php | 12 +- src/PhpWord/Writer/Word2007/Element/Table.php | 12 +- src/PhpWord/Writer/Word2007/Element/Text.php | 12 +- .../Writer/Word2007/Element/TextBox.php | 72 + .../Writer/Word2007/Element/TextBreak.php | 12 +- .../Writer/Word2007/Element/TextRun.php | 12 +- src/PhpWord/Writer/Word2007/Element/Title.php | 12 +- .../Writer/Word2007/Part/AbstractPart.php | 21 +- .../Writer/Word2007/Part/ContentTypes.php | 12 +- src/PhpWord/Writer/Word2007/Part/DocProps.php | 12 +- src/PhpWord/Writer/Word2007/Part/Document.php | 12 +- src/PhpWord/Writer/Word2007/Part/Endnotes.php | 12 +- .../Writer/Word2007/Part/FontTable.php | 12 +- src/PhpWord/Writer/Word2007/Part/Footer.php | 33 +- .../Writer/Word2007/Part/Footnotes.php | 12 +- src/PhpWord/Writer/Word2007/Part/Header.php | 47 +- .../Writer/Word2007/Part/Numbering.php | 12 +- src/PhpWord/Writer/Word2007/Part/Rels.php | 12 +- src/PhpWord/Writer/Word2007/Part/Settings.php | 12 +- src/PhpWord/Writer/Word2007/Part/Styles.php | 12 +- src/PhpWord/Writer/Word2007/Part/Theme.php | 12 +- .../Writer/Word2007/Part/WebSettings.php | 12 +- .../Writer/Word2007/Style/AbstractStyle.php | 12 +- src/PhpWord/Writer/Word2007/Style/Cell.php | 12 +- src/PhpWord/Writer/Word2007/Style/Font.php | 12 +- src/PhpWord/Writer/Word2007/Style/Image.php | 12 +- .../Writer/Word2007/Style/Indentation.php | 12 +- .../Writer/Word2007/Style/LineNumbering.php | 12 +- .../Writer/Word2007/Style/MarginBorder.php | 12 +- .../Writer/Word2007/Style/Paragraph.php | 12 +- src/PhpWord/Writer/Word2007/Style/Section.php | 12 +- src/PhpWord/Writer/Word2007/Style/Shading.php | 12 +- src/PhpWord/Writer/Word2007/Style/Spacing.php | 12 +- src/PhpWord/Writer/Word2007/Style/Tab.php | 12 +- src/PhpWord/Writer/Word2007/Style/Table.php | 12 +- src/PhpWord/Writer/Word2007/Style/TextBox.php | 198 ++ src/PhpWord/Writer/WriterInterface.php | 12 +- tests/PhpWord/Tests/AutoloaderTest.php | 12 +- .../Tests/Collection/CollectionTest.php | 40 + .../PhpWord/Tests/DocumentPropertiesTest.php | 12 +- .../Tests/Element/AbstractElementTest.php | 12 +- tests/PhpWord/Tests/Element/CellTest.php | 12 +- tests/PhpWord/Tests/Element/CheckBoxTest.php | 12 +- tests/PhpWord/Tests/Element/FooterTest.php | 12 +- tests/PhpWord/Tests/Element/FootnoteTest.php | 12 +- tests/PhpWord/Tests/Element/HeaderTest.php | 12 +- tests/PhpWord/Tests/Element/ImageTest.php | 12 +- tests/PhpWord/Tests/Element/LinkTest.php | 12 +- tests/PhpWord/Tests/Element/ListItemTest.php | 12 +- tests/PhpWord/Tests/Element/ObjectTest.php | 12 +- tests/PhpWord/Tests/Element/PageBreakTest.php | 12 +- .../Tests/Element/PreserveTextTest.php | 12 +- tests/PhpWord/Tests/Element/RowTest.php | 12 +- tests/PhpWord/Tests/Element/SectionTest.php | 12 +- tests/PhpWord/Tests/Element/TOCTest.php | 25 +- tests/PhpWord/Tests/Element/TableTest.php | 12 +- tests/PhpWord/Tests/Element/TextBoxTest.php | 74 + tests/PhpWord/Tests/Element/TextBreakTest.php | 12 +- tests/PhpWord/Tests/Element/TextRunTest.php | 14 +- tests/PhpWord/Tests/Element/TextTest.php | 12 +- tests/PhpWord/Tests/Element/TitleTest.php | 12 +- .../PhpWord/Tests/Exception/ExceptionTest.php | 12 +- .../Exception/InvalidImageExceptionTest.php | 12 +- .../Exception/InvalidStyleExceptionTest.php | 12 +- .../UnsupportedImageTypeExceptionTest.php | 12 +- tests/PhpWord/Tests/IOFactoryTest.php | 12 +- tests/PhpWord/Tests/MediaTest.php | 12 +- tests/PhpWord/Tests/PhpWordTest.php | 13 +- tests/PhpWord/Tests/Reader/ODTextTest.php | 12 +- tests/PhpWord/Tests/Reader/Word2007Test.php | 12 +- tests/PhpWord/Tests/SettingsTest.php | 12 +- tests/PhpWord/Tests/Shared/DrawingTest.php | 12 +- tests/PhpWord/Tests/Shared/FontTest.php | 13 +- tests/PhpWord/Tests/Shared/StringTest.php | 12 +- tests/PhpWord/Tests/Shared/XMLReaderTest.php | 12 +- tests/PhpWord/Tests/Shared/ZipArchiveTest.php | 12 +- .../PhpWord/Tests/Style/AbstractStyleTest.php | 12 +- tests/PhpWord/Tests/Style/CellTest.php | 12 +- tests/PhpWord/Tests/Style/FontTest.php | 12 +- tests/PhpWord/Tests/Style/ImageTest.php | 12 +- tests/PhpWord/Tests/Style/IndentationTest.php | 53 + .../PhpWord/Tests/Style/LineNumberingTest.php | 53 + tests/PhpWord/Tests/Style/ListItemTest.php | 12 +- .../Tests/Style/NumberingLevelTest.php | 12 +- tests/PhpWord/Tests/Style/NumberingTest.php | 61 + tests/PhpWord/Tests/Style/ParagraphTest.php | 12 +- tests/PhpWord/Tests/Style/RowTest.php | 12 +- tests/PhpWord/Tests/Style/SectionTest.php | 12 +- tests/PhpWord/Tests/Style/ShadingTest.php | 52 + tests/PhpWord/Tests/Style/SpacingTest.php | 53 + tests/PhpWord/Tests/Style/TOCTest.php | 40 +- tests/PhpWord/Tests/Style/TabTest.php | 52 + tests/PhpWord/Tests/Style/TableTest.php | 15 +- tests/PhpWord/Tests/Style/TabsTest.php | 47 - tests/PhpWord/Tests/Style/TextBoxTest.php | 305 ++ tests/PhpWord/Tests/StyleTest.php | 12 +- tests/PhpWord/Tests/TemplateTest.php | 12 +- tests/PhpWord/Tests/Writer/HTMLTest.php | 12 +- .../Writer/ODText/Part/AbstractPartTest.php | 12 +- .../Tests/Writer/ODText/Part/ContentTest.php | 12 +- .../Tests/Writer/ODText/Part/MetaTest.php | 12 +- .../Tests/Writer/ODText/Part/StylesTest.php | 12 +- tests/PhpWord/Tests/Writer/ODTextTest.php | 12 +- tests/PhpWord/Tests/Writer/PDF/DomPDFTest.php | 12 +- tests/PhpWord/Tests/Writer/PDFTest.php | 12 +- tests/PhpWord/Tests/Writer/RTFTest.php | 12 +- .../Writer/Word2007/Part/AbstractPartTest.php | 12 +- .../Writer/Word2007/Part/DocPropsTest.php | 12 +- .../Writer/Word2007/Part/DocumentTest.php | 12 +- .../Tests/Writer/Word2007/Part/FooterTest.php | 12 +- .../Writer/Word2007/Part/FootnotesTest.php | 12 +- .../Tests/Writer/Word2007/Part/HeaderTest.php | 12 +- .../Writer/Word2007/Part/NumberingTest.php | 12 +- .../Tests/Writer/Word2007/Part/StylesTest.php | 12 +- tests/PhpWord/Tests/Writer/Word2007Test.php | 12 +- .../Tests/_includes/TestHelperDOCX.php | 12 +- tests/PhpWord/Tests/_includes/XmlDocument.php | 12 +- tests/bootstrap.php | 12 +- 267 files changed, 7550 insertions(+), 734 deletions(-) create mode 100644 .scrutinizer.yml create mode 100644 composer.lock create mode 100644 src/PhpWord/Element/TextBox.php delete mode 100644 src/PhpWord/Reader/Word2007/Notes.php create mode 100644 src/PhpWord/Style/TextBox.php create mode 100644 src/PhpWord/Writer/Word2007/Element/TextBox.php create mode 100644 src/PhpWord/Writer/Word2007/Style/TextBox.php create mode 100644 tests/PhpWord/Tests/Collection/CollectionTest.php create mode 100644 tests/PhpWord/Tests/Element/TextBoxTest.php create mode 100644 tests/PhpWord/Tests/Style/IndentationTest.php create mode 100644 tests/PhpWord/Tests/Style/LineNumberingTest.php create mode 100644 tests/PhpWord/Tests/Style/NumberingTest.php create mode 100644 tests/PhpWord/Tests/Style/ShadingTest.php create mode 100644 tests/PhpWord/Tests/Style/SpacingTest.php create mode 100644 tests/PhpWord/Tests/Style/TabTest.php delete mode 100644 tests/PhpWord/Tests/Style/TabsTest.php create mode 100644 tests/PhpWord/Tests/Style/TextBoxTest.php diff --git a/.gitignore b/.gitignore index eb0f06791d..016060632c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ .Trashes Thumbs.db Desktop.ini -composer.lock composer.phar phpunit.xml /.buildpath diff --git a/.scrutinizer.yml b/.scrutinizer.yml new file mode 100644 index 0000000000..0b0464f7b0 --- /dev/null +++ b/.scrutinizer.yml @@ -0,0 +1,14 @@ +filter: + excluded_paths: [ 'vendor/*', 'tests/*', 'samples/*', 'src/PhpWord/Shared/PCLZip/*' ] + +before_commands: + - "composer self-update" + - "composer install --prefer-source --dev" + +tools: + php_code_coverage: + enabled: true + test_command: phpunit -c phpunit.xml.dist + php_sim: true + php_pdepend: true + php_analyzer: true diff --git a/.travis.yml b/.travis.yml index 65b9de9aa7..41e3bebb25 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,7 +58,7 @@ script: ## PHPUnit - phpunit -c ./ --coverage-text --coverage-html ./build/coverage ## PHPDocumentor - - vendor/bin/phpdoc.php -d ./src -t ./build/docs -i ./src/PhpWord/Shared/PCLZip/* + - vendor/bin/phpdoc.php -d ./src -t ./build/docs --ignore "*/src/PhpWord/Shared/PCLZip/*" --template="responsive-twig" after_script: ## PHPDocumentor diff --git a/CHANGELOG.md b/CHANGELOG.md index 794c47ee4e..19e6d9f914 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ This release changed PHPWord license from LGPL 2.1 to LGPL 3. ### Bugfixes -- ... +- Header: All images added to the second header were assigned to the first header - @basjan GH-222 ### Deprecated @@ -26,6 +26,8 @@ This release changed PHPWord license from LGPL 2.1 to LGPL 3. - Refactor: Replace static classes `Footnotes`, `Endnotes`, and `TOC` with `Collections` - @ivanlanin GH-206 - QA: Reactivate `phpcpd` and `phpmd` on Travis - @ivanlanin - Refactor: PHPMD recommendation: Change all `get...` method that returns `boolean` into `is...` or `has...` - @ivanlanin +- Docs: Create gh-pages branch for API documentation - @Progi1984 GH-154 +- QA: Add `.scrutinizer.yml` and include `composer.lock` for preparation to Scrutinizer - @ivanlanin GH-186 ## 0.10.0 - 4 May 2014 diff --git a/README.md b/README.md index 5a8db0ef1b..21e18a7e00 100644 --- a/README.md +++ b/README.md @@ -7,40 +7,44 @@ [![License](https://poser.pugx.org/phpoffice/phpword/license.png)](https://packagist.org/packages/phpoffice/phpword) -PHPWord is a library written in pure PHP that provides a set of classes to write to and read from different document file formats. The current version of PHPWord supports Microsoft [Office Open XML](http://en.wikipedia.org/wiki/Office_Open_XML) (OOXML or OpenXML), OASIS [Open Document Format for Office Applications](http://en.wikipedia.org/wiki/OpenDocument) (OpenDocument or ODF), and [Rich Text Format](http://en.wikipedia.org/wiki/Rich_Text_Format) (RTF). +PHPWord is a library written in pure PHP that provides a set of classes to write to and read from different document file formats. The current version of PHPWord supports Microsoft [Office Open XML](http://en.wikipedia.org/wiki/Office_Open_XML) (OOXML or OpenXML), OASIS [Open Document Format for Office Applications](http://en.wikipedia.org/wiki/OpenDocument) (OpenDocument or ODF), [Rich Text Format](http://en.wikipedia.org/wiki/Rich_Text_Format) (RTF), HTML, and PDF. + +PHPWord is an open source project licensed under the terms of [LGPL version 3](https://github.com/PHPOffice/PHPWord/blob/develop/LICENSE.md). PHPWord is aimed to be a high quality software product by incorporating [continuous integration](https://travis-ci.org/PHPOffice/PHPWord) and [unit testing](http://phpoffice.github.io/PHPWord/coverage/develop/). You can learn more about PHPWord by reading the [Developers' Documentation](http://phpword.readthedocs.org/) and the [API Documentation](http://phpoffice.github.io/PHPWord/docs/develop/). + +## Features With PHPWord, you can create DOCX, ODT, or RTF documents dynamically using your PHP 5.3+ scripts. Below are some of the things that you can do with PHPWord library: -* Set document properties, e.g. title, subject, and creator. -* Create document sections with different settings, e.g. portrait/landscape, page size, and page numbering -* Create header and footer for each sections -* Set default font type, font size, and paragraph style -* Use UTF-8 and East Asia fonts/characters -* Define custom font styles (e.g. bold, italic, color) and paragraph styles (e.g. centered, multicolumns, spacing) either as named style or inline in text -* Insert paragraphs, either as a simple text or complex one (a text run) that contains other elements -* Insert titles (headers) and table of contents -* Insert text breaks and page breaks -* Insert and format images, either local, remote, or as page watermarks -* Insert binary OLE Objects such as Excel or Visio -* Insert and format table with customized properties for each rows (e.g. repeat as header row) and cells (e.g. background color, rowspan, colspan) -* Insert list items as bulleted, numbered, or multilevel -* Insert hyperlinks -* Insert footnotes and endnotes -* Create document from templates -* Use XSL 1.0 style sheets to transform main document part of OOXML template -* ... and many more features on progress - -__Want to contribute?__ [Fork us](https://github.com/PHPOffice/PHPWord/fork) or [submit](https://github.com/PHPOffice/PHPWord/issues) your bug reports or feature requests to us. +- Set document properties, e.g. title, subject, and creator. +- Create document sections with different settings, e.g. portrait/landscape, page size, and page numbering +- Create header and footer for each sections +- Set default font type, font size, and paragraph style +- Use UTF-8 and East Asia fonts/characters +- Define custom font styles (e.g. bold, italic, color) and paragraph styles (e.g. centered, multicolumns, spacing) either as named style or inline in text +- Insert paragraphs, either as a simple text or complex one (a text run) that contains other elements +- Insert titles (headers) and table of contents +- Insert text breaks and page breaks +- Insert and format images, either local, remote, or as page watermarks +- Insert binary OLE Objects such as Excel or Visio +- Insert and format table with customized properties for each rows (e.g. repeat as header row) and cells (e.g. background color, rowspan, colspan) +- Insert list items as bulleted, numbered, or multilevel +- Insert hyperlinks +- Insert footnotes and endnotes +- Create document from templates +- Use XSL 1.0 style sheets to transform main document part of OOXML template +- ... and many more features on progress ## Requirements -* PHP 5.3+ -* PHP [Zip](http://php.net/manual/en/book.zip.php) extension -* PHP [XML Parser](http://www.php.net/manual/en/xml.installation.php) extension -### Optional PHP extensions -* PHP [GD](http://php.net/manual/en/book.image.php) extension -* PHP [XMLWriter](http://php.net/manual/en/book.xmlwriter.php) extension -* PHP [XSL](http://php.net/manual/en/book.xsl.php) extension +PHPWord requires the following: + +- PHP 5.3+ +- [Zip extension](http://php.net/manual/en/book.zip.php) +- [XML Parser extension](http://www.php.net/manual/en/xml.installation.php) +- [GD extension](http://php.net/manual/en/book.image.php) (optional, used to add images) +- [XMLWriter extension](http://php.net/manual/en/book.xmlwriter.php) (optional, used to write DOCX and ODT) +- [XSL extension](http://php.net/manual/en/book.xsl.php) (optional, used to apply XSL style sheet to template ) +- [dompdf](https://github.com/dompdf/dompdf) (optional, used to write PDF) ## Installation @@ -63,7 +67,7 @@ require_once 'path/to/PhpWord/src/PhpWord/Autoloader.php'; \PhpOffice\PhpWord\Autoloader::register(); ``` -## Basic usage +## Usages The following is a basic example of the PHPWord library. More examples are provided in the [samples folder](samples/). @@ -107,6 +111,11 @@ $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'RTF'); $objWriter->save('helloWorld.rtf'); ``` -## Documentation +## Contributing + +We welcome everyone to contribute to PHPWord. Below are some of the things that you can do to contribute: -__Want to know more?__ Read the full documentation of PHPWord on [Read The Docs](http://phpword.readthedocs.org/). +- Read [our contributing guide](https://github.com/PHPOffice/PHPWord/blob/master/CONTRIBUTING.md) +- [Fork us](https://github.com/PHPOffice/PHPWord/fork) and [request a pull](https://github.com/PHPOffice/PHPWord/pulls) to the [develop](https://github.com/PHPOffice/PHPWord/tree/develop) branch +- Submit [bug reports or feature requests](https://github.com/PHPOffice/PHPWord/issues) to GitHub +- Follow [@PHPWord](https://twitter.com/PHPWord) and [@PHPOffice](https://twitter.com/PHPOffice) on Twitter diff --git a/composer.json b/composer.json index 20aca17b52..8396f07375 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ ], "homepage": "http://phpoffice.github.io", "type": "library", - "license": "LGPL", + "license": "LGPL-3.0", "authors": [ { "name": "Mark Baker" diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000000..6d63264a83 --- /dev/null +++ b/composer.lock @@ -0,0 +1,3107 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" + ], + "hash": "6daefa91649add98af3850b0a3f13415", + "packages": [ + + ], + "packages-dev": [ + { + "name": "cilex/cilex", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/Cilex/Cilex.git", + "reference": "7acd965a609a56d0345e8b6071c261fbdb926cb5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Cilex/Cilex/zipball/7acd965a609a56d0345e8b6071c261fbdb926cb5", + "reference": "7acd965a609a56d0345e8b6071c261fbdb926cb5", + "shasum": "" + }, + "require": { + "cilex/console-service-provider": "1.*", + "php": ">=5.3.3", + "pimple/pimple": "~1.0", + "symfony/finder": "~2.1", + "symfony/process": "~2.1" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*", + "symfony/validator": "~2.1" + }, + "suggest": { + "monolog/monolog": ">=1.0.0", + "symfony/validator": ">=1.0.0", + "symfony/yaml": ">=1.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Cilex": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "description": "The PHP micro-framework for Command line tools based on the Symfony2 Components", + "homepage": "http://cilex.github.com", + "keywords": [ + "cli", + "microframework" + ], + "time": "2014-03-29 14:03:13" + }, + { + "name": "cilex/console-service-provider", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/Cilex/console-service-provider.git", + "reference": "25ee3d1875243d38e1a3448ff94bdf944f70d24e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Cilex/console-service-provider/zipball/25ee3d1875243d38e1a3448ff94bdf944f70d24e", + "reference": "25ee3d1875243d38e1a3448ff94bdf944f70d24e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "pimple/pimple": "1.*@dev", + "symfony/console": "~2.1" + }, + "require-dev": { + "cilex/cilex": "1.*@dev", + "silex/silex": "1.*@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Cilex\\Provider\\Console": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "description": "Console Service Provider", + "keywords": [ + "cilex", + "console", + "pimple", + "service-provider", + "silex" + ], + "time": "2012-12-19 10:50:58" + }, + { + "name": "doctrine/annotations", + "version": "v1.1.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "40db0c96985aab2822edbc4848b3bd2429e02670" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/40db0c96985aab2822edbc4848b3bd2429e02670", + "reference": "40db0c96985aab2822edbc4848b3bd2429e02670", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "php": ">=5.3.2" + }, + "require-dev": { + "doctrine/cache": "1.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Annotations\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jonathan H. Wage", + "email": "jonwage@gmail.com", + "homepage": "http://www.jwage.com/", + "role": "Creator" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com", + "homepage": "http://www.instaclick.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "http://jmsyst.com", + "role": "Developer of wrapped JMSSerializerBundle" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "time": "2013-06-16 21:33:03" + }, + { + "name": "doctrine/lexer", + "version": "v1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "2f708a85bb3aab5d99dab8be435abd73e0b18acb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/2f708a85bb3aab5d99dab8be435abd73e0b18acb", + "reference": "2f708a85bb3aab5d99dab8be435abd73e0b18acb", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "Doctrine\\Common\\Lexer\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com", + "homepage": "http://www.instaclick.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "http://jmsyst.com", + "role": "Developer of wrapped JMSSerializerBundle" + } + ], + "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "lexer", + "parser" + ], + "time": "2013-01-12 18:59:04" + }, + { + "name": "dompdf/dompdf", + "version": "v0.6.1", + "source": { + "type": "git", + "url": "https://github.com/dompdf/dompdf.git", + "reference": "cf7d8a0a27270418850cc7d7ea532159e5eeb3eb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dompdf/dompdf/zipball/cf7d8a0a27270418850cc7d7ea532159e5eeb3eb", + "reference": "cf7d8a0a27270418850cc7d7ea532159e5eeb3eb", + "shasum": "" + }, + "require": { + "phenx/php-font-lib": "0.2.*" + }, + "type": "library", + "autoload": { + "classmap": [ + "include/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL" + ], + "authors": [ + { + "name": "Fabien Ménager", + "email": "fabien.menager@gmail.com" + }, + { + "name": "Brian Sweeney", + "email": "eclecticgeek@gmail.com" + } + ], + "description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter", + "homepage": "https://github.com/dompdf/dompdf", + "time": "2014-03-11 01:59:52" + }, + { + "name": "erusev/parsedown", + "version": "0.9.4", + "source": { + "type": "git", + "url": "https://github.com/erusev/parsedown.git", + "reference": "d29ff18299210b52a75a631a70963e7c8b35b04f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/erusev/parsedown/zipball/d29ff18299210b52a75a631a70963e7c8b35b04f", + "reference": "d29ff18299210b52a75a631a70963e7c8b35b04f", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-0": { + "Parsedown": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Emanuil Rusev", + "email": "hello@erusev.com", + "homepage": "http://erusev.com" + } + ], + "description": "Parser for Markdown.", + "homepage": "http://parsedown.org", + "keywords": [ + "markdown", + "parser" + ], + "time": "2014-02-06 12:16:14" + }, + { + "name": "jms/metadata", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/metadata.git", + "reference": "88ffa28bc987e4c26229fc84a2e541b6ed4e1459" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/88ffa28bc987e4c26229fc84a2e541b6ed4e1459", + "reference": "88ffa28bc987e4c26229fc84a2e541b6ed4e1459", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "doctrine/cache": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5.x-dev" + } + }, + "autoload": { + "psr-0": { + "Metadata\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "http://jmsyst.com", + "role": "Developer of wrapped JMSSerializerBundle" + } + ], + "description": "Class/method/property metadata management in PHP", + "keywords": [ + "annotations", + "metadata", + "xml", + "yaml" + ], + "time": "2013-11-05 23:02:36" + }, + { + "name": "jms/parser-lib", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/parser-lib.git", + "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/parser-lib/zipball/c509473bc1b4866415627af0e1c6cc8ac97fa51d", + "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d", + "shasum": "" + }, + "require": { + "phpoption/phpoption": ">=0.9,<2.0-dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "JMS\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache2" + ], + "description": "A library for easily creating recursive-descent parsers.", + "time": "2012-11-18 18:08:43" + }, + { + "name": "jms/serializer", + "version": "0.16.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/serializer.git", + "reference": "c8a171357ca92b6706e395c757f334902d430ea9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/c8a171357ca92b6706e395c757f334902d430ea9", + "reference": "c8a171357ca92b6706e395c757f334902d430ea9", + "shasum": "" + }, + "require": { + "doctrine/annotations": "1.*", + "jms/metadata": "~1.1", + "jms/parser-lib": "1.*", + "php": ">=5.3.2", + "phpcollection/phpcollection": "~0.1" + }, + "require-dev": { + "doctrine/orm": "~2.1", + "doctrine/phpcr-odm": "~1.0.1", + "jackalope/jackalope-doctrine-dbal": "1.0.*", + "propel/propel1": "~1.7", + "symfony/filesystem": "2.*", + "symfony/form": "~2.1", + "symfony/translation": "~2.0", + "symfony/validator": "~2.0", + "symfony/yaml": "2.*", + "twig/twig": ">=1.8,<2.0-dev" + }, + "suggest": { + "symfony/yaml": "Required if you'd like to serialize data to YAML format." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.15-dev" + } + }, + "autoload": { + "psr-0": { + "JMS\\Serializer": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache2" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "http://jmsyst.com", + "role": "Developer of wrapped JMSSerializerBundle" + } + ], + "description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.", + "homepage": "http://jmsyst.com/libs/serializer", + "keywords": [ + "deserialization", + "jaxb", + "json", + "serialization", + "xml" + ], + "time": "2014-03-18 08:39:00" + }, + { + "name": "knplabs/knp-menu", + "version": "v1.1.2", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/KnpMenu.git", + "reference": "f8e867268f63f561c1adadd6cbb5d8524f921873" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/KnpMenu/zipball/f8e867268f63f561c1adadd6cbb5d8524f921873", + "reference": "f8e867268f63f561c1adadd6cbb5d8524f921873", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "pimple/pimple": "*", + "silex/silex": "1.0.*", + "twig/twig": ">=1.2,<2.0-dev" + }, + "suggest": { + "pimple/pimple": "for the built-in implementations of the menu provider and renderer provider", + "silex/silex": "for the integration with your silex application", + "twig/twig": "for the TwigRenderer and the integration with your templates" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-0": { + "Knp\\Menu\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christophe Coevoet", + "email": "stof@notk.org" + }, + { + "name": "KnpLabs", + "homepage": "http://knplabs.com" + }, + { + "name": "Symfony Community", + "homepage": "https://github.com/KnpLabs/KnpMenu/contributors" + } + ], + "description": "An object oriented menu library", + "homepage": "http://knplabs.com", + "keywords": [ + "menu", + "tree" + ], + "time": "2012-06-10 16:20:40" + }, + { + "name": "monolog/monolog", + "version": "1.9.1", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "65026b610f8c19e61d7242f600530677b0466aac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/65026b610f8c19e61d7242f600530677b0466aac", + "reference": "65026b610f8c19e61d7242f600530677b0466aac", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "require-dev": { + "aws/aws-sdk-php": "~2.4, >2.4.8", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "phpunit/phpunit": "~3.7.0", + "raven/raven": "~0.5", + "ruflin/elastica": "0.90.*" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "raven/raven": "Allow sending log messages to a Sentry server", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be", + "role": "Developer" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "time": "2014-04-24 13:29:03" + }, + { + "name": "nikic/php-parser", + "version": "v0.9.4", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "1e5e280ae88a27effa2ae4aa2bd088494ed8594f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1e5e280ae88a27effa2ae4aa2bd088494ed8594f", + "reference": "1e5e280ae88a27effa2ae4aa2bd088494ed8594f", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.9-dev" + } + }, + "autoload": { + "psr-0": { + "PHPParser": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2013-08-25 17:11:40" + }, + { + "name": "phenx/php-font-lib", + "version": "0.2.2", + "source": { + "type": "git", + "url": "https://github.com/PhenX/php-font-lib.git", + "reference": "c30c7fc00a6b0d863e9bb4c5d5dd015298b2dc82" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PhenX/php-font-lib/zipball/c30c7fc00a6b0d863e9bb4c5d5dd015298b2dc82", + "reference": "c30c7fc00a6b0d863e9bb4c5d5dd015298b2dc82", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "classes/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL" + ], + "authors": [ + { + "name": "Fabien Ménager", + "email": "fabien.menager@gmail.com" + } + ], + "description": "A library to read, parse, export and make subsets of different types of font files.", + "homepage": "https://github.com/PhenX/php-font-lib", + "time": "2014-02-01 15:22:28" + }, + { + "name": "phpcollection/phpcollection", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-collection.git", + "reference": "b8bf55a0a929ca43b01232b36719f176f86c7e83" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-collection/zipball/b8bf55a0a929ca43b01232b36719f176f86c7e83", + "reference": "b8bf55a0a929ca43b01232b36719f176f86c7e83", + "shasum": "" + }, + "require": { + "phpoption/phpoption": "1.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.3-dev" + } + }, + "autoload": { + "psr-0": { + "PhpCollection": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache2" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "http://jmsyst.com", + "role": "Developer of wrapped JMSSerializerBundle" + } + ], + "description": "General-Purpose Collection Library for PHP", + "keywords": [ + "collection", + "list", + "map", + "sequence", + "set" + ], + "time": "2014-03-11 13:46:42" + }, + { + "name": "phpdocumentor/fileset", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/Fileset.git", + "reference": "bfa78d8fa9763dfce6d0e5d3730c1d8ab25d34b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/Fileset/zipball/bfa78d8fa9763dfce6d0e5d3730c1d8ab25d34b0", + "reference": "bfa78d8fa9763dfce6d0e5d3730c1d8ab25d34b0", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/finder": "~2.1" + }, + "require-dev": { + "phpunit/phpunit": "~3.7" + }, + "type": "library", + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/", + "tests/unit/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Fileset component for collecting a set of files given directories and file paths", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "files", + "fileset", + "phpdoc" + ], + "time": "2013-08-06 21:07:42" + }, + { + "name": "phpdocumentor/graphviz", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/GraphViz.git", + "reference": "13595130b9bc185109f40f1b70f0b231f490f5fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/GraphViz/zipball/13595130b9bc185109f40f1b70f0b231f490f5fc", + "reference": "13595130b9bc185109f40f1b70f0b231f490f5fc", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7" + }, + "type": "library", + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/", + "tests/unit" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "time": "2014-02-26 17:45:01" + }, + { + "name": "phpdocumentor/phpdocumentor", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/phpDocumentor2.git", + "reference": "d7503ada7386aa6b2956224d50a8d0226a22a99f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/phpDocumentor2/zipball/d7503ada7386aa6b2956224d50a8d0226a22a99f", + "reference": "d7503ada7386aa6b2956224d50a8d0226a22a99f", + "shasum": "" + }, + "require": { + "cilex/cilex": "~1.0", + "dompdf/dompdf": "~0.6", + "erusev/parsedown": "~0.7", + "jms/serializer": "~0.12", + "knplabs/knp-menu": "~1.1", + "monolog/monolog": "~1.6", + "php": ">=5.3.3", + "phpdocumentor/fileset": "~1.0", + "phpdocumentor/graphviz": "~1.0", + "phpdocumentor/reflection": "~1.0", + "phpdocumentor/reflection-docblock": "~2.0", + "phpdocumentor/template-abstract": "~1.2", + "phpdocumentor/template-checkstyle": "~1.2", + "phpdocumentor/template-clean": "~1.0", + "phpdocumentor/template-new-black": "~1.3", + "phpdocumentor/template-old-ocean": "~1.3", + "phpdocumentor/template-responsive": "~1.3", + "phpdocumentor/template-responsive-twig": "~1.2", + "phpdocumentor/template-xml": "~1.0", + "phpdocumentor/template-zend": "~1.3", + "symfony/config": "~2.3", + "symfony/console": "~2.3", + "symfony/event-dispatcher": "~2.1", + "symfony/process": "~2.0", + "symfony/stopwatch": "~2.3", + "symfony/validator": "~2.2", + "twig/twig": "~1.3", + "zendframework/zend-cache": "2.1.*", + "zendframework/zend-config": "2.1.*", + "zendframework/zend-filter": "2.1.*", + "zendframework/zend-i18n": "2.1.*", + "zendframework/zend-serializer": "2.1.*", + "zendframework/zend-servicemanager": "2.1.*", + "zendframework/zend-stdlib": "2.1.*", + "zetacomponents/document": ">=1.3.1" + }, + "require-dev": { + "behat/behat": "~2.4", + "mikey179/vfsstream": "~1.2", + "mockery/mockery": ">=0.8.0", + "phpunit/phpunit": "~3.7", + "squizlabs/php_codesniffer": "~1.4", + "symfony/expression-language": "~2.4" + }, + "suggest": { + "ext-twig": "Enabling the twig extension improves the generation of twig based templates.", + "ext-xslcache": "Enabling the XSLCache extension improves the generation of xml based templates." + }, + "bin": [ + "bin/phpdoc.php" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/", + "tests/unit/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Documentation Generator for PHP", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "api", + "application", + "dga", + "documentation", + "phpdoc" + ], + "time": "2014-04-01 18:14:51" + }, + { + "name": "phpdocumentor/reflection", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/Reflection.git", + "reference": "df82db631acd60739c8796b3c6d5e4da970808f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/Reflection/zipball/df82db631acd60739c8796b3c6d5e4da970808f3", + "reference": "df82db631acd60739c8796b3c6d5e4da970808f3", + "shasum": "" + }, + "require": { + "nikic/php-parser": "0.9.4", + "php": ">=5.3.3", + "phpdocumentor/reflection-docblock": "2.*", + "psr/log": "~1.0" + }, + "require-dev": { + "behat/behat": "~2.4", + "mockery/mockery": ">=0.7.0", + "phpunit/phpunit": "~3.7" + }, + "type": "library", + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/", + "tests/unit/", + "tests/mocks/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Reflection library to do Static Analysis for PHP Projects", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2014-03-28 11:20:22" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "0bca477a34baea39add016af90046f002a175619" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/0bca477a34baea39add016af90046f002a175619", + "reference": "0bca477a34baea39add016af90046f002a175619", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*@stable" + }, + "suggest": { + "dflydev/markdown": "1.0.*", + "erusev/parsedown": "~0.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "time": "2014-03-28 09:21:30" + }, + { + "name": "phpdocumentor/template-abstract", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/template.abstract.git", + "reference": "43fa2db351d7a150803397721e778f9dd8a20b47" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/template.abstract/zipball/43fa2db351d7a150803397721e778f9dd8a20b47", + "reference": "43fa2db351d7a150803397721e778f9dd8a20b47", + "shasum": "" + }, + "require": { + "ext-xsl": "*", + "phpdocumentor/unified-asset-installer": "~1.1" + }, + "type": "phpdocumentor-template", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Simple bright template for phpDocumentor", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "documentation", + "phpdoc", + "template" + ], + "time": "2013-08-02 06:11:13" + }, + { + "name": "phpdocumentor/template-checkstyle", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/template.checkstyle.git", + "reference": "22a45684e737c8c3ec3f1a12edb7743b7a82ac8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/template.checkstyle/zipball/22a45684e737c8c3ec3f1a12edb7743b7a82ac8b", + "reference": "22a45684e737c8c3ec3f1a12edb7743b7a82ac8b", + "shasum": "" + }, + "require": { + "ext-xsl": "*", + "phpdocumentor/unified-asset-installer": "~1.1" + }, + "type": "phpdocumentor-template", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Checkstyle XML output template for phpDocumentor2", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "documentation", + "phpdoc", + "template" + ], + "time": "2013-08-01 19:43:19" + }, + { + "name": "phpdocumentor/template-clean", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/template.clean.git", + "reference": "78f2048c5ecd62f0b79dbac093687d78a66d1806" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/template.clean/zipball/78f2048c5ecd62f0b79dbac093687d78a66d1806", + "reference": "78f2048c5ecd62f0b79dbac093687d78a66d1806", + "shasum": "" + }, + "require": { + "phpdocumentor/unified-asset-installer": "~1.1" + }, + "type": "phpdocumentor-template", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A clean, responsive modern template for phpDocumentor for Twig aimed at usability", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "documentation", + "phpdoc", + "responsive", + "template" + ], + "time": "2014-03-29 08:22:15" + }, + { + "name": "phpdocumentor/template-new-black", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/template.new_black.git", + "reference": "be38beba2b2674be292f32f88efe8a60c658a139" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/template.new_black/zipball/be38beba2b2674be292f32f88efe8a60c658a139", + "reference": "be38beba2b2674be292f32f88efe8a60c658a139", + "shasum": "" + }, + "require": { + "ext-xsl": "*", + "phpdocumentor/template-abstract": "1.*", + "phpdocumentor/unified-asset-installer": "~1.1" + }, + "type": "phpdocumentor-template", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Web 2.0 template with dark sidebar for phpDocumentor", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "documentation", + "phpdoc", + "template" + ], + "time": "2013-08-02 06:16:30" + }, + { + "name": "phpdocumentor/template-old-ocean", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/template.old_ocean.git", + "reference": "3a0e2bcced4045a694d53b4607aad04e99d78489" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/template.old_ocean/zipball/3a0e2bcced4045a694d53b4607aad04e99d78489", + "reference": "3a0e2bcced4045a694d53b4607aad04e99d78489", + "shasum": "" + }, + "require": { + "ext-xsl": "*", + "phpdocumentor/unified-asset-installer": "~1.1" + }, + "type": "phpdocumentor-template", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Blue template with high contrast for the foreground", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "documentation", + "phpdoc", + "template" + ], + "time": "2013-08-02 06:21:07" + }, + { + "name": "phpdocumentor/template-responsive", + "version": "1.3.3", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/template.responsive.git", + "reference": "26f895a2ed3148e1686ae4d802f65a3ef04c04e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/template.responsive/zipball/26f895a2ed3148e1686ae4d802f65a3ef04c04e1", + "reference": "26f895a2ed3148e1686ae4d802f65a3ef04c04e1", + "shasum": "" + }, + "require": { + "ext-xsl": "*", + "phpdocumentor/unified-asset-installer": "~1.1" + }, + "type": "phpdocumentor-template", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Responsive modern template for phpDocumentor", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "documentation", + "phpdoc", + "template" + ], + "time": "2014-03-29 08:55:54" + }, + { + "name": "phpdocumentor/template-responsive-twig", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/template.responsive-twig.git", + "reference": "cd6d82be6a4626d865fd01d40aad170cea08db0a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/template.responsive-twig/zipball/cd6d82be6a4626d865fd01d40aad170cea08db0a", + "reference": "cd6d82be6a4626d865fd01d40aad170cea08db0a", + "shasum": "" + }, + "require": { + "phpdocumentor/unified-asset-installer": "~1.1" + }, + "type": "phpdocumentor-template", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Responsive modern template for phpDocumentor for Twig", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "documentation", + "phpdoc", + "template" + ], + "time": "2014-03-30 21:02:00" + }, + { + "name": "phpdocumentor/template-xml", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/mvriel/template.xml.git", + "reference": "a372713be8ee99b16497e2580592e474ff51190c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mvriel/template.xml/zipball/a372713be8ee99b16497e2580592e474ff51190c", + "reference": "a372713be8ee99b16497e2580592e474ff51190c", + "shasum": "" + }, + "require": { + "phpdocumentor/unified-asset-installer": "~1.1" + }, + "type": "phpdocumentor-template", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Generates an XML representation of the project's structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "documentation", + "phpdoc", + "template" + ], + "time": "2013-08-01 20:23:32" + }, + { + "name": "phpdocumentor/template-zend", + "version": "1.3.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/template.zend.git", + "reference": "75913288bfd73d3bf4c1b1179c3963f3431e7a9d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/template.zend/zipball/75913288bfd73d3bf4c1b1179c3963f3431e7a9d", + "reference": "75913288bfd73d3bf4c1b1179c3963f3431e7a9d", + "shasum": "" + }, + "require": { + "ext-xsl": "*", + "phpdocumentor/template-abstract": "1.*", + "phpdocumentor/unified-asset-installer": "~1.1" + }, + "type": "phpdocumentor-template", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Official Zend Framework Template for phpDocumentor2", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "ZendFramework", + "documentation", + "phpdoc", + "template", + "zend", + "zf" + ], + "time": "2013-12-05 08:51:57" + }, + { + "name": "phpdocumentor/unified-asset-installer", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/UnifiedAssetInstaller.git", + "reference": "241fb036268cd9da7d76da3db66e3eda66259c52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/UnifiedAssetInstaller/zipball/241fb036268cd9da7d76da3db66e3eda66259c52", + "reference": "241fb036268cd9da7d76da3db66e3eda66259c52", + "shasum": "" + }, + "require": { + "composer-plugin-api": "1.0.0" + }, + "require-dev": { + "composer/composer": "~1.0@dev", + "phpunit/phpunit": "~3.7" + }, + "type": "composer-installer", + "extra": { + "class": "\\phpDocumentor\\Composer\\UnifiedAssetInstaller" + }, + "autoload": { + "psr-0": { + "phpDocumentor\\Composer": [ + "src/", + "test/unit/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Asset installer for phpDocumentor", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "assets", + "installer", + "plugins", + "templates" + ], + "time": "2013-09-09 06:13:02" + }, + { + "name": "phpoption/phpoption", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-option.git", + "reference": "5d099bcf0393908bf4ad69cc47dafb785d51f7f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/5d099bcf0393908bf4ad69cc47dafb785d51f7f5", + "reference": "5d099bcf0393908bf4ad69cc47dafb785d51f7f5", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-0": { + "PhpOption\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache2" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "http://jmsyst.com", + "role": "Developer of wrapped JMSSerializerBundle" + } + ], + "description": "Option Type for PHP", + "keywords": [ + "language", + "option", + "php", + "type" + ], + "time": "2014-01-09 22:37:17" + }, + { + "name": "phpunit/php-code-coverage", + "version": "1.2.17", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "6ef2bf3a1c47eca07ea95f0d8a902a6340390b34" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6ef2bf3a1c47eca07ea95f0d8a902a6340390b34", + "reference": "6ef2bf3a1c47eca07ea95f0d8a902a6340390b34", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": ">=1.3.0@stable", + "phpunit/php-text-template": ">=1.2.0@stable", + "phpunit/php-token-stream": ">=1.1.3@stable" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*@dev" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.0.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2014-03-28 10:53:45" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.3.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb", + "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "File/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2013-10-10 15:34:57" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "Text/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2014-01-30 17:20:04" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2013-08-02 07:42:54" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32", + "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2014-03-03 05:10:30" + }, + { + "name": "phpunit/phpunit", + "version": "3.7.37", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "ae6cefd7cc84586a5ef27e04bae11ee940ec63dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ae6cefd7cc84586a5ef27e04bae11ee940ec63dc", + "reference": "ae6cefd7cc84586a5ef27e04bae11ee940ec63dc", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpunit/php-code-coverage": "~1.2", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.1", + "phpunit/php-timer": "~1.0", + "phpunit/phpunit-mock-objects": "~1.2", + "symfony/yaml": "~2.0" + }, + "require-dev": { + "pear-pear.php.net/pear": "1.9.4" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "composer/bin/phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.7.x-dev" + } + }, + "autoload": { + "classmap": [ + "PHPUnit/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "", + "../../symfony/yaml/" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "http://www.phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2014-04-30 12:24:19" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/5794e3c5c5ba0fb037b11d8151add2a07fa82875", + "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-text-template": ">=1.1.1@stable" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "autoload": { + "classmap": [ + "PHPUnit/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2013-01-13 10:24:48" + }, + { + "name": "pimple/pimple", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/fabpot/Pimple.git", + "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fabpot/Pimple/zipball/2019c145fe393923f3441b23f29bbdfaa5c58c4d", + "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-0": { + "Pimple": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + } + ], + "description": "Pimple is a simple Dependency Injection Container for PHP 5.3", + "homepage": "http://pimple.sensiolabs.org", + "keywords": [ + "container", + "dependency injection" + ], + "time": "2013-11-22 08:30:29" + }, + { + "name": "psr/log", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-0": { + "Psr\\Log\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2012-12-21 11:40:51" + }, + { + "name": "symfony/config", + "version": "v2.4.4", + "target-dir": "Symfony/Component/Config", + "source": { + "type": "git", + "url": "https://github.com/symfony/Config.git", + "reference": "2effc67af6f21a0d267210b72d0b0b691d113528" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Config/zipball/2effc67af6f21a0d267210b72d0b0b691d113528", + "reference": "2effc67af6f21a0d267210b72d0b0b691d113528", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/filesystem": "~2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Config\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "http://symfony.com", + "time": "2014-04-22 08:11:06" + }, + { + "name": "symfony/console", + "version": "v2.4.4", + "target-dir": "Symfony/Component/Console", + "source": { + "type": "git", + "url": "https://github.com/symfony/Console.git", + "reference": "2e452005b1e1d003d23702d227e23614679eb5ca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Console/zipball/2e452005b1e1d003d23702d227e23614679eb5ca", + "reference": "2e452005b1e1d003d23702d227e23614679eb5ca", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/event-dispatcher": "~2.1" + }, + "suggest": { + "symfony/event-dispatcher": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Console\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "http://symfony.com", + "time": "2014-04-27 13:34:57" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.4.4", + "target-dir": "Symfony/Component/EventDispatcher", + "source": { + "type": "git", + "url": "https://github.com/symfony/EventDispatcher.git", + "reference": "e539602e5455aa086c0e81e604745af7789e4d8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/e539602e5455aa086c0e81e604745af7789e4d8a", + "reference": "e539602e5455aa086c0e81e604745af7789e4d8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/dependency-injection": "~2.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "http://symfony.com", + "time": "2014-04-16 10:34:31" + }, + { + "name": "symfony/filesystem", + "version": "v2.4.4", + "target-dir": "Symfony/Component/Filesystem", + "source": { + "type": "git", + "url": "https://github.com/symfony/Filesystem.git", + "reference": "a3af8294bcce4a7c1b2892363b0c9d8109affad4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/a3af8294bcce4a7c1b2892363b0c9d8109affad4", + "reference": "a3af8294bcce4a7c1b2892363b0c9d8109affad4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Filesystem\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "http://symfony.com", + "time": "2014-04-16 10:34:31" + }, + { + "name": "symfony/finder", + "version": "v2.4.4", + "target-dir": "Symfony/Component/Finder", + "source": { + "type": "git", + "url": "https://github.com/symfony/Finder.git", + "reference": "25e1e7d5e7376f8a92ae3b1d714d956edf33a730" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Finder/zipball/25e1e7d5e7376f8a92ae3b1d714d956edf33a730", + "reference": "25e1e7d5e7376f8a92ae3b1d714d956edf33a730", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Finder\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "http://symfony.com", + "time": "2014-04-27 13:34:57" + }, + { + "name": "symfony/process", + "version": "v2.4.4", + "target-dir": "Symfony/Component/Process", + "source": { + "type": "git", + "url": "https://github.com/symfony/Process.git", + "reference": "8721f1476d5d38a43c7d6ccb6435b351cf8f3bb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Process/zipball/8721f1476d5d38a43c7d6ccb6435b351cf8f3bb7", + "reference": "8721f1476d5d38a43c7d6ccb6435b351cf8f3bb7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Process\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "http://symfony.com", + "time": "2014-04-27 13:34:57" + }, + { + "name": "symfony/property-access", + "version": "v2.4.4", + "target-dir": "Symfony/Component/PropertyAccess", + "source": { + "type": "git", + "url": "https://github.com/symfony/PropertyAccess.git", + "reference": "0456222bc00c40c1365065b603f7c397fb9a7134" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/PropertyAccess/zipball/0456222bc00c40c1365065b603f7c397fb9a7134", + "reference": "0456222bc00c40c1365065b603f7c397fb9a7134", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\PropertyAccess\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony PropertyAccess Component", + "homepage": "http://symfony.com", + "keywords": [ + "access", + "array", + "extraction", + "index", + "injection", + "object", + "property", + "property path", + "reflection" + ], + "time": "2014-04-18 20:37:09" + }, + { + "name": "symfony/stopwatch", + "version": "v2.4.4", + "target-dir": "Symfony/Component/Stopwatch", + "source": { + "type": "git", + "url": "https://github.com/symfony/Stopwatch.git", + "reference": "343bcc0360f2c22f371884b8f6a9fee8d1aa431a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/343bcc0360f2c22f371884b8f6a9fee8d1aa431a", + "reference": "343bcc0360f2c22f371884b8f6a9fee8d1aa431a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Stopwatch\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "http://symfony.com", + "time": "2014-04-18 20:37:09" + }, + { + "name": "symfony/translation", + "version": "v2.4.4", + "target-dir": "Symfony/Component/Translation", + "source": { + "type": "git", + "url": "https://github.com/symfony/Translation.git", + "reference": "d2c73ffa4a5ba1fa0c5d93f43b68331dffe898c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Translation/zipball/d2c73ffa4a5ba1fa0c5d93f43b68331dffe898c5", + "reference": "d2c73ffa4a5ba1fa0c5d93f43b68331dffe898c5", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/config": "~2.0", + "symfony/yaml": "~2.2" + }, + "suggest": { + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Translation\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Translation Component", + "homepage": "http://symfony.com", + "time": "2014-04-18 21:02:05" + }, + { + "name": "symfony/validator", + "version": "v2.4.4", + "target-dir": "Symfony/Component/Validator", + "source": { + "type": "git", + "url": "https://github.com/symfony/Validator.git", + "reference": "5bbcdcc520bc7fb3826abb44020880f14c9c03a7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Validator/zipball/5bbcdcc520bc7fb3826abb44020880f14c9c03a7", + "reference": "5bbcdcc520bc7fb3826abb44020880f14c9c03a7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/property-access": "~2.2", + "symfony/translation": "~2.0" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "symfony/config": "~2.2", + "symfony/http-foundation": "~2.1", + "symfony/intl": "~2.3", + "symfony/yaml": "~2.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader", + "symfony/config": "", + "symfony/http-foundation": "", + "symfony/intl": "", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Validator\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Validator Component", + "homepage": "http://symfony.com", + "time": "2014-04-27 13:34:57" + }, + { + "name": "symfony/yaml", + "version": "v2.4.4", + "target-dir": "Symfony/Component/Yaml", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml.git", + "reference": "65539ecde838f9c0d18b006b2101e3deb4b5c9ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/65539ecde838f9c0d18b006b2101e3deb4b5c9ff", + "reference": "65539ecde838f9c0d18b006b2101e3deb4b5c9ff", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Yaml\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "http://symfony.com", + "time": "2014-04-18 20:37:09" + }, + { + "name": "twig/twig", + "version": "v1.15.1", + "source": { + "type": "git", + "url": "https://github.com/fabpot/Twig.git", + "reference": "1fb5784662f438d7d96a541e305e28b812e2eeed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fabpot/Twig/zipball/1fb5784662f438d7d96a541e305e28b812e2eeed", + "reference": "1fb5784662f438d7d96a541e305e28b812e2eeed", + "shasum": "" + }, + "require": { + "php": ">=5.2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.15-dev" + } + }, + "autoload": { + "psr-0": { + "Twig_": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Armin Ronacher2", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + }, + { + "name": "Twig Team", + "homepage": "https://github.com/fabpot/Twig/graphs/contributors", + "role": "Contributors" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "http://twig.sensiolabs.org", + "keywords": [ + "templating" + ], + "time": "2014-02-13 10:19:29" + }, + { + "name": "zendframework/zend-cache", + "version": "2.1.6", + "target-dir": "Zend/Cache", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendCache.git", + "reference": "560355160f06cdc3ef549a7eef843af3bead7e39" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendCache/zipball/560355160f06cdc3ef549a7eef843af3bead7e39", + "reference": "560355160f06cdc3ef549a7eef843af3bead7e39", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "zendframework/zend-eventmanager": "self.version", + "zendframework/zend-servicemanager": "self.version", + "zendframework/zend-stdlib": "self.version" + }, + "require-dev": { + "zendframework/zend-serializer": "self.version" + }, + "suggest": { + "ext-apc": "APC >= 3.1.6 to use the APC storage adapter", + "ext-dba": "DBA, to use the DBA storage adapter", + "ext-memcached": "Memcached >= 1.0.0 to use the Memcached storage adapter", + "ext-wincache": "WinCache, to use the WinCache storage adapter", + "zendframework/zend-serializer": "Zend\\Serializer component", + "zendframework/zend-session": "Zend\\Session component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Cache\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a generic way to cache any data", + "keywords": [ + "cache", + "zf2" + ], + "time": "2014-03-03 23:00:17" + }, + { + "name": "zendframework/zend-config", + "version": "2.1.6", + "target-dir": "Zend/Config", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendConfig.git", + "reference": "a31c3980cf7ec88418a931e9cf4ba21079f47a08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendConfig/zipball/a31c3980cf7ec88418a931e9cf4ba21079f47a08", + "reference": "a31c3980cf7ec88418a931e9cf4ba21079f47a08", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "zendframework/zend-stdlib": "self.version" + }, + "suggest": { + "zendframework/zend-json": "Zend\\Json to use the Json reader or writer classes", + "zendframework/zend-servicemanager": "Zend\\ServiceManager for use with the Config Factory to retrieve reader and writer instances" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Config\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a nested object property based user interface for accessing this configuration data within application code", + "keywords": [ + "config", + "zf2" + ], + "time": "2014-01-02 18:00:10" + }, + { + "name": "zendframework/zend-eventmanager", + "version": "2.1.6", + "target-dir": "Zend/EventManager", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendEventManager.git", + "reference": "89368704bb37303fba64c3ddd6bce0506aa7187c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendEventManager/zipball/89368704bb37303fba64c3ddd6bce0506aa7187c", + "reference": "89368704bb37303fba64c3ddd6bce0506aa7187c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "zendframework/zend-stdlib": "self.version" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\EventManager\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "eventmanager", + "zf2" + ], + "time": "2014-01-04 13:00:14" + }, + { + "name": "zendframework/zend-filter", + "version": "2.1.6", + "target-dir": "Zend/Filter", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendFilter.git", + "reference": "8ceece474b29d079e86976dbd3efffe6064b3d72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendFilter/zipball/8ceece474b29d079e86976dbd3efffe6064b3d72", + "reference": "8ceece474b29d079e86976dbd3efffe6064b3d72", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "zendframework/zend-stdlib": "self.version" + }, + "require-dev": { + "zendframework/zend-crypt": "self.version" + }, + "suggest": { + "zendframework/zend-crypt": "Zend\\Crypt component", + "zendframework/zend-i18n": "Zend\\I18n component", + "zendframework/zend-uri": "Zend\\Uri component for UriNormalize filter", + "zendframework/zend-validator": "Zend\\Validator component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Filter\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a set of commonly needed data filters", + "keywords": [ + "filter", + "zf2" + ], + "time": "2014-03-03 21:00:06" + }, + { + "name": "zendframework/zend-i18n", + "version": "2.1.6", + "target-dir": "Zend/I18n", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendI18n.git", + "reference": "10f56e0869761d62699782e4dd04eb77262cc353" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendI18n/zipball/10f56e0869761d62699782e4dd04eb77262cc353", + "reference": "10f56e0869761d62699782e4dd04eb77262cc353", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "zendframework/zend-stdlib": "self.version" + }, + "suggest": { + "ext-intl": "Required for most features of Zend\\I18n; included in default builds of PHP", + "zendframework/zend-eventmanager": "You should install this package to use the events in the translator", + "zendframework/zend-filter": "You should install this package to use the provided filters", + "zendframework/zend-resources": "Translation resources", + "zendframework/zend-validator": "You should install this package to use the provided validators", + "zendframework/zend-view": "You should install this package to use the provided view helpers" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\I18n\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "i18n", + "zf2" + ], + "time": "2014-01-04 13:00:19" + }, + { + "name": "zendframework/zend-json", + "version": "2.1.6", + "target-dir": "Zend/Json", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendJson.git", + "reference": "dd8a8239a7c08c7449a6ea219da3e2369bd90d92" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendJson/zipball/dd8a8239a7c08c7449a6ea219da3e2369bd90d92", + "reference": "dd8a8239a7c08c7449a6ea219da3e2369bd90d92", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "zendframework/zend-stdlib": "self.version" + }, + "suggest": { + "zendframework/zend-server": "Zend\\Server component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Json\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP", + "keywords": [ + "json", + "zf2" + ], + "time": "2014-03-06 18:00:05" + }, + { + "name": "zendframework/zend-math", + "version": "2.1.6", + "target-dir": "Zend/Math", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendMath.git", + "reference": "b982ee2edafd4075b22372596ab2e2fdd0f6424e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendMath/zipball/b982ee2edafd4075b22372596ab2e2fdd0f6424e", + "reference": "b982ee2edafd4075b22372596ab2e2fdd0f6424e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-bcmath": "If using the bcmath functionality", + "ext-gmp": "If using the gmp functionality", + "ircmaxell/random-lib": "Fallback random byte generator for Zend\\Math\\Rand if OpenSSL/Mcrypt extensions are unavailable", + "zendframework/zend-servicemanager": ">= current version, if using the BigInteger::factory functionality" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Math\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "math", + "zf2" + ], + "time": "2014-03-05 18:00:06" + }, + { + "name": "zendframework/zend-serializer", + "version": "2.1.6", + "target-dir": "Zend/Serializer", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendSerializer.git", + "reference": "d76b931d3ffa842a496c9fa319bbe285b5ddfade" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendSerializer/zipball/d76b931d3ffa842a496c9fa319bbe285b5ddfade", + "reference": "d76b931d3ffa842a496c9fa319bbe285b5ddfade", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "zendframework/zend-json": "self.version", + "zendframework/zend-math": "self.version", + "zendframework/zend-stdlib": "self.version" + }, + "suggest": { + "zendframework/zend-servicemanager": "To support plugin manager support" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Serializer\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides an adapter based interface to simply generate storable representation of PHP types by different facilities, and recover", + "keywords": [ + "serializer", + "zf2" + ], + "time": "2014-01-02 18:00:26" + }, + { + "name": "zendframework/zend-servicemanager", + "version": "2.1.6", + "target-dir": "Zend/ServiceManager", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendServiceManager.git", + "reference": "de182a20dfdcf978c49570514103c7477ef16e4f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendServiceManager/zipball/de182a20dfdcf978c49570514103c7477ef16e4f", + "reference": "de182a20dfdcf978c49570514103c7477ef16e4f", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "zendframework/zend-di": "Zend\\Di component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\ServiceManager\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "servicemanager", + "zf2" + ], + "time": "2014-03-03 21:00:04" + }, + { + "name": "zendframework/zend-stdlib", + "version": "2.1.6", + "target-dir": "Zend/Stdlib", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendStdlib.git", + "reference": "e646729f2274f4552b6a92e38d8e458efe08ebc5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendStdlib/zipball/e646729f2274f4552b6a92e38d8e458efe08ebc5", + "reference": "e646729f2274f4552b6a92e38d8e458efe08ebc5", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "zendframework/zend-eventmanager": "To support aggregate hydrator usage", + "zendframework/zend-servicemanager": "To support hydrator plugin manager usage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Stdlib\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "stdlib", + "zf2" + ], + "time": "2014-01-04 13:00:28" + }, + { + "name": "zetacomponents/base", + "version": "1.8", + "source": { + "type": "git", + "url": "https://github.com/zetacomponents/Base.git", + "reference": "52ca69c1de55f3fa4f595779e5bc831da7ee176c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zetacomponents/Base/zipball/52ca69c1de55f3fa4f595779e5bc831da7ee176c", + "reference": "52ca69c1de55f3fa4f595779e5bc831da7ee176c", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "src" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "apache2" + ], + "authors": [ + { + "name": "Sergey Alexeev" + }, + { + "name": "Sebastian Bergmann" + }, + { + "name": "Jan Borsodi" + }, + { + "name": "Raymond Bosman" + }, + { + "name": "Frederik Holljen" + }, + { + "name": "Kore Nordmann" + }, + { + "name": "Derick Rethans" + }, + { + "name": "Vadym Savchuk" + }, + { + "name": "Tobias Schlitt" + }, + { + "name": "Alexandru Stanoi" + } + ], + "description": "The Base package provides the basic infrastructure that all packages rely on. Therefore every component relies on this package.", + "homepage": "https://github.com/zetacomponents", + "time": "2009-12-21 12:14:16" + }, + { + "name": "zetacomponents/document", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/zetacomponents/Document.git", + "reference": "688abfde573cf3fe0730f82538fbd7aa9fc95bc8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zetacomponents/Document/zipball/688abfde573cf3fe0730f82538fbd7aa9fc95bc8", + "reference": "688abfde573cf3fe0730f82538fbd7aa9fc95bc8", + "shasum": "" + }, + "require": { + "zetacomponents/base": "*" + }, + "require-dev": { + "zetacomponents/unit-test": "dev-master" + }, + "type": "library", + "autoload": { + "classmap": [ + "src" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Sebastian Bergmann" + }, + { + "name": "Kore Nordmann" + }, + { + "name": "Derick Rethans" + }, + { + "name": "Tobias Schlitt" + }, + { + "name": "Alexandru Stanoi" + } + ], + "description": "The Document components provides a general conversion framework for different semantic document markup languages like XHTML, Docbook, RST and similar.", + "homepage": "https://github.com/zetacomponents", + "time": "2013-12-19 11:40:00" + } + ], + "aliases": [ + + ], + "minimum-stability": "stable", + "stability-flags": [ + + ], + "platform": { + "php": ">=5.3.3", + "ext-xml": "*", + "ext-zip": "*" + }, + "platform-dev": [ + + ] +} diff --git a/docs/intro.rst b/docs/intro.rst index 3c2a47bde5..25a5020521 100644 --- a/docs/intro.rst +++ b/docs/intro.rst @@ -12,18 +12,14 @@ Applications `__ (OpenDocument or ODF), and `Rich Text Format `__ (RTF). -No Windows operating system is needed for usage because the resulting -DOCX, ODT, or RTF files can be opened by all major `word processing -softwares `__. - -PHPWord is an open source project licensed under LGPL version 3. PHPWord is `unit -tested `__ to make sure that -the released versions are stable. - -**Want to contribute?** `Fork -us `__ or -`submit `__ your bug -reports or feature requests to us. +PHPWord is an open source project licensed under the terms of `LGPL +version 3 `__. +PHPWord is aimed to be a high quality software product by incorporating +`continuous integration `__ and +`unit testing `__. +You can learn more about PHPWord by reading this Developers' +Documentation and the `API +Documentation `__. Features -------- @@ -180,3 +176,20 @@ Readers +---------------------------+----------------------+--------+-------+-------+ | | Protection | | | | +---------------------------+----------------------+--------+-------+-------+ + +Contributing +------------ + +We welcome everyone to contribute to PHPWord. Below are some of the +things that you can do to contribute: + +- Read `our contributing + guide `__ +- `Fork us `__ and `request + a pull `__ to the + `develop `__ + branch +- Submit `bug reports or feature + requests `__ to GitHub +- Follow `@PHPWord `__ and + `@PHPOffice `__ on Twitter diff --git a/docs/references.rst b/docs/references.rst index 4f19a8173a..20aa1ed061 100644 --- a/docs/references.rst +++ b/docs/references.rst @@ -3,11 +3,21 @@ References ========== +ISO/IEC 29500, Third edition, 2012-09-01 +--------------------- + +- `Part 1: Fundamentals and Markup Language Reference + `__ +- `Part 2: Open Packaging Conventions + `__ +- `Part 3: Markup Compatibility and Extensibility + `__ +- `Part 4: Transitional Migration Features + `__ + Formal specifications --------------------- -- `Office Open XML (OOXML) (ECMA-376) - Schema `__ - `Oasis OpenDocument Standard Version 1.2 `__ - `Rich Text Format (RTF) Specification, version diff --git a/docs/src/documentation.md b/docs/src/documentation.md index 4ae1f50ec6..a140c5bae0 100644 --- a/docs/src/documentation.md +++ b/docs/src/documentation.md @@ -47,11 +47,7 @@ Don't forget to change `code::` directive to `code-block::` in the resulting rst PHPWord is a library written in pure PHP that provides a set of classes to write to and read from different document file formats. The current version of PHPWord supports Microsoft [Office Open XML](http://en.wikipedia.org/wiki/Office_Open_XML) (OOXML or OpenXML), OASIS [Open Document Format for Office Applications](http://en.wikipedia.org/wiki/OpenDocument) (OpenDocument or ODF), and [Rich Text Format](http://en.wikipedia.org/wiki/Rich_Text_Format) (RTF). -No Windows operating system is needed for usage because the resulting DOCX, ODT, or RTF files can be opened by all major [word processing softwares](http://en.wikipedia.org/wiki/List_of_word_processors). - -PHPWord is an open source project licensed under LGPL version 3. PHPWord is [unit tested](https://travis-ci.org/PHPOffice/PHPWord) to make sure that the released versions are stable. - -**Want to contribute?** [Fork us](https://github.com/PHPOffice/PHPWord/fork) or [submit](https://github.com/PHPOffice/PHPWord/issues) your bug reports or feature requests to us. +PHPWord is an open source project licensed under the terms of [LGPL version 3](https://github.com/PHPOffice/PHPWord/blob/develop/LICENSE.md). PHPWord is aimed to be a high quality software product by incorporating [continuous integration](https://travis-ci.org/PHPOffice/PHPWord) and [unit testing](http://phpoffice.github.io/PHPWord/coverage/develop/). You can learn more about PHPWord by reading this Developers' Documentation and the [API Documentation](http://phpoffice.github.io/PHPWord/docs/develop/). ## Features @@ -142,6 +138,15 @@ Below are the supported features for each file formats. | **Bonus** | Encryption | | | | | | Protection | | | | +## Contributing + +We welcome everyone to contribute to PHPWord. Below are some of the things that you can do to contribute: + +- Read [our contributing guide](https://github.com/PHPOffice/PHPWord/blob/master/CONTRIBUTING.md) +- [Fork us](https://github.com/PHPOffice/PHPWord/fork) and [request a pull](https://github.com/PHPOffice/PHPWord/pulls) to the [develop](https://github.com/PHPOffice/PHPWord/tree/develop) branch +- Submit [bug reports or feature requests](https://github.com/PHPOffice/PHPWord/issues) to GitHub +- Follow [@PHPWord](https://twitter.com/PHPWord) and [@PHPOffice](https://twitter.com/PHPOffice) on Twitter + # Installing/configuring ## Requirements @@ -938,13 +943,18 @@ PHPWord requires PHP 5.3+ since 0.8, while PHPWord 0.6.3 from CodePlex can run w # References +## ISO/IEC 29500, Third edition, 2012-09-01 + +- [Part 1: Fundamentals and Markup Language Reference](http://standards.iso.org/ittf/PubliclyAvailableStandards/c061750_ISO_IEC_29500-1_2012.zip) +- [Part 2: Open Packaging Conventions](http://standards.iso.org/ittf/PubliclyAvailableStandards/c061796_ISO_IEC_29500-2_2012.zip) +- [Part 3: Markup Compatibility and Extensibility](http://standards.iso.org/ittf/PubliclyAvailableStandards/c061797_ISO_IEC_29500-3_2012.zip) +- [Part 4: Transitional Migration Features](http://standards.iso.org/ittf/PubliclyAvailableStandards/c061798_ISO_IEC_29500-4_2012.zip) + ## Formal specifications -- [Office Open XML (OOXML) (ECMA-376) Schema](http://www.schemacentral.com/sc/ooxml/ss.html) -- [Oasis OpenDocument Standard Version 1.2](http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os.html) -- [Rich Text Format (RTF) Specification, version 1.9.1](http://www.microsoft.com/en-us/download/details.aspx?id=10725) +- [Oasis OpenDocument Standard Version 1.2](http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os.html) +- [Rich Text Format (RTF) Specification, version 1.9.1](http://www.microsoft.com/en-us/download/details.aspx?id=10725) ## Other resources -- [DocumentFormat.OpenXml.Wordprocessing Namespace on MSDN](http://msdn.microsoft.com/en-us/library/documentformat.openxml.wordprocessing%28v=office.14%29.aspx) - +- [DocumentFormat.OpenXml.Wordprocessing Namespace on MSDN](http://msdn.microsoft.com/en-us/library/documentformat.openxml.wordprocessing%28v=office.14%29.aspx) diff --git a/samples/Sample_12_HeaderFooter.php b/samples/Sample_12_HeaderFooter.php index 8e05328697..0fd56edc0a 100644 --- a/samples/Sample_12_HeaderFooter.php +++ b/samples/Sample_12_HeaderFooter.php @@ -25,6 +25,7 @@ // Add header for all other pages $subsequent = $section->addHeader(); $subsequent->addText("Subsequent pages in Section 1 will Have this!"); +$subsequent->addImage('resources/_mars.jpg', array('width' => 80, 'height' => 80)); // Add footer $footer = $section->addFooter(); diff --git a/samples/Sample_13_Images.php b/samples/Sample_13_Images.php index 784230650d..dd5209bf6d 100644 --- a/samples/Sample_13_Images.php +++ b/samples/Sample_13_Images.php @@ -31,6 +31,37 @@ $section->addText($text); } +//Absolute positioning +$section->addTextBreak(3); +$section->addText('Absolute positioning: see top right corner of page'); +$section->addImage( + 'resources/_mars.jpg', + array( + 'width' => \PhpOffice\PhpWord\Shared\Drawing::centimetersToPixels(3), + 'height' => \PhpOffice\PhpWord\Shared\Drawing::centimetersToPixels(3), + 'positioning' => \PhpOffice\PhpWord\Style\Image::POSITION_ABSOLUTE, + 'marginLeft' => \PhpOffice\PhpWord\Shared\Drawing::centimetersToPixels(15.5), + 'marginTop' => \PhpOffice\PhpWord\Shared\Drawing::centimetersToPixels(1.55) + ) +); + +//Relative positioning +$section->addTextBreak(3); +$section->addText('Relative positioning: Horizontal position center relative to column,'); +$section->addText('Vertical position top relative to line'); +$section->addImage( + 'resources/_mars.jpg', + array( + 'width' => \PhpOffice\PhpWord\Shared\Drawing::centimetersToPixels(3), + 'height' => \PhpOffice\PhpWord\Shared\Drawing::centimetersToPixels(3), + 'positioning' => \PhpOffice\PhpWord\Style\Image::POSITION_RELATIVE, + 'posHorizontal' => \PhpOffice\PhpWord\Style\Image::POSITION_HORIZONTAL_CENTER, + 'posHorizontalRel' => \PhpOffice\PhpWord\Style\Image::POSITION_RELATIVE_TO_COLUMN, + 'posVertical' => \PhpOffice\PhpWord\Style\Image::POSITION_VERTICAL_TOP, + 'posVerticalRel' => \PhpOffice\PhpWord\Style\Image::POSITION_RELATIVE_TO_LINE + ) +); + // Save file echo write($phpWord, basename(__FILE__, '.php'), $writers); if (!CLI) { diff --git a/src/PhpWord/Autoloader.php b/src/PhpWord/Autoloader.php index 0688ffda57..6acfff21e5 100644 --- a/src/PhpWord/Autoloader.php +++ b/src/PhpWord/Autoloader.php @@ -1,9 +1,17 @@ $allContainers, 'Link' => $allContainers, @@ -355,7 +356,7 @@ private function checkElementDocPart() $docPart = $isCellTextrun ? $this->getDocPart() : $this->container; $docPartId = $isCellTextrun ? $this->getDocPartId() : $this->sectionId; $inHeaderFooter = ($docPart == 'header' || $docPart == 'footer'); - + $docPartId = $inHeaderFooter ? $this->getDocPartId() : $docPartId; return $inHeaderFooter ? $docPart . $docPartId : $docPart; } diff --git a/src/PhpWord/Element/AbstractElement.php b/src/PhpWord/Element/AbstractElement.php index 9c0a48c49a..5ed5209ffd 100644 --- a/src/PhpWord/Element/AbstractElement.php +++ b/src/PhpWord/Element/AbstractElement.php @@ -1,9 +1,17 @@ type = self::EVEN; } + /** + * Add textbox element + * + * @param mixed $style + * @return \PhpOffice\PhpWord\Element\TextBox + * @todo Merge with the same function on Section + */ + public function addTextBox($style = null) + { + $textbox = new TextBox($this->getDocPart(), $this->getDocPartId(), $style); + $this->addElement($textbox); + + return $textbox; + } + /** * Add table element * diff --git a/src/PhpWord/Element/Footnote.php b/src/PhpWord/Element/Footnote.php index 79117d0adb..d59a10a5d0 100644 --- a/src/PhpWord/Element/Footnote.php +++ b/src/PhpWord/Element/Footnote.php @@ -1,9 +1,17 @@ addElement(new PageBreak()); } + /** + * Add textbox element + * + * @param mixed $style + * @return \PhpOffice\PhpWord\Element\TextBox + * @todo Merge with the same function on Footer + */ + public function addTextBox($style = null) + { + $textbox = new TextBox($this->getDocPart(), $this->getDocPartId(), $style); + $this->addElement($textbox); + + return $textbox; + } + /** * Add table element * diff --git a/src/PhpWord/Element/TOC.php b/src/PhpWord/Element/TOC.php index 3c8e6386e8..2ecb091d9b 100644 --- a/src/PhpWord/Element/TOC.php +++ b/src/PhpWord/Element/TOC.php @@ -1,9 +1,17 @@ container = 'textbox'; + $this->setDocPart($docPart, $docPartId); + $this->style = $this->setStyle(new TextBoxStyle(), $style); + } + + /** + * Get textbox style + * + * @return \PhpOffice\PhpWord\Style\TextBox + */ + public function getStyle() + { + return $this->style; + } +} \ No newline at end of file diff --git a/src/PhpWord/Element/TextBreak.php b/src/PhpWord/Element/TextBreak.php index d8157c02d4..02518373ed 100644 --- a/src/PhpWord/Element/TextBreak.php +++ b/src/PhpWord/Element/TextBreak.php @@ -1,9 +1,17 @@ collection}"; + $collection = $phpWord->$getMethod()->getItems(); + + $xmlReader = new XMLReader(); + $xmlReader->getDomFromZip($this->docFile, $this->xmlFile); + $nodes = $xmlReader->getElements('*'); + if ($nodes->length > 0) { + foreach ($nodes as $node) { + $id = $xmlReader->getAttribute('w:id', $node); + $type = $xmlReader->getAttribute('w:type', $node); + + // Avoid w:type "separator" and "continuationSeparator" + // Only look for or without w:type attribute + if (is_null($type) && array_key_exists($id, $collection)) { + $element = $collection[$id]; + $pNodes = $xmlReader->getElements('w:p/*', $node); + foreach ($pNodes as $pNode) { + $this->readRun($xmlReader, $pNode, $element, $this->collection); + } + $addMethod = "add{$this->element}"; + $phpWord->$addMethod($element); + } + } + } + } } diff --git a/src/PhpWord/Reader/Word2007/Notes.php b/src/PhpWord/Reader/Word2007/Notes.php deleted file mode 100644 index a213b7f154..0000000000 --- a/src/PhpWord/Reader/Word2007/Notes.php +++ /dev/null @@ -1,60 +0,0 @@ -type = ($this->type == 'endnotes') ? 'endnotes' : 'footnotes'; - $getMethod = 'get' . $this->type; - $collection = $phpWord->$getMethod()->getItems(); - - $xmlReader = new XMLReader(); - $xmlReader->getDomFromZip($this->docFile, $this->xmlFile); - $nodes = $xmlReader->getElements('*'); - if ($nodes->length > 0) { - foreach ($nodes as $node) { - $id = $xmlReader->getAttribute('w:id', $node); - $type = $xmlReader->getAttribute('w:type', $node); - - // Avoid w:type "separator" and "continuationSeparator" - // Only look for or without w:type attribute - if (is_null($type) && array_key_exists($id, $collection)) { - $element = $collection[$id]; - $pNodes = $xmlReader->getElements('w:p/*', $node); - foreach ($pNodes as $pNode) { - $this->readRun($xmlReader, $pNode, $element, $this->type); - } - $addMethod = 'add' . ($this->type == 'endnotes' ? 'endnote' : 'footnote'); - $phpWord->$addMethod($element); - } - } - } - } -} diff --git a/src/PhpWord/Reader/Word2007/Numbering.php b/src/PhpWord/Reader/Word2007/Numbering.php index a45614924a..68a36d57ec 100644 --- a/src/PhpWord/Reader/Word2007/Numbering.php +++ b/src/PhpWord/Reader/Word2007/Numbering.php @@ -1,9 +1,17 @@ pattern = $value; + $enum = array(self::PATTERN_CLEAR, self::PATTERN_SOLID, self::PATTERN_HSTRIPE, + self::PATTERN_VSTRIPE, self::PATTERN_DSTRIPE, self::PATTERN_HCROSS, self::PATTERN_DCROSS); + + $this->pattern = $this->setEnumVal($value, $enum, $this->pattern); return $this; } diff --git a/src/PhpWord/Style/Spacing.php b/src/PhpWord/Style/Spacing.php index 609ef5a058..9c9f3a8167 100644 --- a/src/PhpWord/Style/Spacing.php +++ b/src/PhpWord/Style/Spacing.php @@ -1,9 +1,17 @@ indent = 200; } /** diff --git a/src/PhpWord/Style/Tab.php b/src/PhpWord/Style/Tab.php index 6e44eeade9..4bbba164db 100644 --- a/src/PhpWord/Style/Tab.php +++ b/src/PhpWord/Style/Tab.php @@ -1,9 +1,17 @@ shading)) { return $this->shading->getFill(); + } else { + return null; } } diff --git a/src/PhpWord/Style/TextBox.php b/src/PhpWord/Style/TextBox.php new file mode 100644 index 0000000000..7e83da6a05 --- /dev/null +++ b/src/PhpWord/Style/TextBox.php @@ -0,0 +1,641 @@ +setWrappingStyle(self::WRAPPING_STYLE_INLINE); + $this->setPosHorizontal(self::POSITION_HORIZONTAL_LEFT); + $this->setPosHorizontalRel(self::POSITION_RELATIVE_TO_CHAR); + $this->setPosVertical(self::POSITION_VERTICAL_TOP); + $this->setPosVerticalRel(self::POSITION_RELATIVE_TO_LINE); + } + + /** + * Get width + */ + public function getWidth() + { + return $this->width; + } + + /** + * Set width + * + * @param int $value + */ + public function setWidth($value = null) + { + $this->width = $value; + } + + /** + * Get height + */ + public function getHeight() + { + return $this->height; + } + + /** + * Set height + * + * @param int $value + */ + public function setHeight($value = null) + { + $this->height = $value; + } + + /** + * Get alignment + */ + public function getAlign() + { + return $this->align; + } + + /** + * Set alignment + * + * @param string $value + */ + public function setAlign($value = null) + { + $this->align = $value; + } + + /** + * Get Margin Top + * + * @return int + */ + public function getMarginTop() + { + return $this->marginTop; + } + + /** + * Set Margin Top + * + * @param int $value + * @return self + */ + public function setMarginTop($value = null) + { + $this->marginTop = $value; + return $this; + } + + /** + * Get Margin Left + * + * @return int + */ + public function getMarginLeft() + { + return $this->marginLeft; + } + + /** + * Set Margin Left + * + * @param int $value + * @return self + */ + public function setMarginLeft($value = null) + { + $this->marginLeft = $value; + return $this; + } + + /** + * Get wrapping style + * + * @return string + */ + public function getWrappingStyle() + { + return $this->wrappingStyle; + } + + /** + * Set wrapping style + * + * @param string $wrappingStyle + * @throws \InvalidArgumentException + * @return self + */ + public function setWrappingStyle($wrappingStyle) + { + $enum = array(self::WRAPPING_STYLE_INLINE, self::WRAPPING_STYLE_INFRONT, self::WRAPPING_STYLE_BEHIND, + self::WRAPPING_STYLE_SQUARE, self::WRAPPING_STYLE_TIGHT); + + if (in_array($wrappingStyle, $enum)) { + $this->wrappingStyle = $wrappingStyle; + } else { + throw new \InvalidArgumentException('Invalid wrapping style.'); + } + + return $this; + } + + /** + * Get positioning type + * + * @return string + */ + public function getPositioning() + { + return $this->positioning; + } + + /** + * Set positioning type + * + * @param string $positioning + * @throws \InvalidArgumentException + * @return self + */ + public function setPositioning($positioning) + { + $enum = array(self::POSITION_RELATIVE, self::POSITION_ABSOLUTE); + + if (in_array($positioning, $enum)) { + $this->positioning = $positioning; + } else { + throw new \InvalidArgumentException('Invalid positioning.'); + } + + return $this; + } + + /** + * Get horizontal alignment + * + * @return string + */ + public function getPosHorizontal() + { + return $this->posHorizontal; + } + + /** + * Set horizontal alignment + * + * @param string $alignment + * @throws \InvalidArgumentException + * @return self + */ + public function setPosHorizontal($alignment) + { + $enum = array(self::POSITION_HORIZONTAL_LEFT, self::POSITION_HORIZONTAL_CENTER, + self::POSITION_HORIZONTAL_RIGHT); + + if (in_array($alignment, $enum)) { + $this->posHorizontal = $alignment; + } else { + throw new \InvalidArgumentException('Invalid horizontal alignment.'); + } + + return $this; + } + + /** + * Get vertical alignment + * + * @return string + */ + public function getPosVertical() + { + return $this->posVertical; + } + + /** + * Set vertical alignment + * + * @param string $alignment + * @throws \InvalidArgumentException + * @return self + */ + public function setPosVertical($alignment) + { + $enum = array(self::POSITION_VERTICAL_TOP, self::POSITION_VERTICAL_CENTER, + self::POSITION_VERTICAL_BOTTOM, self::POSITION_VERTICAL_INSIDE, self::POSITION_VERTICAL_OUTSIDE); + + if (in_array($alignment, $enum)) { + $this->posVertical = $alignment; + } else { + throw new \InvalidArgumentException('Invalid vertical alignment.'); + } + + return $this; + } + + /** + * Get horizontal relation + * + * @return string + */ + public function getPosHorizontalRel() + { + return $this->posHorizontalRel; + } + + /** + * Set horizontal relation + * + * @param string $relto + * @throws \InvalidArgumentException + * @return self + */ + public function setPosHorizontalRel($relto) + { + $enum = array(self::POSITION_RELATIVE_TO_MARGIN, self::POSITION_RELATIVE_TO_PAGE, + self::POSITION_RELATIVE_TO_COLUMN, self::POSITION_RELATIVE_TO_CHAR, + self::POSITION_RELATIVE_TO_LMARGIN, self::POSITION_RELATIVE_TO_RMARGIN, + self::POSITION_RELATIVE_TO_IMARGIN, self::POSITION_RELATIVE_TO_OMARGIN); + + if (in_array($relto, $enum)) { + $this->posHorizontalRel = $relto; + } else { + throw new \InvalidArgumentException('Invalid relative horizontal alignment.'); + } + + return $this; + } + + /** + * Get vertical relation + * + * @return string + */ + public function getPosVerticalRel() + { + return $this->posVerticalRel; + } + + /** + * Set vertical relation + * + * @param string $relto + * @throws \InvalidArgumentException + * @return self + */ + public function setPosVerticalRel($relto) + { + $enum = array(self::POSITION_RELATIVE_TO_MARGIN, self::POSITION_RELATIVE_TO_PAGE, + self::POSITION_RELATIVE_TO_LINE, + self::POSITION_RELATIVE_TO_TMARGIN, self::POSITION_RELATIVE_TO_BMARGIN, + self::POSITION_RELATIVE_TO_IMARGIN, self::POSITION_RELATIVE_TO_OMARGIN); + + if (in_array($relto, $enum)) { + $this->posVerticalRel = $relto; + } else { + throw new \InvalidArgumentException('Invalid relative vertical alignment.'); + } + + return $this; + } + /** + * Set margin top + * + * @param int $value + */ + public function setInnerMarginTop($value = null) + { + $this->innerMarginTop = $value; + } + + /** + * Get margin top + * + * @return int + */ + public function getInnerMarginTop() + { + return $this->innerMarginTop; + } + + /** + * Set margin left + * + * @param int $value + */ + public function setInnerMarginLeft($value = null) + { + $this->innerMarginLeft = $value; + } + + /** + * Get margin left + * + * @return int + */ + public function getInnerMarginLeft() + { + return $this->innerMarginLeft; + } + + /** + * Set margin right + * + * @param int $value + */ + public function setInnerMarginRight($value = null) + { + $this->innerMarginRight = $value; + } + + /** + * Get margin right + * + * @return int + */ + public function getInnerMarginRight() + { + return $this->innerMarginRight; + } + + /** + * Set margin bottom + * + * @param int $value + */ + public function setInnerMarginBottom($value = null) + { + $this->innerMarginBottom = $value; + } + + /** + * Get margin bottom + * + * @return int + */ + public function getInnerMarginBottom() + { + return $this->innerMarginBottom; + } + + /** + * Set TLRB cell margin + * + * @param int $value Margin in twips + */ + public function setInnerMargin($value = null) + { + $this->setInnerMarginTop($value); + $this->setInnerMarginLeft($value); + $this->setInnerMarginRight($value); + $this->setInnerMarginBottom($value); + } + + /** + * Get cell margin + * + * @return int[] + */ + public function getInnerMargin() + { + return array($this->innerMarginLeft, $this->innerMarginTop, $this->innerMarginRight, $this->innerMarginBottom); + } + + /** + * Set border size + * + * @param int $value Size in points + */ + public function setBorderSize($value = null) + { + $this->borderSize = $value; + } + + /** + * Get border size + * + * @return int + */ + public function getBorderSize() + { + return $this->borderSize; + } + + /** + * Set border color + * + * @param string $value + */ + public function setBorderColor($value = null) + { + $this->borderColor = $value; + } + + /** + * Get border color + * + * @return string + */ + public function getBorderColor() + { + return $this->borderColor; + } +} \ No newline at end of file diff --git a/src/PhpWord/Template.php b/src/PhpWord/Template.php index bdc000c47f..97bd601ed6 100644 --- a/src/PhpWord/Template.php +++ b/src/PhpWord/Template.php @@ -1,9 +1,17 @@ element->getStyle(); + if ($tbxStyle instanceof TextBoxStyle) { + $styleWriter = new TextBoxStyleWriter($this->xmlWriter, $tbxStyle); + $styleWriter->write(); + } + + if (!$this->withoutP) { + $this->xmlWriter->startElement('w:p'); + if (!is_null($tbxStyle->getAlign())) { + $this->xmlWriter->startElement('w:pPr'); + $this->xmlWriter->startElement('w:jc'); + $this->xmlWriter->writeAttribute('w:val', $tbxStyle->getAlign()); + $this->xmlWriter->endElement(); // w:jc + $this->xmlWriter->endElement(); // w:pPr + } + } + + $this->xmlWriter->startElement('w:r'); + $this->xmlWriter->startElement('w:pict'); + $this->xmlWriter->startElement('v:shape'); + $this->xmlWriter->writeAttribute('type', '#_x0000_t0202'); + $styleWriter->write(); + $this->xmlWriter->startElement('v:textbox'); + $margins=implode(', ',$tbxStyle->getInnerMargin()); + $this->xmlWriter->writeAttribute('inset', $margins); + $this->xmlWriter->startElement('w:txbxContent'); + $this->parentWriter->writeContainerElements($this->xmlWriter, $this->element); + $this->xmlWriter->endElement(); // w:txbxContent + $this->xmlWriter->endElement(); // v: textbox + $styleWriter->writeW10Wrap(); + $this->xmlWriter->endElement(); // v:shape + $this->xmlWriter->endElement(); // w:pict + $this->xmlWriter->endElement(); // w:r + + if (!$this->withoutP) { + $this->xmlWriter->endElement(); // w:p + } + } +} \ No newline at end of file diff --git a/src/PhpWord/Writer/Word2007/Element/TextBreak.php b/src/PhpWord/Writer/Word2007/Element/TextBreak.php index 67219f94eb..99dece43c5 100644 --- a/src/PhpWord/Writer/Word2007/Element/TextBreak.php +++ b/src/PhpWord/Writer/Word2007/Element/TextBreak.php @@ -1,9 +1,17 @@ array_merge($elmMainCell, array('Table', 'Footnote', 'Title', 'PageBreak', 'TOC')), - 'Header' => array_merge($elmMainCell, array('Table', 'PreserveText')), - 'Footer' => array_merge($elmMainCell, array('Table', 'PreserveText')), + 'Section' => array_merge($elmMainCell, array('Table', 'Footnote', 'Title', 'PageBreak', 'TOC', 'TextBox')), + 'Header' => array_merge($elmMainCell, array('Table', 'PreserveText', 'TextBox')), + 'Footer' => array_merge($elmMainCell, array('Table', 'PreserveText', 'TextBox')), 'Cell' => array_merge($elmMainCell, array('PreserveText', 'Footnote', 'Endnote')), + 'TextBox' => array_merge($elmMainCell, array('PreserveText', 'Footnote', 'Endnote')), 'TextRun' => array_merge($elmCommon, array('Footnote', 'Endnote')), 'Footnote' => $elmCommon, 'Endnote' => $elmCommon, @@ -96,7 +105,7 @@ public function writeContainerElements(XMLWriter $xmlWriter, AbstractElement $co $containerName = get_class($container); $containerName = substr($containerName, strrpos($containerName, '\\') + 1); if (!array_key_exists($containerName, $allowedElements)) { - throw new Exception('Invalid container.'); + throw new Exception('Invalid container.'.$containerName. print_r($allowedElements, true)); } // Loop through elements diff --git a/src/PhpWord/Writer/Word2007/Part/ContentTypes.php b/src/PhpWord/Writer/Word2007/Part/ContentTypes.php index 24df901146..73677d858d 100644 --- a/src/PhpWord/Writer/Word2007/Part/ContentTypes.php +++ b/src/PhpWord/Writer/Word2007/Part/ContentTypes.php @@ -1,9 +1,17 @@ getXmlWriter(); $xmlWriter->startDocument('1.0', 'UTF-8', 'yes'); - $xmlWriter->startElement('w:ftr'); + $xmlWriter->startElement($this->rootElement); $xmlWriter->writeAttribute('xmlns:ve', 'http://schemas.openxmlformats.org/markup-compatibility/2006'); $xmlWriter->writeAttribute('xmlns:o', 'urn:schemas-microsoft-com:office:office'); $xmlWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); @@ -37,9 +52,9 @@ public function writeFooter(FooterElement $footer) $xmlWriter->writeAttribute('xmlns:w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'); $xmlWriter->writeAttribute('xmlns:wne', 'http://schemas.microsoft.com/office/word/2006/wordml'); - $this->writeContainerElements($xmlWriter, $footer); + $this->writeContainerElements($xmlWriter, $element); - $xmlWriter->endElement(); // w:ftr + $xmlWriter->endElement(); // $this->rootElement return $xmlWriter->getData(); } diff --git a/src/PhpWord/Writer/Word2007/Part/Footnotes.php b/src/PhpWord/Writer/Word2007/Part/Footnotes.php index 05bf17d190..42ea99058d 100644 --- a/src/PhpWord/Writer/Word2007/Part/Footnotes.php +++ b/src/PhpWord/Writer/Word2007/Part/Footnotes.php @@ -1,9 +1,17 @@ getXmlWriter(); - - $xmlWriter->startDocument('1.0', 'UTF-8', 'yes'); - $xmlWriter->startElement('w:hdr'); - $xmlWriter->writeAttribute('xmlns:ve', 'http://schemas.openxmlformats.org/markup-compatibility/2006'); - $xmlWriter->writeAttribute('xmlns:o', 'urn:schemas-microsoft-com:office:office'); - $xmlWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); - $xmlWriter->writeAttribute('xmlns:m', 'http://schemas.openxmlformats.org/officeDocument/2006/math'); - $xmlWriter->writeAttribute('xmlns:v', 'urn:schemas-microsoft-com:vml'); - $xmlWriter->writeAttribute('xmlns:wp', 'http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing'); - $xmlWriter->writeAttribute('xmlns:w10', 'urn:schemas-microsoft-com:office:word'); - $xmlWriter->writeAttribute('xmlns:w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'); - $xmlWriter->writeAttribute('xmlns:wne', 'http://schemas.microsoft.com/office/word/2006/wordml'); - - $this->writeContainerElements($xmlWriter, $header); - - $xmlWriter->endElement(); // w:hdr - - return $xmlWriter->getData(); + return $this->writeFooter($element); } } diff --git a/src/PhpWord/Writer/Word2007/Part/Numbering.php b/src/PhpWord/Writer/Word2007/Part/Numbering.php index 723a043f90..18c8f8f4d0 100644 --- a/src/PhpWord/Writer/Word2007/Part/Numbering.php +++ b/src/PhpWord/Writer/Word2007/Part/Numbering.php @@ -1,9 +1,17 @@ style instanceof \PhpOffice\PhpWord\Style\TextBox)) { + return; + } + + $wrapping = $this->style->getWrappingStyle(); + $positioning = $this->style->getPositioning(); + + // Default style array + $styleArray = array( + 'mso-width-percent' => '0', + 'mso-height-percent' => '0', + 'mso-width-relative' => 'margin', + 'mso-height-relative' => 'margin', + ); + $styleArray = array_merge($styleArray, $this->getElementStyle()); + + // Absolute/relative positioning + $styleArray['position'] = $positioning; + if ($positioning == TextBoxStyle::POSITION_ABSOLUTE) { + $styleArray['mso-position-horizontal-relative'] = 'page'; + $styleArray['mso-position-vertical-relative'] = 'page'; + } elseif ($positioning == TextBoxStyle::POSITION_RELATIVE) { + $styleArray['mso-position-horizontal'] = $this->style->getPosHorizontal(); + $styleArray['mso-position-vertical'] = $this->style->getPosVertical(); + $styleArray['mso-position-horizontal-relative'] = $this->style->getPosHorizontalRel(); + $styleArray['mso-position-vertical-relative'] = $this->style->getPosVerticalRel(); + $styleArray['margin-left'] = 0; + $styleArray['margin-top'] = 0; + } + + // Wrapping style + if ($wrapping == TextBoxStyle::WRAPPING_STYLE_INLINE) { + // Nothing to do when inline + } elseif ($wrapping == TextBoxStyle::WRAPPING_STYLE_BEHIND) { + $styleArray['z-index'] = -251658752; + } else { + $styleArray['z-index'] = 251659264; + $styleArray['mso-position-horizontal'] = 'absolute'; + $styleArray['mso-position-vertical'] = 'absolute'; + } + + // w10 wrapping + if ($wrapping == TextBoxStyle::WRAPPING_STYLE_SQUARE) { + $this->w10wrap = 'square'; + } elseif ($wrapping == TextBoxStyle::WRAPPING_STYLE_TIGHT) { + $this->w10wrap = 'tight'; + } + + $textboxStyle = $this->assembleStyle($styleArray); + + $this->xmlWriter->writeAttribute('style', $textboxStyle); + + $borderSize = $this->style->getBorderSize(); + if ($borderSize !== null) { + $this->xmlWriter->writeAttribute('strokeweight', $this->style->getBorderSize().'pt'); + } + + $borderColor = $this->style->getBorderColor(); + if (empty($borderColor)) { + $this->xmlWriter->writeAttribute('stroked', 'f'); + } else { + $this->xmlWriter->writeAttribute('strokecolor', $borderColor); + } + //@todo + + } + + /** + * Write w10 wrapping + * + * @return array + */ + public function writeW10Wrap() + { + if (!is_null($this->w10wrap)) { + $this->xmlWriter->startElement('w10:wrap'); + $this->xmlWriter->writeAttribute('type', $this->w10wrap); + + switch ($this->style->getPositioning()) { + case TextBoxStyle::POSITION_ABSOLUTE: + $this->xmlWriter->writeAttribute('anchorx', "page"); + $this->xmlWriter->writeAttribute('anchory', "page"); + break; + case TextBoxStyle::POSITION_RELATIVE: + switch ($this->style->getPosVerticalRel()) { + case TextBoxStyle::POSITION_RELATIVE_TO_MARGIN: + $this->xmlWriter->writeAttribute('anchory', "margin"); + break; + case TextBoxStyle::POSITION_RELATIVE_TO_PAGE: + $this->xmlWriter->writeAttribute('anchory', "page"); + break; + case TextBoxStyle::POSITION_RELATIVE_TO_TMARGIN: + $this->xmlWriter->writeAttribute('anchory', "margin"); + break; + case TextBoxStyle::POSITION_RELATIVE_TO_BMARGIN: + $this->xmlWriter->writeAttribute('anchory', "page"); + break; + } + switch ($this->style->getPosHorizontalRel()) { + case TextBoxStyle::POSITION_RELATIVE_TO_MARGIN: + $this->xmlWriter->writeAttribute('anchorx', "margin"); + break; + case TextBoxStyle::POSITION_RELATIVE_TO_PAGE: + $this->xmlWriter->writeAttribute('anchorx', "page"); + break; + case TextBoxStyle::POSITION_RELATIVE_TO_LMARGIN: + $this->xmlWriter->writeAttribute('anchorx', "margin"); + break; + case TextBoxStyle::POSITION_RELATIVE_TO_RMARGIN: + $this->xmlWriter->writeAttribute('anchorx', "page"); + break; + } + } + + $this->xmlWriter->endElement(); // w10:wrap + } + } + + /** + * Get element style + * + * @return array + */ + private function getElementStyle() + { + $styles = array(); + $styleValues = array( + 'width' => $this->style->getWidth(), + 'height' => $this->style->getHeight(), + 'margin-top' => $this->style->getMarginTop(), + 'margin-left' => $this->style->getMarginLeft() + ); + foreach ($styleValues as $key => $value) { + if (!is_null($value) && $value != '') { + $styles[$key] = $value . 'px'; + } + } + + return $styles; + } + + /** + * Assemble style array into style string + * + * @param array $styles + * @return string + */ + private function assembleStyle($styles = array()) + { + $style = ''; + foreach ($styles as $key => $value) { + if (!is_null($value) && $value != '') { + $style .= "{$key}:{$value}; "; + } + } + + return trim($style); + } +} diff --git a/src/PhpWord/Writer/WriterInterface.php b/src/PhpWord/Writer/WriterInterface.php index 3bc0c38da8..a56bcf8fd3 100644 --- a/src/PhpWord/Writer/WriterInterface.php +++ b/src/PhpWord/Writer/WriterInterface.php @@ -1,9 +1,17 @@ addItem(new Footnote()); // addItem #1 + + $this->assertEquals(2, $object->addItem(new Footnote())); // addItem #2. Should returns new item index + $this->assertEquals(2, $object->countItems()); // There are two items now + $this->assertEquals(2, count($object->getItems())); // getItems returns array + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Footnote', $object->getItem(1)); // getItem returns object + $this->assertNull($object->getItem(3)); // getItem returns null when invalid index is referenced + + $object->setItem(2, null); // Set item #2 to null + + $this->assertNull($object->getItem(2)); // Check if it's null + } +} diff --git a/tests/PhpWord/Tests/DocumentPropertiesTest.php b/tests/PhpWord/Tests/DocumentPropertiesTest.php index 20545c1ec3..30b2a7bc48 100644 --- a/tests/PhpWord/Tests/DocumentPropertiesTest.php +++ b/tests/PhpWord/Tests/DocumentPropertiesTest.php @@ -1,9 +1,17 @@ assertEquals('Font Style', $object->getStyleFont()); } + /** + * Test when no PHPWord object is assigned: + */ + public function testNoPhpWord() + { + $object = new TOC(); + + $this->assertEmpty($object->getTitles()); + $this->assertNull($object->getPhpWord()); + } + /** * Set/get minDepth and maxDepth */ diff --git a/tests/PhpWord/Tests/Element/TableTest.php b/tests/PhpWord/Tests/Element/TableTest.php index b8325aca5f..1c87c2cf45 100644 --- a/tests/PhpWord/Tests/Element/TableTest.php +++ b/tests/PhpWord/Tests/Element/TableTest.php @@ -1,9 +1,17 @@ assertInstanceOf('PhpOffice\\PhpWord\\Element\\TextBox', $oTextBox); + $this->assertEquals($oTextBox->getStyle(), null); + } + + /** + * Get style name + */ + public function testStyleText() + { + $oTextBox = new TextBox('section', 1, 'textBoxStyle'); + + $this->assertEquals($oTextBox->getStyle(), 'textBoxStyle'); + } + + /** + * Get style array + */ + public function testStyleArray() + { + $oTextBox = new TextBox( + 'section', + 1, + array( + 'width' => \PhpOffice\PhpWord\Shared\Drawing::centimetersToPixels(4.5), + 'height' => \PhpOffice\PhpWord\Shared\Drawing::centimetersToPixels(17.5), + 'positioning' => 'absolute', + 'marginLeft' => \PhpOffice\PhpWord\Shared\Drawing::centimetersToPixels(15.4), + 'marginTop' => \PhpOffice\PhpWord\Shared\Drawing::centimetersToPixels(9.9), + 'stroke' => 0, + 'innerMargin' => 0, + 'borderSize' => 1, + 'borderColor' => '' + ) + ); + + $this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\TextBox', $oTextBox->getStyle()); + } +} diff --git a/tests/PhpWord/Tests/Element/TextBreakTest.php b/tests/PhpWord/Tests/Element/TextBreakTest.php index 1ef33c6b7a..1d9479ee3e 100644 --- a/tests/PhpWord/Tests/Element/TextBreakTest.php +++ b/tests/PhpWord/Tests/Element/TextBreakTest.php @@ -1,9 +1,17 @@ array(0, 10), + 'right' => array(0, 10), + 'firstLine' => array(null, 20), + 'hanging' => array(null, 20), + ); + foreach ($properties as $property => $value) { + list($default, $expected) = $value; + $get = "get{$property}"; + $set = "set{$property}"; + + $this->assertEquals($default, $object->$get()); // Default value + + $object->$set($expected); + + $this->assertEquals($expected, $object->$get()); // New value + } + } +} diff --git a/tests/PhpWord/Tests/Style/LineNumberingTest.php b/tests/PhpWord/Tests/Style/LineNumberingTest.php new file mode 100644 index 0000000000..bc4dc603f3 --- /dev/null +++ b/tests/PhpWord/Tests/Style/LineNumberingTest.php @@ -0,0 +1,53 @@ + array(1, 2), + 'increment' => array(1, 10), + 'distance' => array(null, 10), + 'restart' => array(null, 'continuous'), + ); + foreach ($properties as $property => $value) { + list($default, $expected) = $value; + $get = "get{$property}"; + $set = "set{$property}"; + + $this->assertEquals($default, $object->$get()); // Default value + + $object->$set($expected); + + $this->assertEquals($expected, $object->$get()); // New value + } + } +} diff --git a/tests/PhpWord/Tests/Style/ListItemTest.php b/tests/PhpWord/Tests/Style/ListItemTest.php index c6224d756f..a97c8dd604 100644 --- a/tests/PhpWord/Tests/Style/ListItemTest.php +++ b/tests/PhpWord/Tests/Style/ListItemTest.php @@ -1,9 +1,17 @@ object = new Numbering(); + $this->properties = array( + 'numId' => array(null, 1), + 'type' => array(null, 'singleLevel'), + ); + foreach ($this->properties as $property => $value) { + list($default, $expected) = $value; + $get = "get{$property}"; + $set = "set{$property}"; + + $this->assertEquals($default, $this->object->$get()); // Default value + + $this->object->$set($expected); + + $this->assertEquals($expected, $this->object->$get()); // New value + } + } + + /** + * Test get level + */ + public function testGetLevels() + { + $this->object = new Numbering(); + + $this->assertEmpty($this->object->getLevels()); + } +} diff --git a/tests/PhpWord/Tests/Style/ParagraphTest.php b/tests/PhpWord/Tests/Style/ParagraphTest.php index b51bd8ec16..357371c670 100644 --- a/tests/PhpWord/Tests/Style/ParagraphTest.php +++ b/tests/PhpWord/Tests/Style/ParagraphTest.php @@ -1,9 +1,17 @@ array('clear', 'solid'), + 'color' => array(null, 'FF0000'), + 'fill' => array(null, 'FF0000'), + ); + foreach ($properties as $property => $value) { + list($default, $expected) = $value; + $get = "get{$property}"; + $set = "set{$property}"; + + $this->assertEquals($default, $object->$get()); // Default value + + $object->$set($expected); + + $this->assertEquals($expected, $object->$get()); // New value + } + } +} diff --git a/tests/PhpWord/Tests/Style/SpacingTest.php b/tests/PhpWord/Tests/Style/SpacingTest.php new file mode 100644 index 0000000000..a4022b74bd --- /dev/null +++ b/tests/PhpWord/Tests/Style/SpacingTest.php @@ -0,0 +1,53 @@ + array(null, 10), + 'after' => array(null, 10), + 'line' => array(null, 10), + 'rule' => array('auto', 'exact'), + ); + foreach ($properties as $property => $value) { + list($default, $expected) = $value; + $get = "get{$property}"; + $set = "set{$property}"; + + $this->assertEquals($default, $object->$get()); // Default value + + $object->$set($expected); + + $this->assertEquals($expected, $object->$get()); // New value + } + } +} diff --git a/tests/PhpWord/Tests/Style/TOCTest.php b/tests/PhpWord/Tests/Style/TOCTest.php index fd2a809e0d..e6e32e6b9d 100644 --- a/tests/PhpWord/Tests/Style/TOCTest.php +++ b/tests/PhpWord/Tests/Style/TOCTest.php @@ -1,9 +1,17 @@ 9062, - 'leader' => \PhpOffice\PhpWord\Style\Tab::TAB_LEADER_DOT, - 'indent' => 200, + 'tabLeader' => array(TOC::TAB_LEADER_DOT, TOC::TAB_LEADER_UNDERSCORE), + 'tabPos' => array(9062, 10), + 'indent' => array(200, 10), ); - foreach ($properties as $key => $value) { - // set/get - $set = "set{$key}"; - $get = "get{$key}"; - $object->$set($value); - $this->assertEquals($value, $object->$get()); + foreach ($properties as $property => $value) { + list($default, $expected) = $value; + $get = "get{$property}"; + $set = "set{$property}"; + + $this->assertEquals($default, $object->$get()); // Default value + + $object->$set($expected); + + $this->assertEquals($expected, $object->$get()); // New value } } } diff --git a/tests/PhpWord/Tests/Style/TabTest.php b/tests/PhpWord/Tests/Style/TabTest.php new file mode 100644 index 0000000000..784b4e4709 --- /dev/null +++ b/tests/PhpWord/Tests/Style/TabTest.php @@ -0,0 +1,52 @@ + array(Tab::TAB_STOP_CLEAR, Tab::TAB_STOP_RIGHT), + 'leader' => array(Tab::TAB_LEADER_NONE, Tab::TAB_LEADER_DOT), + 'position' => array(0, 10), + ); + foreach ($properties as $property => $value) { + list($default, $expected) = $value; + $get = "get{$property}"; + $set = "set{$property}"; + + $this->assertEquals($default, $object->$get()); // Default value + + $object->$set($expected); + + $this->assertEquals($expected, $object->$get()); // New value + } + } +} diff --git a/tests/PhpWord/Tests/Style/TableTest.php b/tests/PhpWord/Tests/Style/TableTest.php index 76fd686441..a7b46c1f48 100644 --- a/tests/PhpWord/Tests/Style/TableTest.php +++ b/tests/PhpWord/Tests/Style/TableTest.php @@ -1,9 +1,17 @@ 'FF0000'); $styleFirstRow = array('borderBottomSize' => 3); + $object = new Table(); + $this->assertNull($object->getBgColor()); + $object = new Table($styleTable, $styleFirstRow); $this->assertEquals('FF0000', $object->getBgColor()); diff --git a/tests/PhpWord/Tests/Style/TabsTest.php b/tests/PhpWord/Tests/Style/TabsTest.php deleted file mode 100644 index 1b588168f6..0000000000 --- a/tests/PhpWord/Tests/Style/TabsTest.php +++ /dev/null @@ -1,47 +0,0 @@ -addParagraphStyle('tabbed', array('tabs' => array(new Tab('left', 1440, 'dot')))); - $doc = TestHelperDOCX::getDocument($phpWord); - $file = 'word/styles.xml'; - $path = '/w:styles/w:style[@w:styleId="tabbed"]/w:pPr/w:tabs/w:tab[1]'; - $element = $doc->getElement($path, $file); - $this->assertEquals('left', $element->getAttribute('w:val')); - $this->assertEquals(1440, $element->getAttribute('w:pos')); - $this->assertEquals('dot', $element->getAttribute('w:leader')); - } -} diff --git a/tests/PhpWord/Tests/Style/TextBoxTest.php b/tests/PhpWord/Tests/Style/TextBoxTest.php new file mode 100644 index 0000000000..cd2d86958d --- /dev/null +++ b/tests/PhpWord/Tests/Style/TextBoxTest.php @@ -0,0 +1,305 @@ + 200, + 'height' => 200, + 'align' => 'left', + 'marginTop' => 240, + 'marginLeft' => 240, + 'wrappingStyle' => 'inline', + 'positioning' => 'absolute', + 'posHorizontal' => 'center', + 'posVertical' => 'top', + 'posHorizontalRel' => 'margin', + 'posVerticalRel' => 'page', + 'innerMarginTop' => '5', + 'innerMarginRight' => '5', + 'innerMarginBottom' => '5', + 'innerMarginLeft' => '5', + 'borderSize' => '2', + 'borderColor' => 'red' + ); + foreach ($properties as $key => $value) { + $set = "set{$key}"; + $get = "get{$key}"; + $object->$set($value); + $this->assertEquals($value, $object->$get()); + } + } + + /** + * Test setStyleValue method + */ + public function testSetStyleValue() + { + $object = new TextBox(); + + $properties = array( + 'width' => 200, + 'height' => 200, + 'align' => 'left', + 'marginTop' => 240, + 'marginLeft' => 240, + 'wrappingStyle' => 'inline', + 'positioning' => 'absolute', + 'posHorizontal' => 'center', + 'posVertical' => 'top', + 'posHorizontalRel' => 'margin', + 'posVerticalRel' => 'page', + 'innerMarginTop' => '5', + 'innerMarginRight' => '5', + 'innerMarginBottom' => '5', + 'innerMarginLeft' => '5', + 'borderSize' => '2', + 'borderColor' => 'red' + ); + foreach ($properties as $key => $value) { + $get = "get{$key}"; + $object->setStyleValue("{$key}", $value); + $this->assertEquals($value, $object->$get()); + } + } + + /** + * Test setWrappingStyle exception + * + * @expectedException \InvalidArgumentException + */ + public function testSetWrappingStyleException() + { + $object = new TextBox(); + $object->setWrappingStyle('foo'); + } + + /** + * Test set/get width + */ + public function testSetGetWidth() + { + $expected=200; + $object = new TextBox(); + $object->setWidth($expected); + $this->assertEquals($expected, $object->getWidth()); + } + + /** + * Test set/get height + */ + public function testSetGetHeight() + { + $expected=200; + $object = new TextBox(); + $object->setHeight($expected); + $this->assertEquals($expected, $object->getHeight()); + } + + /** + * Test set/get height + */ + public function testSetGetAlign() + { + $expected='left'; + $object = new TextBox(); + $object->setAlign($expected); + $this->assertEquals($expected, $object->getAlign()); + } + + /** + * Test set/get marginTop + */ + public function testSetGetMarginTop() + { + $expected=5; + $object = new TextBox(); + $object->setMarginTop($expected); + $this->assertEquals($expected, $object->getMarginTop()); + } + + /** + * Test set/get marginLeft + */ + public function testSetGetMarginLeft() + { + $expected=5; + $object = new TextBox(); + $object->setMarginLeft($expected); + $this->assertEquals($expected, $object->getMarginLeft()); + } + /** + * Test set/get innerMarginTop + */ + public function testSetGetInnerMarginTop() + { + $expected=5; + $object = new TextBox(); + $object->setInnerMarginTop($expected); + $this->assertEquals($expected, $object->getInnerMarginTop()); + } + + /** + * Test set/get wrappingStyle + */ + public function testSetGetWrappingStyle() + { + $expected='inline'; + $object = new TextBox(); + $object->setWrappingStyle($expected); + $this->assertEquals($expected, $object->getWrappingStyle()); + } + + /** + * Test set/get positioning + */ + public function testSetGetPositioning() + { + $expected='absolute'; + $object = new TextBox(); + $object->setPositioning($expected); + $this->assertEquals($expected, $object->getPositioning()); + } + + /** + * Test set/get posHorizontal + */ + public function testSetGetPosHorizontal() + { + $expected='center'; + $object = new TextBox(); + $object->setPosHorizontal($expected); + $this->assertEquals($expected, $object->getPosHorizontal()); + } + + /** + * Test set/get posVertical + */ + public function testSetGetPosVertical() + { + $expected='top'; + $object = new TextBox(); + $object->setPosVertical($expected); + $this->assertEquals($expected, $object->getPosVertical()); + } + + /** + * Test set/get posHorizontalRel + */ + public function testSetGetPosHorizontalRel() + { + $expected='margin'; + $object = new TextBox(); + $object->setPosHorizontalRel($expected); + $this->assertEquals($expected, $object->getPosHorizontalRel()); + } + + /** + * Test set/get posVerticalRel + */ + public function testSetGetPosVerticalRel() + { + $expected='page'; + $object = new TextBox(); + $object->setPosVerticalRel($expected); + $this->assertEquals($expected, $object->getPosVerticalRel()); + } + + + /** + * Test set/get innerMarginRight + */ + public function testSetGetInnerMarginRight() + { + $expected=5; + $object = new TextBox(); + $object->setInnerMarginRight($expected); + $this->assertEquals($expected, $object->getInnerMarginRight()); + } + + /** + * Test set/get innerMarginBottom + */ + public function testSetGetInnerMarginBottom() + { + $expected=5; + $object = new TextBox(); + $object->setInnerMarginBottom($expected); + $this->assertEquals($expected, $object->getInnerMarginBottom()); + } + + /** + * Test set/get innerMarginLeft + */ + public function testSetGetInnerMarginLeft() + { + $expected=5; + $object = new TextBox(); + $object->setInnerMarginLeft($expected); + $this->assertEquals($expected, $object->getInnerMarginLeft()); + } + + /** + * Test set/get innerMarginLeft + */ + public function testSetGetInnerMargin() + { + $expected=5; + $object = new TextBox(); + $object->setInnerMargin($expected); + $this->assertEquals(array($expected, $expected, $expected, $expected), $object->getInnerMargin()); + } + + /** + * Test set/get borderSize + */ + public function testSetGetBorderSize() + { + $expected=2; + $object = new TextBox(); + $object->setBorderSize($expected); + $this->assertEquals($expected, $object->getBorderSize()); + } + + /** + * Test set/get borderColor + */ + public function testSetGetBorderColor() + { + $expected='red'; + $object = new TextBox(); + $object->setBorderColor($expected); + $this->assertEquals($expected, $object->getBorderColor()); + } +} diff --git a/tests/PhpWord/Tests/StyleTest.php b/tests/PhpWord/Tests/StyleTest.php index 0738e72119..f446ecdf9a 100644 --- a/tests/PhpWord/Tests/StyleTest.php +++ b/tests/PhpWord/Tests/StyleTest.php @@ -1,9 +1,17 @@