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

Bug #16180 File plugin gives incorrect results when directories are numbers themselves.
Submitted: 2009-05-05 09:24 UTC
From: matterk2 Assigned: dufuz
Status: Verified Package: PEAR_PackageFileManager_Plugins (version 1.0.0)
PHP Version: 5.2.9 OS: OS X
Roadmaps: (Not assigned)    
Subscription  


 [2009-05-05 09:24 UTC] matterk2 (Matt Erkkila)
Description: ------------ When calling generateContents() on a directory structure which has one similar to Package: API_1 Files: API/1/Disptacher.php API/1/0/Arg.php API/1/0/Endpoint.php With this structure the 'Dispatcher.php' file will never be listed in the package.xml. I think it has something to do with the directory itself being an integer. This applies to both the Svn and File generators.

Comments

 [2010-02-03 23:30 UTC] cweiske (Christian Weiske)
-Status: Open +Status: Verified -Assigned To: +Assigned To: cweiske
 [2010-02-04 01:13 UTC] cweiske (Christian Weiske)
The problem is visible in PEAR_PackageFileManager2::generateContents(), and in PEAR_PackageFileManager_File::getFileList() - but not in PEAR_PackageFileManager_File::dirList().
 [2010-02-04 03:29 UTC] cweiske (Christian Weiske)
Internally, files are indexed with numbers 0, 1, 2 and so on - directories have their real name in that array. So using a directory with name "0" or "1" will overwrite the file with the same *index*. This is an inherent problem in the way the file arrays are organized internally. One solution would be to prefix directories with a dash or hash sign. But that will probably have influence on the whole filemanager package code...
 [2011-03-25 04:36 UTC] dufuz (Helgi Þormar Þorbjörnsson)
-Assigned To: +Assigned To: dufuz
 [2011-03-25 04:36 UTC] dufuz (Helgi Þormar Þorbjörnsson)
I'll take a look at this and see how feasible a fix is given how we construct the internal assoc array. I've created a test case for this.