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

Bug #16784 CHM: files are duplicated in the [FILES] section of the project file.
Submitted: 2009-11-13 15:28 UTC
From: pluk77 Assigned: ashnazg
Status: Closed Package: PhpDocumentor (version 1.4.3)
PHP Version: 5.2.5 OS: windows
Roadmaps: 1.5.0a1    

 [2009-11-13 15:28 UTC] pluk77 (Marcel Berteler)
Description: ------------ The Default converter for CHM format is for some reason parsing most of the files twice, resulting in duplicate entries of those files in the files section. I have looked at the code, and it seems that writeSource() is beeing called twice per file which in turn calls writeFile() which in turn calls addHHP(). This results in each file beeing added twice to the $this->hhp_files[]['name'] array. Probably not the best way of fixing this, but better than manually removing the duplicate entries from the generated file, is adding a private array which keeps track of what files have already been parsed and an if statement that does not parse the file if is has been parsed already. class CHMdefaultConverter extends Converter { var $_filenames = array(); // rest of class function writeSource($path, $value) { if (!in_array($path,$this->_filenames)) { array_push($this->_filenames,$path); // rest of function } } Maybe someone with more knowledge of the conversion process can figure out why files are parsed twice and if this is required for the normal operation of the converter. Test script: --------------- output=CHM:default:default sourcecode = on Expected result: ---------------- All files to be parsed once and included in the [files] section of the CHM project once. Actual result: -------------- The are parsed twice and end up in the [files] section twice, causing errors during compiling of the CHM file and a bloated CHM file.


 [2012-01-13 08:25 UTC] ashnazg (Chuck Burgess)
-Roadmap Versions: +Roadmap Versions: 1.5.0a1
 [2012-09-01 02:16 UTC] ashnazg (Chuck Burgess)
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: ashnazg -Roadmap Versions: 1.5.0a1 +Roadmap Versions:
No more feature work on phpDocumentor 1.x. Check out the new phpDocumentor 2.x (
 [2012-09-02 00:56 UTC] ashnazg (Chuck Burgess)
-Status: Wont fix +Status: Closed -Roadmap Versions: +Roadmap Versions: 1.5.0a1
pluk77's idea to track files does solve this issue. Including the fix in 1.5.0a1.