[dev] [commits] Horde branch master updated. 10b3eb5f8f5f5baa2e9490b7d69316dfa38024f7

Jan Schneider jan at horde.org
Mon Jun 27 16:45:10 UTC 2011


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

> Quoting Jan Schneider <jan at horde.org>:
>
>> commit 10b3eb5f8f5f5baa2e9490b7d69316dfa38024f7
>> Author: Jan Schneider <jan at horde.org>
>> Date:   Sat Jun 25 22:45:53 2011 +0200
>>
>>    Revert "Always make sure that $_contents is a resource before  
>> using it (Bug #10252)."
>>
>>    This reverts commit b2d086839532ea785a20e7bd1a57d114e6cd2658.
>>
>>    This breaks message viewing in IMP, though all tests pass just fine. No
>>    idea what IMP is doing with mime parts that breaks this.
>>
>> framework/Mime/lib/Horde/Mime/Part.php |   36  
>> ++++++-------------------------
>> framework/Mime/package.xml             |    4 +-
>> 2 files changed, 9 insertions(+), 31 deletions(-)
>>
>> http://git.horde.org/horde-git/-/commit/10b3eb5f8f5f5baa2e9490b7d69316dfa38024f7
>
> This would be an incorrect fix anyway, because $_contents must  
> always be a stream resource (outside of init/serialization methods).  
>  That's what the internal documentation says.
>
> This needs to be properly fixed by instead implementing the  
> Serializable interface, (instead of __sleep()) which will not alter  
> the contents of the current object.

That was my first attempt, but it didn't work either. You cannot  
restore $_contents to a stream, because you would have to do that  
*after* returning the serialized object.
Though now that I think of it, we can probably set a different  
property with the text contents and unset it on unserialization. This  
won't require Serializable though, and it had to be implemented  
carefully to not break old cached messages.

Jan.

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



More information about the dev mailing list