Name
createEnvironment — sets up Slash to run scripts outside of the web environment
Synopsis
createEnvironment(); createEnvironment($virtual_user);
createEnvironment initializes several Slash components
that would normally be set when running under Apache. This includes creating a
database connection and setting the current user to the Anonymous User. It
takes an optional single parameter, $virtual_user, which is the string
name of the DBIx::Password virtual user associated with
the database that will be used. Lacking this parameter, it will look through
@ARGV for key/value pairs of the form
“key=value”. If it finds a key named
virtual_user, it will use the associated value. It returns
nothing and will perform no action if running under
mod_perl. This function is exported from
Slash::Utility.
Example
use Slash::Utility; my $virtual_user = $ARGV[0]; createEnvironment($virtual_user);
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access