|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-08-14 21:58 UTC] nlopess@php.net
[2006-08-15 14:04 UTC] pear at laurent-laville dot org
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 17:00:01 2025 UTC |
Description: ------------ Concat directory name without trailing dir separator, and a file name. While i was ready to prepare a new release of PEAR_PackageFileManager (PFM), and generate the new package.xml, i found a bug. I thought first it was from PFM, but then i investigate a bit more, and i found : It will occurs only under Windows platform, because it works fine under Unix. I have : - this "E:\pearix-dev\pfm15x" directory exists - this "E:\pearix-dev\pfm15xpackage.xml" (file | dir) does not exists - my test script into "E:\pearix-dev\pfm15x" directory Tested under PHP 5.1.4 and PHP 4.4.2 under windows, with Apache 2.0.55 gave WRONG results Tested under PHP 5.1.4 and PHP 4.4.0 under Unix with Apache 2.2.2 gave GOOD (expected) results. Feedback are welcome ! Laurent Laville Reproduce code: --------------- <?php $outputdir = dirname(__FILE__); // "E:\pearix-dev\pfm15x" $packagefile = 'package.xml'; var_dump($outputdir); var_dump($outputdir . $packagefile); if (file_exists($outputdir . $packagefile)) { var_dump('condition 1 passed'); } if (is_writable($outputdir . $packagefile)) { var_dump('condition 2 passed'); } if ((file_exists($outputdir . $packagefile) && is_writable($outputdir . $packagefile))) { var_dump('condition 3 passed'); } ?> Expected result: ---------------- None of "condition x passed" message displayed, but only string(20) "E:\pearix-dev\pfm15x" string(31) "E:\pearix-dev\pfm15xpackage.xml" Actual result: -------------- The 3 conditons are TRUE string(20) "E:\pearix-dev\pfm15x" string(31) "E:\pearix-dev\pfm15xpackage.xml" string(18) "condition 1 passed" string(18) "condition 2 passed" string(18) "condition 3 passed"