Page 2 of 3
Posted: Fri Aug 11, 2006 9:34 am
by Ambush Commander
Hmm... I think I'll defer writing the configuration generator till later. But sounds like an interesting side project.
Why have you choosen to write this for PHP 4?
That's an interesting question, especially considering the fact that PHP 6 is on the horizon and the fact that all my webhosts run PHP 5. I suppose it's just to acheive maximum penetration: people ought to be able to use it in PHP 4 and PHP 5. Interestingly enough, I use PHP 5.1.4 for active development, and then switch to older versions to do spot-testing. The syntax is a small price to pay for actually quite easy backwards-compatibility: I've had very few problems with PHP 4 compat. In short: it's not that big of a deal to support PHP 4, so why not?
Posted: Fri Aug 11, 2006 9:43 am
by Ollie Saunders
AC wrote:so why not?
No data hiding, no interfaces, no reflection, no spl, no exceptions etc. These are things I can't do without.
Mind you I am writing a big framework of code that specifically focuses on organisation and you are just really writing a very large algorithm so I think your reasons for choosing PHP 4 may well be justified. Personally would have gone for PHP 5 myself.
PHP 6 is on the horizon
I thought it was an undisclosed time away, do you know something?
*ole leans closer*
Posted: Fri Aug 11, 2006 1:43 pm
by Chris Corbyn
ole wrote:OT sorry:
Why have you choosen to write this for PHP 4?
Why not? You can support multiple versions of PHP... especially if you want many people to actually use the software. I support two versions when I write code for public release.
EDIT | I run two versions though.... I don't use "var" in PHP5 code.
Posted: Fri Aug 11, 2006 1:45 pm
by Ambush Commander
Actually, I ignored all suggestions and went about and did this:
Code: Select all
HTMLPurifier_ConfigDef::define(
'Attr', 'IDBlacklist', array(),
'Array of IDs not allowed in the document.');
Comments?
Posted: Fri Aug 11, 2006 2:45 pm
by Weirdan
With that it's easy to make self-documenting code: just make define to assemble help-file for you
Posted: Fri Aug 11, 2006 2:48 pm
by Ambush Commander
Precisely. The only problem is that SimpleTest pukes on E_STRICT warnings in their test files (that throws E_STRICT because the function definition isn't declared static), so I had to use some hack-tastic manuevers in order to get it to work. Hrm... well, it'll do for now.
Posted: Fri Aug 11, 2006 2:57 pm
by feyd
My hack to "fix" SimpleTest's E_STRICT breakage: edit the files. Since all releases forward of SimpleTest will be written for PHP5+ I had no problem doing it. Sure, I could have removed the E_STRICT, but I'd rather fix the problem then hide it.
Posted: Fri Aug 11, 2006 2:58 pm
by Ambush Commander
Ehh... but then what about PHP 4 compatibility? (I can't stick static in there).
Posted: Fri Aug 11, 2006 3:02 pm
by feyd
I don't care about PHP 4. Forgot about your wish to support... it.

Posted: Fri Aug 11, 2006 3:04 pm
by Ambush Commander
Well, I can't program in E_STRICT because SimpleTest throws too many darn E_STRICT errors when I do that. Maybe when Marcus releases the PHP 5 version (SimpleTest 2.0) I'll drop PHP 4 support. I haven't checked out any of SimpleTest's unreleased development code (although I am using 1.0.1alpha3), how does it shape up?
Posted: Fri Aug 11, 2006 3:13 pm
by feyd
I'm running 1.0.1alpha3 right now, so I've gone through and modified a lot of the code (using a regexp replace.)
Posted: Fri Aug 11, 2006 3:16 pm
by Ambush Commander
Heh. I suppose that if SimpleTest is written well enough (which it is), all you'd need to do is add static, public and friends willy-nilly in order to get it up to shape. Still have the regexp?
Posted: Fri Aug 11, 2006 3:18 pm
by feyd
Sorry no. But I can put the files on my server.
Posted: Fri Aug 11, 2006 3:20 pm
by Ambush Commander
That would be cool.
Posted: Fri Aug 11, 2006 4:03 pm
by Ollie Saunders
Maybe when Marcus releases the PHP 5 version (SimpleTest 2.0) I'll drop PHP 4 support
I could ask him next time I see him when that might be if you like.