<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Fix for PHP4 reference handling</title> 
  <pubDate>Fri, 10 Apr 2026 14:10:55 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/5355</link> 
  <atom:link rel="self" type="application/rss+xml" title="Fix for PHP4 reference handling" href="https://bugs.horde.org/ticket/5355/rss" /> 
  <description>Fix for PHP4 reference handling</description> 
 
   
   
  <item> 
   <title>Hello together,



while developing the new Kolab driver for</title> 
   <description>Hello together,



while developing the new Kolab driver for kronolith I found out that the reference handling in PHP4 is somewhat messed up. I&#039;ve written a small test case to demonstrate the problem. Attached you&#039;ll find a fix for Kronolith and one for Horde_Share.



Cheers,

Thomas

</description> 
   <pubDate>Mon, 14 May 2007 13:33:27 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5355#t33057</link> 
  </item> 
   
  <item> 
   <title>Fix for kronolith</title> 
   <description>Fix for kronolith</description> 
   <pubDate>Mon, 14 May 2007 13:33:52 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5355#t33058</link> 
  </item> 
   
  <item> 
   <title>Fix for Horde_Share.

</title> 
   <description>Fix for Horde_Share.

</description> 
   <pubDate>Mon, 14 May 2007 13:34:22 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5355#t33059</link> 
  </item> 
   
  <item> 
   <title>I know you probably have, but did you test the Share change?</title> 
   <description>I know you probably have, but did you test the Share change? There have been problems in the past with assigning a reference to a static variable in PHP 4. It may work if the static variable is an array, instead of overwriting the static directly. But if you have:



static $foo;

...

$foo = &amp;new Bar();



Then the reference won&#039;t take.



Also, this should only matter if, in the constructor, the class creates a child object that needs to be assigned by reference. So I think a lot of the places you added it in Kronolith are unnecessary. Can you add new patches that only add the &amp; where it fixes a problem we&#039;re seeing?



Thanks!</description> 
   <pubDate>Mon, 14 May 2007 19:28:24 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5355#t33063</link> 
  </item> 
   
  <item> 
   <title>Hello Chuck,



&gt; I know you probably have, but did you test</title> 
   <description>Hello Chuck,



&gt; I know you probably have, but did you test the Share change? There 

&gt; have been problems in the past with assigning a reference to a static 

&gt; variable in PHP 4. It may work if the static variable is an array, 

&gt; instead of overwriting the static directly. But if you have:

&gt;

&gt; static $foo;

&gt; ...

&gt; $foo = &amp;new Bar();

&gt;

&gt; Then the reference won&#039;t take.



Wow, I just modified my example code and it broke. Thanks for pointing this out. The Horde_Share::singleton() code uses an array $shares, so it should be ok. Works so far without problems here. I&#039;ve changed this as the new kolab share handler uses internal references between parent and child objects.



&gt; Also, this should only matter if, in the constructor, the class 

&gt; creates a child object that needs to be assigned by reference. So I 

&gt; think a lot of the places you added it in Kronolith are unnecessary. 

&gt; Can you add new patches that only add the &amp; where it fixes a problem 

&gt; we&#039;re seeing?



Well, the new kronolith kolab driver uses an internal wrapper to switch between the old and the new backend. This wrapper has a back-reference to the Kronolith_Driver object, which breaks without the change. The problem is you think its working, but you almost won&#039;t notice it and then strange bugs occur when a variable inside the real driver object changed and you still have an old copy of that object floating around.



If you want to you can skip the &quot;FBview.php&quot; and &quot;Kronolith.php&quot; part of the patch

as it was only changed to make the fix complete. I&#039;ve just checked all static variables in Kronolith, looks good to me.



I&#039;m still wondering a bit about Kronolith_Driver::factory(). The comment states it should return a concrete instance of a driver, but as far as I can see it always creates a new instance. Also take a look at lib/Scheduler/kronolith.php. It creates a global driver object and then creates another two. Is that supposed to happen?



Cheers,

Thomas

</description> 
   <pubDate>Tue, 15 May 2007 08:01:47 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5355#t33072</link> 
  </item> 
   
  <item> 
   <title>&gt; I&#039;m still wondering a bit about Kronolith_Driver::factory(</title> 
   <description>&gt; I&#039;m still wondering a bit about Kronolith_Driver::factory(). The 

&gt; comment states it should return a concrete instance of a driver, but 

&gt; as far as I can see it always creates a new instance.



That&#039;s the behavior of a factory - it turns a string into a concrete object. Probably not the clearest behavior in the world but it&#039;s behaving correctly.



&gt; Also take a look at lib/Scheduler/kronolith.php. It creates a global driver 

&gt; object and then creates another two. Is that supposed to happen?



Doubtful. :)</description> 
   <pubDate>Thu, 17 May 2007 19:47:46 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5355#t33141</link> 
  </item> 
   
  <item> 
   <title>The fixes are committed now, thanks.</title> 
   <description>The fixes are committed now, thanks.</description> 
   <pubDate>Thu, 17 May 2007 19:49:14 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5355#t33144</link> 
  </item> 
   
  <item> 
   <title>I&#039;ve done another round of reference fixing and here is the </title> 
   <description>I&#039;ve done another round of reference fixing and here is the result. We didn&#039;t want to commit it directly to CVS, so please have a look. I hope it&#039;s the last patch in this area :-)

</description> 
   <pubDate>Fri, 25 May 2007 09:58:54 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5355#t33460</link> 
  </item> 
   
  <item> 
   <title>Committed, thanks.</title> 
   <description>Committed, thanks.</description> 
   <pubDate>Fri, 25 May 2007 16:42:56 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5355#t33505</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
