Apache::Wyrd::DBL - Centralized location for tracking variables, internals
my $hostname = $wyrd->dbl->req->hostname; my $database_handle = $wyrd->dbl->dbh; my $value = $wyrd->dbl->param('value');
Apache::Wyrd::DBL ("Das Blinkenlights") is a convenient placeholder for all session information a Wyrd might need in order to do work. It holds references to the session's current apreq, DBI, and Apache objects, as well as the current session log and other vital information. It is meant to be called from within an Apache::Wyrd object through it's dbl method, as in the SYNOPSIS.
Apache::Wyrd::DBL
dbl
Debugging is always turned on if port 81 is used. Note that apache must be set up to listen at this port as well. See the Listen and BindAddress Apache directives.
new
initialize and return the DBL with a set of startup params and a set of global variables (for the WO to access) in the form of two hashrefs. The first hashref should include at least the 'req' key, which is an Apache request object.
The startup params can have several keys set. These may be:
the param/cookie subsystem (CGI or Apache::Request object initialized by a Apache::Wyrd::Request object);
database application. Should be the name of a DBI::DBD driver.
database name (to connect to)
database password
database user name
Logging level, per Apache::Wyrd object
pointer to globals hashref
the request itself (Apache request object)
should strict procedures be followed (not used by default)
the current user (not used by default)
Used by Apache::Wyrd to confirm it's been passed the right sort of object for a DBL.
strict
Optional read-only method for "strict" conditions. Not used by the default install.
loglevel
Optional read-only method for "loglevel" conditions. Not used by the default install.
log_bug
insert a debugging message in the session log.
set_logfile
give DBL a file in which to store it's events. The filehandle is then kept in the logfile attribute.
close_logfile
flush logfile to disk. Necessary in mod_perl situation, it seems.
log_event
same as log_bug, but don't send the output to STDERR. Instead, make it HTML escaped and store it for later dumping.
base_class
return the base class of this set of Wyrds.
taint_exceptions
Which params are allowed to contain information that could be interpreted as a Wyrd.
globals
return a reference to the globals hashref Has a useful debugging message on unfound globals.
mtime
the modification time of the file currently being served. Derived from Apache::Wyrd::Handler, by default compatible with the stat() builtin function.
stat()
size
the file size of the file currently being served. Derived from Apache::Wyrd::Handler, by default compatible with the stat() builtin function.
dev
the device number of filesystem of the file currently being served. Derived from Apache::Wyrd::Handler, by default compatible with the stat() builtin function.
ino
the inode number of the file currently being served. Derived from Apache::Wyrd::Handler, by default compatible with the stat() builtin function.
mode
the file mode (type and permissions) of the file currently being served. Derived from Apache::Wyrd::Handler, by default compatible with the stat() builtin function.
nlink
the number of (hard) links to the file of the file currently being served. Derived from Apache::Wyrd::Handler, by default compatible with the stat() builtin function.
uid
the numeric user ID of file's owner of the file currently being served. Derived from Apache::Wyrd::Handler, by default compatible with the stat() builtin function.
gid
the numeric group ID of file's owner of the file currently being served. Derived from Apache::Wyrd::Handler, by default compatible with the stat() builtin function.
rdev
the the device identifier (special files only) of the file currently being served. Derived from Apache::Wyrd::Handler, by default compatible with the stat() builtin function.
atime
the last access time in seconds since the epoch of the file currently being served. Derived from Apache::Wyrd::Handler, by default compatible with the stat() builtin function.
ctime
the inode change time in seconds since the epoch of the file currently being served. Derived from Apache::Wyrd::Handler, by default compatible with the stat() builtin function. See the perl documentation for details.
blksize
the preferred block size for file system I/O of the file currently being served. Derived from Apache::Wyrd::Handler, by default compatible with the stat() builtin function.
blocks
the actual number of blocks allocated of the file currently being served. Derived from Apache::Wyrd::Handler, by default compatible with the stat() builtin function.
get_global
retrieve a global by name.
find the global by name and set it. Has a helpful debugging message on undefined globals.
get_response
Return the response. Should be an Apache::Constants response code.
set_response
Set the response. Should be an Apache::Constants response code.
dbh
Database handle object. Collects database information from the initialization data and calls _init_db with it.
req
Apache request object
user
Optional read-only method for an Apache::Wyrd::User object. Not used by the default install.
Apache::Wyrd::User
apr
Apache::Wyrd::Request object (handle to either a CGI or Apache::Request object)
param
Like CGI->param(). As a security measure, any data found in parameters which matches the name of the Wyrds on a given installation, e.g. BASENAME is dropped unless the variable is named in the array of variable names stored by reference under the taint_exceptions key of the BASENAME::Handler's init() function.
init()
param_exists
Returns a non-null value if the CGI variable indicated by the scalar argument was actually returned by the client.
file_path
return the path to the actual file being parsed.
self_path
return the document-root relative path to the file being served.
self_url
return an interpolated version of the current url.
_init_db
open the DB connection. Accepts a database type, a database name, a username, and a password. Defaults to a mysql database. Sets the dbh parameter and the dbh_ok parameter if the database connection was successful. Meant to be called from dbh. As of version 0.97 calls connect_cached instead of attempting to maintain a cached connection itself.
close_db
close the dbh connection if it was opened.
dump_log
return a scalarref to a html-formatted dump of the log.
UNKNOWN
Barry King <wyrd@nospam.wyrdwright.com>
General-purpose HTML-embeddable perl object
Copyright 2002-2007 Wyrdwright, Inc. and licensed under the GNU GPL.
See LICENSE under the documentation for Apache::Wyrd.
Apache::Wyrd
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install Apache::Wyrd, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Apache::Wyrd
CPAN shell
perl -MCPAN -e shell install Apache::Wyrd
For more information on module installation, please visit the detailed CPAN module installation guide.