6.0.0-beta1
11/8/25

[#1323] Horde with PHP 5.0.3: Prefs don't get saved in the database
Summary Horde with PHP 5.0.3: Prefs don't get saved in the database
Queue Horde Base
Queue Version 3.0.2
Type Bug
State Not A Bug
Priority 2. Medium
Owners
Requester webmaster (at) ragnarokonline (dot) de
Created 02/07/2005 (7579 days ago)
Due
Updated 02/16/2005 (7570 days ago)
Assigned 02/08/2005 (7578 days ago)
Resolved 02/16/2005 (7570 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
02/16/2005 10:09:25 AM Jan Schneider Comment #6
State ⇒ Not A Bug
Reply to this comment
You may try to ask on the PHP mailing list.
02/10/2005 10:55:21 PM webmaster (at) ragnarokonline (dot) de Comment #5 Reply to this comment
It works now after adding ;?:/path/to/Apache2 to the open_basedir 
setting of my vhost, where horde is installed ...

However. It worked fine with PHP 4.

Can anyone tell me, why this requires access to my Apache2 base dir to 
work? Even allowing every single subdirectory of my Apache2-dir didn't 
fix this.
02/10/2005 07:51:11 PM Chuck Hagenbuch Comment #4 Reply to this comment
I can't reproduce this with PHP 5.0.3 - my preferences are saved with 
no problems.
02/08/2005 01:30:10 PM webmaster (at) ragnarokonline (dot) de Comment #3 Reply to this comment
Ok, after some more testing: Everything seems to work fine with PHP4, 
so it's not a misconfiguration issue on my side.



The following testcase works as expected, so this semms not to be a 
global issue with PHP 5:

<?php



class FOO

{

        var $test1 = 123;

        var $test2 = 'blah';

        var $test3 = true;

        var $test4 = false;

        var $test5 = array(123, 'blah', true, false);

        var $test6 = 0;

}



function foobar($return = false)

{

        global $docroot, $foobar;



        if (!$return)

                file_put_contents($docroot . '/foobar.txt', '$foobar = ' . 
var_export($foobar, true) . ";\n");

        else

                return "\n\n\$foobar = " . var_export($foobar, true) . ";\n";

}



function blah($return = false)

{

        global $docroot, $blah;



        if (!$return)

                file_put_contents($docroot . '/blah.txt', '$blah = ' . 
var_export($blah, true) . ";\n");

        else

                return "\n\n\$blah = " . var_export($blah, true) . ";\n";

}



$docroot = $_SERVER['DOCUMENT_ROOT'];



register_shutdown_function('foobar');

register_shutdown_function('blah');



$foobar = clone(new Foo());

$blah =& new Foo();



echo foobar(true);

echo blah(true);



$blah->test1 = $foobar->test1 = 456;

$blah->test2 = $foobar->test2 = 'moo';

$blah->test3 = $foobar->test3 = false;

$blah->test4 = $foobar->test4 = true;

$blah->test5 = $foobar->test5 = array(456, 'moo', false, true);

$blah->test6 = $foobar->test6 = 12;



echo foobar(true);

echo blah(true);



?>
02/08/2005 08:52:47 AM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
I really don't know what to do with this ticket? I consider this a 
*huge* BC break in PHP5, if that's really the case.
02/07/2005 06:15:03 PM webmaster (at) ragnarokonline (dot) de Comment #1
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ Horde with PHP 5.0.3: Prefs don't get saved in the database
Queue ⇒ Horde Base
Reply to this comment
If I try to change any of the prefs, they won't get updated.



After some research I've found out, that the changes get lost 
somewhere between the end of the script and the execution of the 
shutdown-function.



Adding $prefs->store(); to the very end of 
/path/to/horde/services/prefs.php and 
/path/to/horde/services/portal/edit.php did the trick as a workaround.



Looks, like PHP 5 destroys the $prefs-instance, before the 
shutdown-function is being executed.

Saved Queries