Password(3pm) User Contributed Perl Documentation Password(3pm)NAME
DBIx::Password - Allows you to create a global password file for DB passwords
SYNOPSIS
use DBIx::Password;
my $dbh = DBIx::Password->connect($user);
my $dbh = DBIx::Password->connect_cached($user);
$dbh->getDriver;
DBIx::Password::getDriver($user);
DBIx::Password::checkVirtualUser($user);
DBIx::Password::clearConfig();
DBIx::Password::readConfig("$ENV{HOME}/.my.secret.file");
DESCRIPTION
Don't you hate keeping track of database passwords and such throughout your scripts? How about the problem of changing those passwords on a
mass scale? This module is one possible solution. It stores all your virtual users and data in /etc/dbix-password.conf. For each user you
need to specify the database module to use, the database connect string, the username and the password. You will have to give a name to
this virtual user. You can add as many as you like.
I would recommend that if you are only using this with web applications that you change the final permissions on this package after it is
installed in site_perl such that only the webserver can read it.
A method called getDriver has been added so that you can determine what driver is being used (handy for working out database indepence
issues).
If you want to find out if the virtual user is valid, you can call the class method checkVirtualUser(). It returns true(1) if the
username is valid, and zero if not.
Once your are done you can use the connect method (or the connect_cache method) that comes with DBIx-Password and just specify one of the
virtual users you defined while making the module.
BTW I learned the bless hack that is used from Apache::DBI so some credit should go to the authors of that module. This is a rewrite of
the module Tangent::DB that I did for slashcode.
If your program does not need the system-wide information stored in the /etc/dbix-password.conf file, you may use the clearConfig() and
readConfig() functions to get the data from another source. At any time, readConfig() may also be used to merge the data from another file
into the currently-loaded configuration.
Hope you enjoy it.
HOME
To find out more information look at: http://www.tangent.org/DBIx-Password/
AUTHOR
Brian Aker, brian@tangent.org
SEE ALSO perl(1). DBI(3).
perl v5.10.0 2009-05-09 Password(3pm)
Check Out this Related Man Page
DBIx::FullTextSearch::StopList(3pm) User Contributed Perl Documentation DBIx::FullTextSearch::StopList(3pm)NAME
DBIx::FullTextSearch::StopList - Stopwords for DBIx::FullTextSearch
SYNOPSIS
use DBIx::FullTextSearch::StopList;
# connect to database (regular DBI)
my $dbh = DBI->connect('dbi:mysql:database', 'user', 'passwd');
# create a new empty stop word list
my $sl1 = DBIx::FullTextSearch::StopList->create_empty($dbh, 'sl_web_1');
# or create a new one with default stop words
my $sl2 = DBIx::FullTextSearch::StopList->create_default($dbh, 'sl_web_2', 'english');
# or open an existing one
my $sl3 = DBIx::FullTextSearch::StopList->open($dbh, 'sl_web_3');
# add stop words
$sl1->add_stop_word(['a','in','on','the']);
# remove stop words
$sl2->remove_stop_word(['be','because','been','but','by']);
# check if word is in stoplist
$bool = $sl1->is_stop_word('in');
# empty stop words
$sl3->empty;
# drop stop word table
$sl2->drop;
DESCRIPTION
DBIx::FullTextSearch::StopList provides stop lists that can be used -DBIx::FullTextSearch. StopList objects can be reused accross several
FullTextSearch objects.
METHODS
CONSTRUCTERS
create_empty
my $sl = DBIx::FullTextSearch::StopList->create_empty($dbh, $sl_name);
This class method creates a new StopList object.
create_default
my $sl = DBIx::FullTextSearch::StopList->create_default($dbh, $sl_name, $language);
This class method creates a new StopList object, with default words loaded in for the given language. Supported languages include
Czech, Danish, Dutch, English, Finnish, French, German, Italian, Portuguese, Spanish, and Swedish.
open
my $sl = DBIx::FullTextSearch::StopList->open($dbh, $sl_name);
Opens and returns StopList object
OBJECT METHODS
add_stop_word
$sl->add_stop_word(@stop_words);
Adds stop words to StopList object. Expects array reference as argument.
remove_stop_word
$sl->remove_stop_word(@stop_words);
Remove stop words from StopList object.
is_stop_word
$bool = $sl->is_stop_word($stop_word);
Returns true iff stop_word is StopList object
empty
$sl->empty;
Removes all stop words in StopList object.
drop
$sl->drop;
Removes table associated with the StopList object.
AUTHOR
T.J. Mather, tjmather@tjmather.com, http://www.tjmather.com/
COPYRIGHT
All rights reserved. This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
DBIx::FullTextSearch
perl v5.8.8 2007-10-23 DBIx::FullTextSearch::StopList(3pm)