Skip to content

Commit e3dd449

Browse files
committed
#238: Known issue about read/write permission on temp folder
1 parent 61d8dbd commit e3dd449

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ None yet.
1818

1919
### Miscellaneous
2020

21-
None yet.
21+
- 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
2222

2323
## 0.11.1 - 2 June 2014
2424

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'RTF');
111111
$objWriter->save('helloWorld.rtf');
112112
```
113113

114+
## Known issues
115+
116+
- 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.
117+
114118
## Contributing
115119

116120
We welcome everyone to contribute to PHPWord. Below are some of the things that you can do to contribute:

samples/index.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
$requirements = array(
44
'php' => array('PHP 5.3.0', version_compare(phpversion(), '5.3.0', '>=')),
55
'xml' => array('PHP extension XML', extension_loaded('xml')),
6+
'temp' => array('Temp folder "<code>' . sys_get_temp_dir() . '</code>" is writable', is_writable(sys_get_temp_dir())),
67
'zip' => array('PHP extension ZipArchive (optional)', extension_loaded('zip')),
78
'gd' => array('PHP extension GD (optional)', extension_loaded('gd')),
89
'xmlw' => array('PHP extension XMLWriter (optional)', extension_loaded('xmlwriter')),
@@ -34,6 +35,7 @@
3435
echo 'Requirement check:' . PHP_EOL;
3536
foreach ($requirements as $key => $value) {
3637
list($label, $result) = $value;
38+
$label = strip_tags($label);
3739
$status = $result ? '32m passed' : '31m failed';
3840
echo "{$label} ... \033[{$status}\033[0m" . PHP_EOL;
3941
}

0 commit comments

Comments
 (0)