Skip to content

Version 0.8.0 #134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 201 commits into from
Mar 15, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
891798b
Unix format
ivanlanin Dec 31, 2013
3037fbf
Read README.md
ivanlanin Jan 1, 2014
3fa49ee
section breakType
ivanlanin Jan 1, 2014
abbd288
https://github.com/PHPOffice/PHPWord/issues/46
Jan 1, 2014
0edaaaa
Tidy up for pull request
ivanlanin Jan 1, 2014
72e8f3f
Fix comment error
ivanlanin Jan 1, 2014
d3e8b69
Remove (int) since there's a possibility for fraction
ivanlanin Jan 1, 2014
d55db9d
Patch branch
ivanlanin Jan 9, 2014
4d94d57
(1) new width property for table; (2) allow table cell width to be null
ivanlanin Jan 13, 2014
194940d
Width: dxa > pct
ivanlanin Jan 16, 2014
2c5fed6
https://github.com/PHPOffice/PHPWord/issues/52
Jan 16, 2014
b0a2470
`Table Row` allows `tblHeader` and `cantSplit`
ivanlanin Feb 22, 2014
eb6b44e
Use constant instead of hardcoded 'Arial' name.
ivanlanin Feb 22, 2014
a915e05
Merge remote-tracking branch 'upstream/master'
ivanlanin Feb 22, 2014
ab2b2de
Change default font to Times New Roman 12pt
ivanlanin Feb 23, 2014
e5a4e2d
https://github.com/PHPOffice/PHPWord/issues/46
Mar 1, 2014
b579007
https://github.com/PHPOffice/PHPWord/issues/46
Mar 1, 2014
8480753
https://github.com/PHPOffice/PHPWord/issues/46
Mar 2, 2014
6ed2b11
https://github.com/PHPOffice/PHPWord/issues/46
Mar 2, 2014
a016570
https://github.com/PHPOffice/PHPWord/issues/46
Mar 2, 2014
27b7d67
https://github.com/PHPOffice/PHPWord/issues/46
Mar 2, 2014
fb5ef65
https://github.com/PHPOffice/PHPWord/issues/46
Mar 2, 2014
d324a64
https://github.com/PHPOffice/PHPWord/issues/46
Mar 2, 2014
a765d61
https://github.com/PHPOffice/PHPWord/issues/46
Mar 2, 2014
9f434c7
https://github.com/PHPOffice/PHPWord/issues/46
Mar 2, 2014
e0e4893
https://github.com/PHPOffice/PHPWord/issues/46
Mar 2, 2014
1c3ebe1
https://github.com/PHPOffice/PHPWord/issues/46
Mar 3, 2014
bdcbd14
https://github.com/PHPOffice/PHPWord/issues/46
Mar 3, 2014
ec5322d
https://github.com/PHPOffice/PHPWord/issues/46
Mar 3, 2014
bfe7da6
https://github.com/PHPOffice/PHPWord/issues/46
Mar 3, 2014
a8b73b9
https://github.com/PHPOffice/PHPWord/issues/46
Mar 3, 2014
b765312
https://github.com/PHPOffice/PHPWord/issues/46
Mar 3, 2014
d1e16a6
GH-5 : Word2007 : Added support for page header & page footer height
Progi1984 Mar 3, 2014
670765f
https://github.com/PHPOffice/PHPWord/issues/46
Mar 4, 2014
d0b4ed6
Ability to use images in a text run
hskrtich Mar 4, 2014
4ad5cf0
Merge pull request #84 from bskrtich/textrunimage
Progi1984 Mar 5, 2014
c173a71
Changelog (GH-6 GH-66 GH-84)
Progi1984 Mar 5, 2014
2d3725c
Merge pull request #85 from RomanSyroeshko/PHPWord#52
Progi1984 Mar 5, 2014
1f4a18d
Changelog (GH-52 GH-53 GH-85)
Progi1984 Mar 5, 2014
d3f6256
Merge remote-tracking branch 'remotes/upstream/develop' into develop
ivanlanin Mar 6, 2014
7533d30
Changes:
ivanlanin Mar 6, 2014
f1c2c2f
Copyright year
ivanlanin Mar 6, 2014
938d78f
Samples: (1) Superscript and subscript; (2) Multicolumn
ivanlanin Mar 6, 2014
1361278
Revert
ivanlanin Mar 6, 2014
22afd14
Update change log
ivanlanin Mar 6, 2014
350e7a6
Revert Tests/bootstrap.php and samples/Sample_03_Sections.php
ivanlanin Mar 6, 2014
626ea08
Merge pull request #86 from ivanlanin/develop
Progi1984 Mar 6, 2014
55a5b7e
Changelog : Feature for columns in section, continuous section break,…
Progi1984 Mar 6, 2014
545cbc6
GH-51 : Adding a value that contains "&" in a template breaks it
Progi1984 Mar 6, 2014
be4b01b
PHPWord_Shared_Font::pointSizeToTwips
ivanlanin Mar 7, 2014
09ba95b
Paragraph: Ability to define (1) normal paragraph style with PHPWord:…
ivanlanin Mar 7, 2014
5889313
php syntax higlighting on README.md
ivanlanin Mar 7, 2014
0d1c368
setNormalStyle > setDefaultParagraphStyle
ivanlanin Mar 7, 2014
60c21a2
https://github.com/PHPOffice/PHPWord/issues/46
Mar 7, 2014
657e834
https://github.com/PHPOffice/PHPWord/issues/46
Mar 7, 2014
19636a0
https://github.com/PHPOffice/PHPWord/issues/46
Mar 7, 2014
379e5ce
https://github.com/PHPOffice/PHPWord/issues/46
Mar 7, 2014
4c414c8
https://github.com/PHPOffice/PHPWord/issues/46
Mar 7, 2014
b5f7131
Create table rows on the fly with cloneRow() when using templates.
jeroenmoors Dec 16, 2013
21589ff
Renamed the output file to 'Sample_03_TemplateCloneRow_result.docx'.
jeroenmoors Dec 16, 2013
590f08c
Update cloneRow function to support vertical spanned cells.
jeroenmoors Jan 10, 2014
57f330c
Handle the cases were there's no whitespace after <w:tr.
jeroenmoors Jan 27, 2014
43a00b1
Renamed sample files.
jeroenmoors Mar 7, 2014
50ae8f3
Merge pull request #83 from RomanSyroeshko/PHPWord#46
Progi1984 Mar 7, 2014
f92e577
GH-46 : Ability to apply XSL style sheet to Template
Progi1984 Mar 7, 2014
35c48dc
Merge remote-tracking branch 'upstream/develop' into develop
ivanlanin Mar 7, 2014
307f568
Add unit tests for Shared/Font and Writer/Word2007/Styles
ivanlanin Mar 7, 2014
0ed956a
Merge pull request #87 from ivanlanin/develop
Progi1984 Mar 7, 2014
07a6794
Changelog : GH-87 : Point to twip converter, set normal paragraph sty…
Progi1984 Mar 7, 2014
3ed2588
Merge pull request #88 from jeroenmoors/develop
Progi1984 Mar 7, 2014
ebb7d04
Changelog : GH-88 : Clone table rows on the fly when using a template…
Progi1984 Mar 7, 2014
db52525
GH-89 : Example in README.md is broken
Progi1984 Mar 7, 2014
86abe7e
GH-16 : Initial addition of basic footnote support
Progi1984 Mar 7, 2014
db08572
GH-16 : Initial addition of basic footnote support
Progi1984 Mar 7, 2014
47c7fab
Replace call to save with saveAs to save the document.
jeroenmoors Mar 7, 2014
3bc7f98
Merge pull request #90 from jeroenmoors/develop
Progi1984 Mar 7, 2014
423c334
Fix bug in directory whitelist. Run `phpunit --coverage-html` to repr…
ivanlanin Mar 8, 2014
d1f34fc
Merge pull request #91 from ivanlanin/develop
Progi1984 Mar 8, 2014
df7083b
Ability to define paragraph pagination: widow control, keep next, kee…
ivanlanin Mar 8, 2014
0e26da9
Fix issue number on changelog.txt
ivanlanin Mar 8, 2014
9042bb5
Merge pull request #92 from ivanlanin/develop
Progi1984 Mar 8, 2014
b39f9da
Refactor and unit test PHPWord_Style_Font
ivanlanin Mar 8, 2014
074dfab
Add section settings documentation
ivanlanin Mar 8, 2014
9fd1384
Constants explanation
ivanlanin Mar 9, 2014
9bae85e
Merge pull request #93 from ivanlanin/develop
Progi1984 Mar 9, 2014
4dcde8c
PHPWord_Shared_Drawing::centimetersToPixels() conversion
ivanlanin Mar 9, 2014
537f49e
Fix non-existing functions in Writer/ODText/Content.php
ivanlanin Mar 9, 2014
d177b47
New function PHPWord_Style_Paragraph::setTabs() and unit test for PHP…
ivanlanin Mar 9, 2014
68a4387
Reformat code samples on README.md to max 80 char per line
ivanlanin Mar 9, 2014
2633080
Fix parameter input for testWriteParagraphStyle_Pagination
ivanlanin Mar 9, 2014
c364490
Remove PHPWord_Style_Cell::setHeight() since it's irrelevant and neve…
ivanlanin Mar 9, 2014
fa1663a
PHP method IS NOT case sensitive :)
ivanlanin Mar 9, 2014
3d8f09d
PHPWord_Style_CellTest 100% code coverage
ivanlanin Mar 9, 2014
34d9121
Change normal value for cell style tests
ivanlanin Mar 9, 2014
712e09a
Basic README for `addText` and `createTextRun`
ivanlanin Mar 9, 2014
63a535b
Merge pull request #94 from ivanlanin/develop
Progi1984 Mar 9, 2014
9b793e5
Unit Tests on Section directory
Progi1984 Mar 9, 2014
99b43ce
Merge branch 'develop' of https://github.com/PHPOffice/PHPWord into d…
Progi1984 Mar 9, 2014
7abd5be
Reformatted Tests to PSR-2 coding standards
gabrielbull Mar 2, 2014
3519477
Removed fake namespace from tests class names because we use real nam…
gabrielbull Mar 9, 2014
69a8192
Added line height methods to mirror the line height settings in Word …
gabrielbull Mar 9, 2014
8883667
Merge pull request #95 from gabrielbull/develop
Progi1984 Mar 9, 2014
5efcec8
Added paragraph line height to Readme
gabrielbull Mar 2, 2014
9966508
Added line height to font style
gabrielbull Mar 9, 2014
a6671c2
Reformatted tests to PSR-2 standards
gabrielbull Mar 9, 2014
79f65f0
Fixed bug with footer preserve text
gabrielbull Mar 9, 2014
70588f2
Fixed bugs with Text class
gabrielbull Mar 9, 2014
79ba793
Merge pull request #96 from gabrielbull/develop
Progi1984 Mar 9, 2014
f2122c1
Changed PHPWord namespace to PhpOffice\PhpWord
gabrielbull Mar 9, 2014
663e900
Basic unit tests for PHPWord\Style completed
ivanlanin Mar 9, 2014
6697057
Fix section settings failed tests
ivanlanin Mar 9, 2014
bf13fef
Merge pull request #98 from ivanlanin/develop
Progi1984 Mar 9, 2014
8fb7da4
Merge pull request #97 from gabrielbull/develop
Progi1984 Mar 9, 2014
e36b2c5
Some unit tests for Style Drawing, File, and String
ivanlanin Mar 10, 2014
45a9283
Merge pull request #100 from ivanlanin/develop
Progi1984 Mar 10, 2014
7677e15
Basic support for TextRun on ODT and RTF
ivanlanin Mar 10, 2014
fb1d7d4
Merge pull request #101 from ivanlanin/develop
Progi1984 Mar 10, 2014
1100d93
Tables samples, including colspan and rowspan
ivanlanin Mar 10, 2014
0b876a3
Merge pull request #102 from ivanlanin/develop
Progi1984 Mar 10, 2014
c1b4b2e
Skeleton copied from PHPExcel :)
ivanlanin Mar 10, 2014
cf790b9
Minimum working sample for text, textrun, and textbreak
ivanlanin Mar 10, 2014
fa2878e
Cleaning up code
ivanlanin Mar 10, 2014
ec514f3
Reader: Read section settings and font/paragraph styles
ivanlanin Mar 11, 2014
4e3450e
Code formatting for PSR1 & PSR2 - Part 1
ivanlanin Mar 11, 2014
d2a2317
Code formatting for PSR1 & PSR2 - Part 2
ivanlanin Mar 11, 2014
589e603
Unit test for Reader and additional methods for DocumentProperties, a…
ivanlanin Mar 11, 2014
07b8430
Add php_zip requirement
ivanlanin Mar 11, 2014
72fca30
Fixed bug with footer preserve text
gabrielbull Mar 11, 2014
da7c0ad
Merge pull request #107 from gabrielbull/develop
Progi1984 Mar 11, 2014
77f52e9
Use exif_imagetype to check image format instead of extension name
gabrielbull Mar 11, 2014
595bcc3
Merge pull request #108 from gabrielbull/develop
Progi1984 Mar 11, 2014
762f812
Add Text Break to Text Run
hskrtich Mar 11, 2014
46a0768
Merge remote-tracking branch 'upstream/develop' into develop
ivanlanin Mar 12, 2014
92cfa12
Code formatting for PSR1 & PSR2 - Part 3
ivanlanin Mar 12, 2014
8f54fa4
Simple unit tests for ODText, RTF, and Word2007 Writer
ivanlanin Mar 12, 2014
e5bd649
Code formatting for PSR1 & PSR2 - Part 4
ivanlanin Mar 12, 2014
7044ebc
Merge pull request #109 from bskrtich/textrunbreak
Progi1984 Mar 12, 2014
042f7a0
Merge remote-tracking branch 'upstream/develop' into develop
ivanlanin Mar 12, 2014
3daaffa
support for eastAsia fontstyle
jhfangying Mar 12, 2014
530a71c
Unit test for TOC
ivanlanin Mar 12, 2014
b58d1c8
Merge pull request #104 from ivanlanin/develop
Progi1984 Mar 12, 2014
b1ee8a3
Unit test for PHPWord main class
ivanlanin Mar 12, 2014
9c0e70a
Merge pull request #112 from ivanlanin/develop
Progi1984 Mar 12, 2014
492f88d
Use exif_imagetype to check image format instead of extension name
gabrielbull Mar 12, 2014
68de9ab
Merge pull request #114 from gabrielbull/develop
Progi1984 Mar 12, 2014
d991fdc
Added image writer tests
gabrielbull Mar 12, 2014
4119c6a
Reorganize samples and write unsupported element to ODText and RTF
ivanlanin Mar 12, 2014
a78ba1c
Remove duplicate on SectionTest
ivanlanin Mar 12, 2014
5e0fc7a
Fixed bug with new extension verification
gabrielbull Mar 12, 2014
a2366e9
https://github.com/PHPOffice/PHPWord/issues/43
Mar 12, 2014
36c03d4
https://github.com/PHPOffice/PHPWord/issues/43
Mar 12, 2014
de96a66
https://github.com/PHPOffice/PHPWord/issues/43
Mar 12, 2014
2aa49dc
https://github.com/PHPOffice/PHPWord/issues/43
Mar 12, 2014
1fbea54
Merge remote-tracking branch 'upstream/develop' into develop
ivanlanin Mar 12, 2014
d4d4275
Unit test for PHPWord\Style
ivanlanin Mar 12, 2014
2f0438f
Change all remaining `trigger_error()` into `throw new Exception()`
ivanlanin Mar 12, 2014
af1a591
support for eastAsia fontstyle
jhfangying Mar 13, 2014
bb38d6c
delete one line
jhfangying Mar 13, 2014
a766347
add Font Content Type
jhfangying Mar 13, 2014
0779581
ignore
jhfangying Mar 13, 2014
7fdf2b5
Add XMLWriter Compatibility option
hskrtich Mar 13, 2014
b79a66b
1
jhfangying Mar 13, 2014
a6e91ef
merge
jhfangying Mar 13, 2014
acfe64b
More unit tests for Writer\Word2007\Base
ivanlanin Mar 13, 2014
37dd6bc
Merge branch 'xmlwritercompatibility' of https://github.com/bskrtich/…
ivanlanin Mar 13, 2014
d180ac7
Merge branch 'develop' of https://github.com/jhfangying/PHPWord into …
ivanlanin Mar 13, 2014
8d942b5
Rename Reader sample and sync Base.php
ivanlanin Mar 13, 2014
70d3a1a
Merge pull request #118 from jhfangying/develop
Progi1984 Mar 13, 2014
fcc4c07
Merge pull request #119 from bskrtich/xmlwritercompatibility
Progi1984 Mar 13, 2014
1dcd267
Merge pull request #117 from RomanSyroeshko/develop
Progi1984 Mar 13, 2014
bde8666
Merge remote-tracking branch 'upstream/develop' into develop
ivanlanin Mar 13, 2014
f711e8a
Formatted code in PHPWord_Style_Font class
gabrielbull Mar 13, 2014
fd95a1c
Merge remote-tracking branch 'upstream/develop' into develop
ivanlanin Mar 13, 2014
1aa83b9
Some more tests for Writer/Word2007/Base.php. We're on 71.84% coverag…
ivanlanin Mar 13, 2014
8e17598
Merge pull request #115 from ivanlanin/develop
Progi1984 Mar 13, 2014
ff6b2a9
MemoryImage: Allow remote image when allow_url_open = on
ivanlanin Mar 13, 2014
b3458b9
Test & migrate the remaining old samples
ivanlanin Mar 13, 2014
b11cd40
More unit tests
ivanlanin Mar 13, 2014
cd3f74e
Footnote fix
ivanlanin Mar 13, 2014
f2ba9a1
Unit test for footnotes
ivanlanin Mar 13, 2014
a87717a
Fix for footnotes test
ivanlanin Mar 13, 2014
d3c739e
Remove old samples
ivanlanin Mar 13, 2014
645d237
Merge pull request #122 from ivanlanin/develop
Progi1984 Mar 13, 2014
d87fa2a
MS Word report corrupted DOCX when there's more than 1 section and fo…
ivanlanin Mar 14, 2014
c8a1e2e
Final fix that satisfies both MS Word and OpenOffice
ivanlanin Mar 14, 2014
de02e43
Merge pull request #125 from ivanlanin/msword-footnote-fix
Progi1984 Mar 14, 2014
0fe30ae
Changed versino 0.7.1 to 0.8.0
gabrielbull Mar 14, 2014
088caa2
@codeCoverageIgnore for some legacy (unused yet) code
ivanlanin Mar 14, 2014
44d2501
TextBreak: Allow font/paragraph styling for text break
ivanlanin Mar 14, 2014
0b65bc3
Update Requirements
hskrtich Mar 13, 2014
3a1a056
Merge pull request #121 from bskrtich/updaterequirements
Progi1984 Mar 14, 2014
a87953a
Merge pull request #129 from ivanlanin/develop
Progi1984 Mar 14, 2014
8b9d3e5
Add features section in README and update changelog
ivanlanin Mar 14, 2014
9646fd3
ADDED : Unit Tests
Progi1984 Mar 14, 2014
d9c3cfc
Merge branch 'develop' of https://github.com/PHPOffice/PHPWord into d…
Progi1984 Mar 14, 2014
92a7a6b
More unit tests for Template and Writer
ivanlanin Mar 15, 2014
db1ce96
Merge pull request #131 from ivanlanin/develop
ivanlanin Mar 15, 2014
8953619
https://github.com/PHPOffice/PHPWord/issues/124
Mar 15, 2014
c2a6c78
Merge pull request #132 from RomanSyroeshko/develop
ivanlanin Mar 15, 2014
d04e600
New unit test for ODText\Content and some test fixes
ivanlanin Mar 15, 2014
542451d
Merge pull request #133 from ivanlanin/develop
ivanlanin Mar 15, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ phpunit.xml
composer.lock
composer.phar
vendor
/report
/.settings
/.buildpath
/.project
Expand Down
68 changes: 51 additions & 17 deletions Classes/PHPWord.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,42 @@
*/

