Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0

Bug #3909 Undefined constant OS_WINDOWS
Submitted: 2005-03-22 08:25 UTC
From: makler at php dot net Assigned: vblavet
Status: Closed Package: Archive_Tar
PHP Version: 4.3.10 OS: SunOS8
Roadmaps: (Not assigned)    
Subscription  


 [2005-03-22 08:25 UTC] makler at php dot net
Description: ------------ Hi. Because I have no windows, while running Archive_Tar there is an error displayed stating that OS_WINDOWS constant is not defined. It should then be checked if it is defined, before using it (as in the enclosed patch). Reproduce code: --------------- --- Tar.php.orig Tue Mar 22 08:51:04 2005 +++ Tar.php.fixed Tue Mar 22 09:20:46 2005 @@ -70,3 +70,3 @@ if (!extension_loaded($extname)) { - $dlext = (OS_WINDOWS) ? '.dll' : '.so'; + $dlext = (defined('OS_WINDOWS') && OS_WINDOWS) ? '.dll' : '.so'; @dl($extname . $dlext); @@ -814,3 +814,3 @@ // ----- Look for removing the WINDOW '\' - if (OS_WINDOWS && strpos($p_path, '\\')) { + if (defined('OS_WINDOWS') && OS_WINDOWS && strpos($p_path, '\\')) { str_replace('\\', '/', $p_path); Actual result: -------------- PHP Notice: Use of undefined constant OS_WINDOWS - assumed 'OS_WINDOWS' in /home/torman/admin/makler/CVS/a/Tar.php on line 815

Comments

 [2005-11-19 14:35 UTC] vblavet at php dot net
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.