Skip to content

Commit 9e99080

Browse files
author
Bas-Jan 't Jong
committed
Merge branch 'develop' of https://github.com/PHPOffice/PHPWord.git into develop
2 parents 3085445 + 086ac9d commit 9e99080

File tree

4 files changed

+27
-16
lines changed

4 files changed

+27
-16
lines changed

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.11.0

docs/recipes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ vertically.
1313
1414
$imageStyle = array(
1515
'width' => 40,
16-
'height' => 40
16+
'height' => 40,
1717
'wrappingStyle' => 'square',
1818
'positioning' => 'absolute',
1919
'posHorizontalRel' => 'margin',

samples/Sample_Header.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
use PhpOffice\PhpWord\Settings;
77
use PhpOffice\PhpWord\IOFactory;
88

9-
error_reporting(E_ALL & ~E_DEPRECATED);
9+
error_reporting(E_ALL);
1010
define('CLI', (PHP_SAPI == 'cli') ? true : false);
1111
define('EOL', CLI ? PHP_EOL : '<br />');
1212
define('SCRIPT_FILENAME', basename($_SERVER['SCRIPT_FILENAME'], '.php'));
1313
define('IS_INDEX', SCRIPT_FILENAME == 'index');
1414

15-
require_once '../src/PhpWord/Autoloader.php';
15+
require_once __DIR__ . '/../src/PhpWord/Autoloader.php';
1616
Autoloader::register();
1717
Settings::loadConfig();
1818

samples/index.php

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
<?php
22
include_once 'Sample_Header.php';
3+
$requirements = array(
4+
'php' => array('PHP 5.3.0', version_compare(phpversion(), '5.3.0', '>=')),
5+
'xml' => array('PHP extension XML', extension_loaded('xml')),
6+
'zip' => array('PHP extension ZipArchive (optional)', extension_loaded('zip')),
7+
'gd' => array('PHP extension GD (optional)', extension_loaded('gd')),
8+
'xmlw' => array('PHP extension XMLWriter (optional)', extension_loaded('xmlwriter')),
9+
'xsl' => array('PHP extension XSL (optional)', extension_loaded('xsl')),
10+
);
311
if (!CLI) {
412
?>
513
<div class="jumbotron">
@@ -11,20 +19,22 @@
1119
</p>
1220
</div>
1321
<?php
14-
$requirements = array(
15-
'php' => array('PHP 5.3.0', version_compare(phpversion(), '5.3.0', '>=')),
16-
'zip' => array('PHP extension ZipArchive', extension_loaded('zip')),
17-
'xml' => array('PHP extension XML', extension_loaded('xml')),
18-
'gd' => array('PHP extension GD (optional)', extension_loaded('gd')),
19-
);
20-
echo "<h3>Requirements</h3>";
21-
echo "<ul>";
22-
foreach ($requirements as $key => $value) {
23-
$status = $value[1] ? 'passed' : 'failed';
24-
echo "<li>{$value[0]} ... <span class='{$status}'>{$status}</span></li>";
25-
}
26-
echo "</ul>";
2722
}
2823
if (!CLI) {
24+
echo "<h3>Requirement check:</h3>";
25+
echo "<ul>";
26+
foreach ($requirements as $key => $value) {
27+
list($label, $result) = $value;
28+
$status = $result ? 'passed' : 'failed';
29+
echo "<li>{$label} ... <span class='{$status}'>{$status}</span></li>";
30+
}
31+
echo "</ul>";
2932
include_once 'Sample_Footer.php';
33+
} else {
34+
echo 'Requirement check:' . PHP_EOL;
35+
foreach ($requirements as $key => $value) {
36+
list($label, $result) = $value;
37+
$status = $result ? '32m passed' : '31m failed';
38+
echo "{$label} ... \033[{$status}\033[0m" . PHP_EOL;
39+
}
3040
}

0 commit comments

Comments
 (0)