6.0.0-beta1
7/4/25

[#6299] global $conf empty
Summary global $conf empty
Queue Horde Base
Queue Version 3.2-RC2
Type Bug
State Resolved
Priority 2. Medium
Owners jan (at) horde (dot) org
Requester bart-horde (at) xbar (dot) net
Created 02/20/2008 (6344 days ago)
Due
Updated 03/03/2008 (6332 days ago)
Assigned 02/25/2008 (6339 days ago)
Resolved 03/03/2008 (6332 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
03/03/2008 06:49:31 PM Jan Schneider Comment #8
Assigned to Jan Schneider
State ⇒ Resolved
Reply to this comment
Changed in CVS.
03/03/2008 06:42:34 PM Michael Rubinsky Comment #7 Reply to this comment
That seems like the only reasonable fix to me.
03/03/2008 06:24:30 PM Jan Schneider Comment #6 Reply to this comment
So, what do we do? Not defaulting to Horde::getTempDir()? Shouldn't 
even be a PHP expression anymore then.
02/25/2008 04:29:27 PM Michael Rubinsky Comment #5 Reply to this comment
So it works in apps, but not in Horde, right?
The issue I'm referring to occurs in any application context.  To see 
what I mean, set $conf['tmpdir'] to something other than your system 
default.  Set $conf[cache][params][dir] to Horde::getTempDir() (while 
using file based cache).



Then from admin->php shell try the following



echo $conf['tmpdir']; // This will show the correct value that you set.

echo $conf['cache']['params']['dir']; // This will incorrectly show 
the system's default tmp directory.



echo Horde::getTempDir(); // This will correctly show the conigured 
horde tmpdir default, since it's being executed after the app has been 
loaded in the registry.


02/25/2008 11:32:09 AM bart-horde (at) xbar (dot) net Comment #4 Reply to this comment
hasn't finished loading (and is not yet in the GLOBAL scope) when
Horde::getTempDir() is called from conf.php.
So it works in apps, but not in Horde, right?
as far as i am concerned it doesn't work anywhere besides Horde's 
Adminitration/Setup and when attaching an e-mail in IMP. but even when 
you have accessed Setup or Compose+Attach, the $conf variable is empty 
again afterwards. so i'm afraid the answer would be no, the problem 
persists through all applications.


02/25/2008 04:36:08 AM Chuck Hagenbuch Comment #3
Priority ⇒ 2. Medium
State ⇒ Feedback
Reply to this comment
yea, I just uncovered this one the other day as well.  The issue is
that when an application is loaded in the registry
($registry-pushApp() -> Horde::loadConfiguration() etc...) conf.php
hasn't finished loading (and is not yet in the GLOBAL scope) when
Horde::getTempDir() is called from conf.php.
So it works in apps, but not in Horde, right?
02/20/2008 06:29:15 PM Michael Rubinsky Comment #2 Reply to this comment
yea, I just uncovered this one the other day as well.  The issue is 
that when an application is loaded in the registry 
($registry-pushApp() -> Horde::loadConfiguration() etc...) conf.php 
hasn't finished loading (and is not yet in the GLOBAL scope) when 
Horde::getTempDir() is called from conf.php.



We're looking at possible fixes, but for now, your going to need to 
hard code your tmp path there if you want it something other than your 
system default.


02/20/2008 01:45:51 PM bart-horde (at) xbar (dot) net Comment #1
Priority ⇒ 3. High
Type ⇒ Bug
Summary ⇒ global $conf empty
Queue ⇒ Horde Base
State ⇒ Unconfirmed
Reply to this comment
$conf seems to be empty when Horde::getTempDir() is executed, except 
while accessing the Administration/Setup, in that case it actually 
contains the variables from conf.php. In all other cases 
Util::getTempDir() is executed because of $conf being empty.



i noticed this when Horde cache files were being written in the php 
upload_tmp_dir, while they should be in $conf['tmpdir']. 
Util::getTempDir()  falls back to php's upload_tmp_dir whenever it 
can't find $config['tmpdir'], therefor the cache files are in the 
wrong directory.



i changed Horde::getTempDir() to print_r $conf  whenever it's being 
called, and so far I only saw output generated when accessing the 
Administration/Setup and also when attaching a file to a message in 
IMP. in this case the the file also resides in $config['tmpdir'] just 
untill the message has been sent (which is correct behavior imho).



I'm using the latest RC2 version of Horde/IMP

Saved Queries