[pmwiki-users] Beginner Question...

Patrick R. Michaud pmichaud at pobox.com
Fri Sep 8 17:32:22 CDT 2006


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




More information about the pmwiki-users mailing list