Apache-DBI
view release on metacpan or search on metacpan
lib/Apache/AuthDBI.pm view on Meta::CPAN
updated with the log_string. As log_string - depending upon the database -
macros like TODAY can be used.
The SQL-select used for the logging mechanism is as follows:
UPDATE pwd_table SET log_field = log_string WHERE uid_field = user
Authorization:
When the authorization handler is called, the authentication has already been
done. This means, that the given username/password has been validated.
The handler analyzes and processes the requirements line by line. The request
is accepted if the first requirement is fulfilled.
In case of 'valid-user' the request is accepted.
In case of one or more user-names, they are compared with the given user-name
until the first match.
In case of one or more group-names, all groups of the given username are
lib/Apache/DBI.pm view on Meta::CPAN
for grabbing data needed at startup and disconnect it normally before the end of
startup.
With this limitation in mind, there are scenarios, where the usage of
Apache::DBI is depreciated. Think about a heavy loaded Web-site where every
user connects to the database with a unique userid. Every server would create
many database handles each of which spawning a new backend process. In a short
time this would kill the web server.
Another problem are timeouts: some databases disconnect the client after a
certain period of inactivity. The module tries to validate the database handle
using the C<ping()> method of the DBI-module. This method returns true by default.
Most DBI drivers have a working C<ping()> method, but if the driver you're using
doesn't have one and the database handle is no longer valid, you will get an error
when accessing the database. As a work-around you can try to add your own C<ping()>
method using any database command which is cheap and safe, or you can deactivate the
usage of the ping method (see CONFIGURATION below).
Here is a generalized ping method, which can be added to the driver module:
package DBD::xxx::db; # ====== DATABASE ======
lib/Apache/DBI.pm view on Meta::CPAN
There are two configurations which are server-specific and which can be done
upon server startup:
Apache::DBI->connect_on_init($data_source, $username, $auth, \%attr)
This can be used as a simple way to have apache servers establish connections
on process startup.
Apache::DBI->setPingTimeOut($data_source, $timeout)
This configures the usage of the ping method, to validate a connection.
Setting the timeout to 0 will always validate the database connection
using the ping method (default). Setting the timeout < 0 will de-activate
the validation of the database handle. This can be used for drivers, which
do not implement the ping-method. Setting the timeout > 0 will ping the
database only if the last access was more than timeout seconds before.
For the menu item 'DBI connections' you need to call
Apache::Status/Apache2::Status BEFORE Apache::DBI ! For an example of the
configuration order see startup.pl.
To enable debugging the variable $Apache::DBI::DEBUG must be set. This
( run in 0.279 second using v1.01-cache-2.11-cpan-4d50c553e7e )