[dev] [commits] Horde branch master updated. 7f6ddcffe1c3d9031d499c0dee40f8b37628e5c5

Jan Schneider jan at horde.org
Thu Dec 3 19:33:55 UTC 2009


Zitat von Michael M Slusarz <slusarz at horde.org>:

> Quoting Jan Schneider <jan at horde.org>:
>
>> commit 7f6ddcffe1c3d9031d499c0dee40f8b37628e5c5
>> Author: Jan Schneider <jan at horde.org>
>> Date:   Thu Dec 3 15:06:46 2009 +0100
>>
>>    Add basic Horde_Url class.
>
> Cool.  One big issue though - looks like you tried to implement this  
> within the current Horde::url-ish framework to maintain backwards  
> compatibility.  However, I don't think this is going to work because  
> the __toString() method isn't going to behave like I think you want  
> it to behave.  For example, a call like this:
>
> $foo = array(
>     'bar' => Horde::url()
> );
>
> results in $foo['bar'] being a Horde_Url object, *not* a string.   
> See, e.g., moving the splitbar in dimp - the prefs.php link,  
> generated by Horde::getServiceLink() in  
> imp/templates/javascript_defs_dimp.php, is an object instead of a  
> string so the javascript code throws errors.
>
> So it looks like we have to cast all of these kind of calls to  
> strings.  If we have to do this, it might be easier/cleaner just to  
> change these calls to direct calls to Horde_Url.

In 95% of the cases, if not more, the URL object should finally be  
casted to a string automatically, either by echo'ing or by string  
concatenation. We still have to catch the places where it doesn't.
But of course, in the long term, we should change everything to  
directly use Horde_Url. But that's a huge number of places, so I  
implemented it for best possible BC, so we can phase out Horde::url()  
and ::link() step by step.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the dev mailing list