[UPHPU] Include file namespace collision detection

Jennifer Charrey jcharrey at xmtp.net
Mon Oct 29 17:18:44 MDT 2007


> On 29 Oct 2007, at 16:51, Joshua Simpson wrote:
>> 2) these files already exist.  One of the services we offer clients, 
>> besides
>> penetration testing, is debugging scaffolding and packages.  I'm 
>> looking to
>> offer namespace collision detecting for our PHP using clients.

I think the problem is that by the time you've included the file, the 
overwriting of your defined vars has already occurred.

One thing you can try is including it in a dummy file, and at the bottom 
of the file call get_defined_vars(), get_defined_constants(), and 
get_defined_functions(). Output the returned arrays with var_dump or 
print_r and then compare the outputs of two different included files. I 
don't think this would catch the case of functions that, when called, 
declare global vars or constants but if they do that they deserve to 
fail anyway. :) For OO code you'd have to use the analogous functions 
that were already mentioned in this thread.

Just a thought.
Jennifer


More information about the UPHPU mailing list