From e3dd4494f3f0864bc7e21de5b208a70bb38911a4 Mon Sep 17 00:00:00 2001 From: Ivan Lanin Date: Mon, 2 Jun 2014 23:33:10 +0700 Subject: [PATCH] #238: Known issue about read/write permission on temp folder --- CHANGELOG.md | 2 +- README.md | 4 ++++ samples/index.php | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36c27c26..7c9d370a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ None yet. ### Miscellaneous -None yet. +- Docs: Add known issue on `README` about requirement for temporary folder to be writable and update `samples/index.php` for this requirement check - @ivanlanin GH-238 ## 0.11.1 - 2 June 2014 diff --git a/README.md b/README.md index ecbe1354..fefde4eb 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,10 @@ $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'RTF'); $objWriter->save('helloWorld.rtf'); ``` +## Known issues + +- GH-238: PHPWord uses temporary folder with `sys_get_temp_dir()` extensively. The default setting on some systems (especially Windows) do not give appropriate read/write permission to this folder. Run `samples/index.php` either by CLI or by web browsers to check if you have this requirement fulfilled. + ## Contributing We welcome everyone to contribute to PHPWord. Below are some of the things that you can do to contribute: diff --git a/samples/index.php b/samples/index.php index 420c5420..8e466d97 100644 --- a/samples/index.php +++ b/samples/index.php @@ -3,6 +3,7 @@ include_once 'Sample_Header.php'; $requirements = array( 'php' => array('PHP 5.3.0', version_compare(phpversion(), '5.3.0', '>=')), 'xml' => array('PHP extension XML', extension_loaded('xml')), + 'temp' => array('Temp folder "' . sys_get_temp_dir() . '" is writable', is_writable(sys_get_temp_dir())), 'zip' => array('PHP extension ZipArchive (optional)', extension_loaded('zip')), 'gd' => array('PHP extension GD (optional)', extension_loaded('gd')), 'xmlw' => array('PHP extension XMLWriter (optional)', extension_loaded('xmlwriter')), @@ -34,6 +35,7 @@ if (!CLI) { echo 'Requirement check:' . PHP_EOL; foreach ($requirements as $key => $value) { list($label, $result) = $value; + $label = strip_tags($label); $status = $result ? '32m passed' : '31m failed'; echo "{$label} ... \033[{$status}\033[0m" . PHP_EOL; }