Re: Tokenizer trying to create a token for DocType in HTML_Templaye_Flexy

From: Date: Wed, 08 Aug 2007 04:02:20 +0000
Subject: Re: Tokenizer trying to create a token for DocType in HTML_Templaye_Flexy
References: 1 2 3 4 5  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-27802@lists.php.net to get a copy of this message
Dan Rossi wrote:
Do you mean adding actual php code ? Its possibly a problem for designers though. <? $t->method();?> will force the PHP5 __call method which will dynamically get the method from a specified class. Having the check there wont run it at all. I guess I have to make a different compiler class for it then ? yes creating another compiler (extending Flexy.php, and rewriting that method should do it.), I would recommend you actually create the method, rather than depending on dynamic methods, it tends to bite you later on when the project goes into maintenance mode..
Regards Alan
Alan Knowles wrote:
I did come across that before.. but came to the conclusion that leaving the benefits of leaving method_exists check in, outweighted the rather messy code and potential bugs that allowing it to be turned off would entail. Summarized as be careful when using all that magic ;) - Just create real methods for those items... Regards Alan Dan Rossi wrote:
Hi alan this works, I have a new problem now, a system im using runs a php __call to dynamically reset where a method call happens. The problem is the template is compiled with the method_exists so __call never gets run so the method doesnt get called against an external class. Is there anyway to fix this and prevent it compiling that way ? Alan Knowles wrote:
It's probably a bug in the early version of the autoloader - bascially class_exists(....) used to call the autoloader all the time, this changed in recent versions - where you had to use the 2nd argument true to load the class. General advice - if you want to use an autoloader - use SPL - the default one has quite a few design flaws... Regards Alan Dan Rossi wrote:
Im using PHP5's autoloader and when something like this is in html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> It tries to load a non existant file. HTML_Template_Flexy_Tokenizer->createToken('Doctype') I tried for half an hour to add a bug, but the system is really painfully non user friendly, and the captcha is horrible it claims i entered wrong values, and then i keep getting this ERROR: Email is already in use for an existing account Let me know :)


« previous php.pear.general (#27802) next »