[PEPr] Comment on PHP::PHP_FunctionCallTracer

From: Date: Sun, 19 Aug 2007 21:14:23 +0000
Subject: [PEPr] Comment on PHP::PHP_FunctionCallTracer
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-47809@lists.php.net to get a copy of this message
Travis Swicegood (http://pear.php.net/user/tswicegood) has commented on the proposal for PHP::PHP_FunctionCallTracer. Comment: Hey Michel - definitely an interesting package. One thing I would consider doing is moving the PHP_FunctionCallTracer code into a class of its own that can be instantiated, then use PHP_FunctionCallTracer as a static interface to it. The reason being to allow named instances of the tracer to be used: PHP_FunctionCallTracer::getInstance('foo')->traceArguments(); PHP_FunctionCallTracer::getInstance('bar')->traceVariables($b); While still allowing for: PHP_FunctionCallTracer::traceArguments(); Which would just drop it into the default instance. That might be a case for adding setDefaultInstance($name) to it as well to allow you to set the default instance to use so you could change that around as necessary. The naming of instances could be handled internally to PHP_FunctionCallTracer, but the object itself is already having to keep track of a lot of information, adding one more layer to it just seems add more complexity when a slight refactoring helps segregate the changes. Also, the code appears to have moved beyond function calls to include all manner of calls (object methods, static methods, etc.); might PHP_Tracer be a better name? That would allow you to expand out into tracing straight procedural code as well. I can think of a few projects something like that would have been useful in. One final note: nice work on the unit tests... It's nice to see packages proposed with them :-) Proposal information: http://pear.php.net/pepr/pepr-proposal-show.php?id=502 -- Sent by PEPr, the automatic proposal system at http://pear.php.net

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