FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=16784&edit=1

ID: 16784
Updated by: demon.gene@gmail.com
Reported By: marcel at berteler dot co dot za
Summary: CHM: files are duplicated in the [FILES] section of
the project file.
Status: Open
Type: Bug
Package: PhpDocumentor
Operating System: windows
Package Version: 1.4.3
PHP Version: 5.2.5
-Roadmap Versions:
+Roadmap Versions: 1.5.0a1
New Comment:

-Roadmap Versions:
+Roadmap Versions: 1.5.0a1



Previous Comments:
------------------------------------------------------------------------

[2009-11-13 10:28:16] pluk77

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.

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJan 13, '12 at 2:24a
activeJan 13, '12 at 2:24a
posts1
users1
websitepear.php.net

1 user in discussion

Demon Gene: 1 post

People

Translate

site design / logo © 2022 Grokbase