/** PHPWORD_BASE_PATH */
// @codeCoverageIgnoreStart
if (!defined('PHPWORD_BASE_PATH')) {
define('PHPWORD_BASE_PATH', dirname(__FILE__) . '/');
require PHPWORD_BASE_PATH . 'PHPWord/Autoloader.php';
PHPWord_Autoloader::Register();
}

// @codeCoverageIgnoreEnd

/**
* PHPWord
*/
class PHPWord
{

/**
* Default font name (Arial)
*/
const DEFAULT_FONT_NAME = 'Arial';
/**
* Default Font Content Type(default)
* default|eastAsia|cs
*/
const DEFAULT_FONT_CONTENT_TYPE='default';
/**
* Default font size in points (10pt)
*
* OOXML defined font size values in halfpoints, i.e. twice of what PHPWord
* use, and the conversion will be conducted during XML writing.
*/
const DEFAULT_FONT_SIZE = 10;

/**
* Default font color (black)
*/
const DEFAULT_FONT_COLOR = '000000';

/**
* Document properties
*
Expand Down Expand Up @@ -74,8 +97,8 @@ class PHPWord
public function __construct()
{
$this->_properties = new PHPWord_DocumentProperties();
$this->_defaultFontName = 'Arial';
$this->_defaultFontSize = 20;
$this->_defaultFontName = PHPWord::DEFAULT_FONT_NAME;
$this->_defaultFontSize = PHPWord::DEFAULT_FONT_SIZE;
}

/**
Expand Down Expand Up @@ -133,7 +156,7 @@ public function setDefaultFontName($pValue)
}

/**
* Get default Font size
* Get default Font size (in points)
* @return string
*/
public function getDefaultFontSize()
Expand All @@ -142,15 +165,24 @@ public function getDefaultFontSize()
}

