proposal rewrite : PHP_Debug

From: Date: Wed, 24 May 2006 09:59:03 +0000
Subject: proposal rewrite : PHP_Debug
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-42589@lists.php.net to get a copy of this message
Hi, One year later... :) Sorry this is a bit long. So my "old proposal" is here : http://pear.php.net/pepr/pepr-proposal-show.php?id=260 Following the advice of Bertrand, it was obvious that a full rewrite was needed. Meanwhile i saw another proposal on Pear that was very near of mine (http://pear.php.net/pepr/pepr-proposal-show.php?id=325) Testing::debugconsole , and it gave me lot of new ideas of the way this package could be coded and improved. By looking both of our proposal, it was obious that they could be done on the same kernel and we would just have different renderers. The new proposal can be found here : http://www.php-debug.com/tmp/index.php5 1) What is different/corrected/improved from the 1st version ? - It is coded in PHP5 - The design error because of static properties is corrected (connection between the two main classes) - The configuration is simply done with an option array() and there no one properties by configuration option. - The presentation is completly separated from the code and the factory design is implemented. (My proposal use a HTML_Renderer) - 2 others renderers will be made, Javascript_Popup in fact it is the renderer used in the other proposal Testing::debugConsole and a Log renderer (with Pear::Log) because i have already several users who asked for it. - The "view source" functionnality is done with Pear::Text_HighLighter - The main function adddebug() doesn't need __FILE__ and __LINE__ arguments, these informations are simply retrieved with the debug_backtrace() PHP function. - The user does not use directly the PHP_DEBUG constant, indeed there are now several seperated function (with simple name) for this purpose example old call : $Dbg->addDebug($arr, DBGLINE_OBJECT, __FILE__, __LINE__, 'object $arr'); new call : $Debug->dump($arr, 'object $arr'); 2) What is is still to do ? - Implement the 2 others renderers - Integrate the Pear::Var_Dump for variable dumping 3) I'd need some clarifications on some points : ----- Message d'origine ---- De : bertrand Gugger À : Loïc Vernet Cc : pear-dev@lists.php.net Envoyé le : Jeudi, 30 Juin 2005, 12h43mn 25s Objet : Re: [PEAR-DEV] new proposal : PHP_Debug Bonjour loïc, Sorry to answer so late ... True, such a package could be very usefull. You're far from pear cs, but that should not be a problem so long you stay in draft. Some mixed "raw" general remarks : * the pckg optionnally includes a ref to phpmyadmin (only mySql ?), * I did not understood where it was used ... as I saw only the main class. I think that should better be 2 separates files. * I'm very doubtfull about the main connection between main class Debug and class DebugLine built on a global object. I think the class structure could cope with that using references. * also, if I want to debug some classes, the only way I can use is to create a global debug object. Some static method could do it ? * you are mixing the data with the html presentation, I'm not sure it's wide usable for other "outputs" , at least a plain output could be nice. Perhaps some XML or even separate the production and the rendering ? * I've the feeling you intersect with the Benchmark and PHPUnit packages. Some integration could be perhaps envisaged ... * More generally, such system is usefull but necessitates an heavy around coding for each package/class to debug. I'm personnaly orienting (or trying to) Benchmark toward more automatization/tools (see my proposal Benchmark_Resource) . But ok, it's uneasy to define and implement ... er... let me know if my english is too bad, je peux traduire ... à+ bertrand "toggg" Gugger Loïc Vernet wrote: >Hi everyone, > >I have posted a new proposal, it is about debbugging >and i'd like to have some comments about it. > >It is here : > >--> >http://pear.php.net/pepr/pepr-proposal-show.php?id=260 > >

« previous php.pear.dev (#42589) next »