Re: Re: Template ? focus on PHP5
| From: | Alan Knowles | Date: | Tue, 06 Jul 2004 02:31:25 +0000 |
| Subject: | Re: Re: Template ? focus on PHP5 | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-31609@lists.php.net to get a copy of this message | ||
Philippe Jausions wrote:
Alan Knowles wrote:I have to admit, the thought of using exceptions and not having to worry about copy by reference in the lexer is very attractive - you cant imagine the messy aliasing that has to take place, and the huge return tree that the lexer/compiler may invoke.. I'm not sure the PEAR Group has come to a final decision about newI was hacking away at the Compiler backend for Template the other day, and it became clear that there is alot more work in refactoring the Flexy code (let alone looking at the Block Backend) Considering this may take many months before it delivers anything more than what Savant currently is, what are your thoughts on making Template a PHP5 only package?.I see your point. Can't really propose an incomplete template package to replace existing ones, otherwise it's just like adding a new template package and there are already too many of them in PEAR... But all-in-all, IMHO, time delay is not a reason good enough to go PHP5 only.
packages not compatible with PHP4.Looking at it in the cold light of day, PHP4 will get no major new features, will eventually only get security fixes, and may not get bugfixes... - However much I like the simplicity of PHP4, it's days are numbered.. - Since Template could be working with
PHP4, let's stick it with that for now.What I was getting at was that it's unlikely to be much more than Savant for many, many months.. - The ROI for just tidying it up, and moving it into the Template Format, is minimal, however, it would be far greater if it was being designed for future usage in PHP5.. On the other hand, I'm all for
embracing PHP5 as soon as possible...I've been following the Exception/Error stuff with interest, I've been leaning to the conclusing that, the only reason to use error returns has been that exceptions where never available. and that Exceptions are probably to be used in a large majority of situations, where if the error was ignored it would likely cause problems. ErrorStack is to me, very complex, and kind of a child of the PHP4->PHP5 working together school of though, which may prove to be rather redundant. That said, I still havent seen a brilliant conclusin on the warning issue, trigger_error(), with serialized objects just seems very kludgy.. The ideal solution may be to revisit the PEAR, PECL extension, which would be considerably simpler having removed the error handling and destructor stuff.. return PEAR2::factory('PEAR2/Warning',$errormsg, $cause, $code); throw PEAR2::factory('PEAR2/Exception',$errormsg, $cause, $code); $last = PEAR2::factory('PEAR2/Stack')->getLastWarning(); PEAR2::loadExtension() PEAR2::defaults('Log',array(.......)); PEAR2::factory('Log')->log(......);eg. a) Throws PEAR_Exception, on anything that could cause the using application problems.I think we could leave it up to PEAR_ErrorStack to throw the exception under PHP 5 and eventually return a PEAR_Error on PHP4, although, it would be best to clear away from PEAR_Error and simply return TRUE/FALSE and use PEAR_ErrorStack... I'd like to minimize the use of Exceptions for error handling.
Having a stable PHP4/PHP5 version first would be good. Once done, turning it into PHP5 E_STRICT shouldn't be too painful ;-) While it may take time to have the package ready, it will also take time for PHP5 to be widely used. Most web hosting providers will wait for a couple of stable releases before offering it...sounds like we could target a monopoly position :)
-Philippe-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com