svn: /phd/trunk/phpdotnet/phd/Package/PHP/ EnhancedCHM.php
| From: | Philip Olson | Date: | Thu, 03 Mar 2011 03:14:20 +0000 |
| Subject: | svn: /phd/trunk/phpdotnet/phd/Package/PHP/ EnhancedCHM.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-7828@lists.php.net to get a copy of this message | ||
philip Thu, 03 Mar 2011 03:14:20 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=308878
Log:
Using sys_get_temp_dir() instead of TEMP so it works on non-Windows. And fail if this does not
exist.
Changed paths:
U phd/trunk/phpdotnet/phd/Package/PHP/EnhancedCHM.php
Modified: phd/trunk/phpdotnet/phd/Package/PHP/EnhancedCHM.php
===================================================================
--- phd/trunk/phpdotnet/phd/Package/PHP/EnhancedCHM.php 2011-03-02 23:48:44 UTC (rev 308877)
+++ phd/trunk/phpdotnet/phd/Package/PHP/EnhancedCHM.php 2011-03-03 03:14:20 UTC (rev 308878)
@@ -21,8 +21,14 @@
parent::update($event, $val);
// Use %TEMP%/usernotes as base directory for Usernotes.
- $this->userNotesBaseDir = getenv('TEMP') . DIRECTORY_SEPARATOR .
'usernotes' . DIRECTORY_SEPARATOR;
+ $temp = sys_get_temp_dir();
+ if (!$temp || !is_dir($temp)) {
+ v('Unable to locate the systems temporary system directory for
EnhancedCHM.', E_USER_ERROR);
+ break;
+ }
+ $this->userNotesBaseDir = $temp . DIRECTORY_SEPARATOR . 'usernotes' .
DIRECTORY_SEPARATOR;
+
// Make the usernotes directory.
if(!file_exists($this->userNotesBaseDir) || is_file($this->userNotesBaseDir)) {
mkdir($this->userNotesBaseDir) or v("Can't create the usernotes
directory : %s", $this->userNotesBaseDir, E_USER_ERROR);