[wp-hackers] Uneasy over the Walkers

Jacob Santos wordpress at santosj.name
Fri Mar 27 01:10:52 GMT 2009


Moaning?

No, I'll rather think not, because it appears that WordPress attempts to 
back-port SPL and PHP5 features without attempting to forward think 
about how difficult it is going to be. Most likely to support SPL, a new 
class or set of classes will have to be developed (most likely will be 
the implementation to maintain backwards compatibility).

I mean, this kind of does prove someone's[1] statement about how 
anything in PHP5 can be done in PHP4, but it does prove my point as to 
why you would want to deal with the hassle. I write Iterators all of the 
time and major trickery and data manipulation. With an Iterator, you 
would have full control of the output, without having to pass you an 
array, so WordPress will have full control of the data.

Also, the shitty part of it all, is that when the Walker classes are 
ported to PHP5, the Walker class will not be able to be made abstract, 
because the classes which extend the "prototypes" add parameters which 
are not part of Walker class. Therefore, PHP5+ will go up in smoke, if 
you attempt it or you could attempt to fix the prototypes of the 
methods, but then you have to go back and correct the code that depends 
on those parameters.

Well, I guess I'm done ranting. I object to some of the design 
decisions, but I'm not going to spend the time to "correct" them.

Jacob Santos

[1] I'm often accused of insulting him when I have no intention, so I'll 
leave his name out. He is more intelligent than I give him credit for, 
hell, he makes a lot more money than I do, so in that case he is far 
more intelligent than I am. If you don't know who I'm talking about, it 
doesn't matter, if you do, then know I'm not trying to be mean by 
pointing him out. He is a central figure, so he is often used as an example.

Simon Wheatley wrote:
> On Thu, Mar 26, 2009 at 3:25 PM, Joost de Valk <joost at yoast.com> wrote:
>   
>> no need, you can simply do a callback:
>>
>> <?php wp_list_comments('type=comment&callback=yoast_comment'); ?>
>>
>> the callback function can look like this:
>>
>> function yoast_comment($comment, $args, $depth) {
>>    $GLOBALS['comment'] = $comment;
>>    comment_text();
>> }
>>
>>     
>
> Well that's better than overriding a class, etc, as I'd assumed;
> however it's still not as simple as modifying single.php or most of
> the other templates, also with the new threaded commenting the
> callback function would need to be fairly complex... I know I'm
> moaning, and I know this is recursive and relatively complex code, but
> do you see where I'm coming from? Maybe I should stop going on as I
> don't have a code solution for this.
>
> S
>
>
> ---
> Sweet Interaction Ltd is Registered in England/Wales, no. 6610741
> Registered office: 7 Malton Av, Manchester, M21 8AT
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>   



More information about the wp-hackers mailing list