Not logged in. · Lost password · Register
Forum: General Help and Support Plugins RSS
Access to local.php variables in php
Avatar
barneym #1
Member since Jun 2006 · 20 posts
Group memberships: Members
Show profile · Link to this post
Subject: Access to local.php variables in php
I'm curious if there is a way and what the syntax is for referencing configuration variables defined in local.php.  I'd like to be able to do something like:

$conf['myplugin']['myparam'] = 'some data'

I've tried a few different methods to retrieve and reference the global conf array, but nothing seems to work.  It might be something stupid syntax wise on my side, but figured I'd ask here just in case.

Thanks,

barney
Avatar
purplepaisley #2
Member since May 2006 · 142 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
Silly question perhaps... Did you try declaring the $conf variable as global before you use it, within the function(s)/code?
Avatar
barneym #3
Member since Jun 2006 · 20 posts
Group memberships: Members
Show profile · Link to this post
Why yes...but in the wrong place. :)

See, there's no such thing as a silly question.

Thanks!
Avatar
ChrisS #4
Member since Sep 2006 · 91 posts
Group memberships: Members, Wiki Managers
Show profile · Link to this post
For plugin settings there are methods and properties available for accessing settings if they are placed in the right files.  For an example take a look at one of the plugins that uses them:
- discussion
- folded
- googlemaps
- ...
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-02-26, 14:58:29 (UTC +01:00)