/**
* Set default Font size
* Set default Font size (in points)
* @param int $pValue
*/
public function setDefaultFontSize($pValue)
{
$pValue = $pValue * 2;
$this->_defaultFontSize = $pValue;
}

/**
* Set default paragraph style definition to styles.xml
*
* @param array $styles Paragraph style definition
*/
public function setDefaultParagraphStyle($styles)
{
PHPWord_Style::setDefaultParagraphStyle($styles);
}

/**
* Adds a paragraph style definition to styles.xml
*
Expand Down Expand Up @@ -215,15 +247,6 @@ public function getSections()
return $this->_sectionCollection;
}

/**
* Get section count
* @return int
*/
private function _countSections()
{
return count($this->_sectionCollection);
}

/**
* Load a Template File
*
Expand All @@ -236,7 +259,18 @@ public function loadTemplate($strFilename)
$template = new PHPWord_Template($strFilename);
return $template;
} else {
trigger_error('Template file ' . $strFilename . ' not found.', E_USER_ERROR);
throw new PHPWord_Exception(
"Template file {$strFilename} not found."
);
}
}
}

/**
* Get section count
* @return int
*/
private function _countSections()
{
return count($this->_sectionCollection);
}
}
4 changes: 2 additions & 2 deletions Classes/PHPWord/Autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
class PHPWord_Autoloader
{
const PREFIX = 'PHPWord';
const PREFIX = 'PhpOffice\PhpWord';

/**
* Register the autoloader
Expand Down Expand Up @@ -82,4 +82,4 @@ public static function autoload($class)
}
}
}
}
}
Loading