[dev] how to repair the conf object?

Sebastian Birnbach birnbacs at gmail.com
Sat May 25 06:41:39 UTC 2019


Am Fr., 24. Mai 2019 um 22:13 Uhr schrieb Michael J Rubinsky <
mrubinsk at horde.org>:

>
> Quoting Sebastian Birnbach <birnbacs at gmail.com>:
>
> > I recently installed nag and found out that my own application had stolen
> > one of its settings:
> > $GLOBALS['conf']['storage']['driver'].
>
> Each application runs in it's own configuration scope, so I'm not sure
> what you mean here. How did it steal it?
>

I happened to choose $GLOBALS['conf'][dossierstorage]['driver'] for my own
purposes. That is, my conf.xml looked like this:

<?xml version="1.0"?>
<!-- $Id: 0f00ea4b8b9ffa35aef42705c8eca2d06ca65177 $ -->
<configuration>
 <configsection name="storage">
  <configheader>Storage System Settings</configheader>
  <configswitch name="driver" desc="What storage driver should we use?">
   <case name="sql" desc="SQL">
    <configsection name="params">
     <configsql switchname="driverconfig">
     </configsql>
    </configsection>
   </case>
   <case name="rdo" desc="RDO">
    <configsection name="params">
     <configsql switchname="driverconfig">
     </configsql>
    </configsection>
   </case>
  </configswitch>
 </configsection>

 <configsection name="templates">
  <configheader>Templates Location</configheader>
  <configstring name="path" desc="Storage location of office template
files. Make sure the directory exists and is writable for the webserver"
required="true">
  /usr/local/www/apache24/data/abakus/officetemplates</configstring>
 </configsection>

</configuration>



>
> > (It took me a while to figure this out)
> >
> > I changed my application so that it uses
> > $GLOBALS['conf'][dossierstorage]['driver'] instead. This side works well
> > again.
> >
> > Problem is, I am unable to get nag's configuration hash entry back. I can
> > see and manipulate nag's configuration in the console and settings get
> > reflected in nag/config/conf.php no problem. But when I dump them with
> > print_r($GLOBALS['conf']) they are missing.
>
> Where are you dumping the values? You have to do it from within Nag's
> context if you want to see Nag's $conf entries. Use the php shell in
> the horde admin, and select 'Nag' in the context drop down.
>

I started playing around with Nag_Api and kept getting

Cannot instantiate abstract class Nag_Drivererrors.


 So I looked into nag/lib/Factory/Driver.php to see what is the matter.
Around line 39 the name of the driver is pulled from
$GLOBALS['conf'][dossierstorage]['driver'] .

I dumped the configuration hash there with print_r($GLOBALS['conf']) and
found the setting contained 'rdo'. Changing the configuration of my own
application made this value change as well, so I thought I had found the
problem. I changed my application not to use said configuration entry as
described. The dump now shows the changed setting ('dossierstorage'), but
not the original ('storage') any more.

Nag's driver works fine if I edit Driver.php north of line 39 to read
$driver = 'sql'; I can access tasklists and everything through the api then.

By way of testing: managing conf.php seems to work fine.
$myconfig = new Horde_Config('nag');
print_r($myconfig->getPHPConfig());
reflects the file's contents and I can change the file through the admin
console.

Only conf.php's contents do not seem to get promoted into the configuration
hash.


>
> > I tried logging out and back in, restarting the web server and even
> > reinstalling nag, but to no avail. I also tried setting conf values
> > manually
> > $GLOBALS['conf']['storage'] = array('params' => array('driverconfig' =>
> > 'horde'), 'driver' => 'sql');
> > but such changes do not get saved.
> > --
> > dev mailing list
> > Frequently Asked Questions: http://wiki.horde.org/FAQ
> > To unsubscribe, mail: dev-unsubscribe at lists.horde.org
>
>
>
> --
> mike
> The Horde Project
> http://www.horde.org
> https://www.facebook.com/hordeproject
> https://www.twitter.com/hordeproject
> --
> dev mailing list
> Frequently Asked Questions: http://wiki.horde.org/FAQ
> To unsubscribe, mail: dev-unsubscribe at lists.horde.org
>


More information about the dev mailing list