Re: IT.php/ITX.php problems

From: Date: Sat, 27 Jan 2001 00:00:35 +0000
Subject: Re: IT.php/ITX.php problems
References: 1  Groups: php.pear 
Request: Send a blank email to php-pear+get-1194@lists.php.net to get a copy of this message
Chuck Hagenbuch wrote: > Ever since PHPDoc was changed to use the HTML/IT* files, the html renderer > broke for me - every single html file was just generated with a '1' as the only > contents. I was already afraid this would happen, http://marc.theaimsgroup.com/?l=php-cvs&m=97985064323089&w=2 . IT[X] does not have a PEAR compatible error handling yet. Whenever an error occurs an error object is stored in the object variable $err (or $exceptions, I'd have to look it up). Functions try to keep the return type and in most cases return false; 1 => false. Most people did not configure the template path properly when they saw this misterious 1. If the template path is correct try to find the template object (I usually name them $tpl) and dump the array that contains the error objects. > Running a diff between what was taken out of PHPDoc/redist/, and between what > is now in pear/HTML/, turns up enough non-whitespace changes that it's not Right. Just after PHPDoc was checked into PEAR I applied many changes to IT[X] and comitted them to the PHPLib. One day I tried PHPDoc with a modified version it didn't work. I was not very much intrested in going into it as there was no need to do so. I'm not sure with the current version of IT[X]. > obvious to me what broke. I'd like to just move the redist/ files into HTML/, I have no idea what causes the trouble. > and go from there, but I'm not sure whose work I'd be overwriting/toes I'd be > stepping on. Please do not override the current IT[X] files from the HTML directory with an old version. I'm using the current IT[X] classes with success in many other projects, at least IT seems to be widely bugfree. I know of two flaws and one thing that's not a bug, but not really nice as well. A colleague reported me some problems with empty strings as variable values. He said they would not be handled as expected, I'll have to ask him what exactly is wrong. Maybe using empty() will help. He told me about another problem with the file handling functions. Some of the functions append a slash to the given directory path. As he passed an empty string to one of the functions he really meant "" not "/"... But these are minor flaws and should not crash PHPDoc. Another general "bug"/problem is the block API of IT[X]. You must parse the immermost block first unless you wan't to currupt the variable cache. If you parse an outer block first all inner blocks gets parsed automatically and their variable cache gets cleared. Not remebering this you can shoot yourself into your feets. This is a tribute to the very simple block API. In most cases it's not really a problem as you can parse e.g. the database rows into your table (inner block) before you add the headlines and finish the page ("global", outer block). While I was developing PHPDoc I ran into this quite often. Anyway, if you don't like this use the classical PHPLib template class. It has a powerful but hard to understand Fast Template like API. > Any objections? Anyone have a quick fix? No, I'm sorry no fix. Ulf

« previous php.pear (#1194) next »