[pmwiki-users] Beginner Question...
IchBin
weconsul at ptd.net
Fri Sep 8 18:51:00 CDT 2006
Patrick R. Michaud wrote:
> On Fri, Sep 08, 2006 at 05:32:35PM -0400, IchBin wrote:
>> Example: I define this is my config: Beginner Question...
>>
>> ## - ( VisitorsLogging \DB)
>> ----------------------------------------------------------------
>> include_once('cookbook/VisitorsLoggingDB.php');
>> $VisitorsLoggingDBDatabase = 'visitors_log';
>> $VisitorsLoggingDBServer = 'localhost:3306';
>> $VisitorsLoggingDBUserid = 'DBUserid';
>> $VisitorsLoggingDBPassword = 'DBPassword';
>> $VisitorsLoggingDBHome = 'weconsultants.phpnet.us';
>>
>> In the recipe I do the following to make sure the vars have the value
>> passed:
>>
>> SDV($VisitorsLoggingDBDatabase, ' ');
>> SDV($VisitorsLoggingDBServer, ' ');
>> SDV($VisitorsLoggingDBUserid, ' ');
>> SDV($VisitorsLoggingDBPassword, ' ');
>> SDV($VisitorsLoggingDBHome, ' ');
>>
>> All are evaluated to be ' '; What do I have to do to pass the defined
>> vars and their value to the recipe from the config?
>
> Depending on how VisitorsLoggingDB.php is written,
> it's likely that you need to be setting the values of
> $VisitorsLoggingDB... *before* including the php script,
> instead of after -- especially if the script is immediately
> acting on them.
>
> The SDV() function doesn't allow us to magically look ahead
> in the config.php file to see if a value is going to be set,
> all it does is say "if this variable doesn't already have a value,
> give it this one".
>
> Hope this helps,
>
> Pm
Thanks Patrick, I was loading the module before setting the defaults.
--
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
More information about the pmwiki-users
mailing list