Skip to content
Snippets Groups Projects
Commit c84a78e6 authored by renater.salaun's avatar renater.salaun
Browse files

move DB details to the configuration file

git-svn-id: https://svn.geant.net/GEANT/edugain_testidp_account_manager/trunk@13 047e039d-479c-447e-8a29-aa6bf4a09bab
parent 2e59dff7
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/perl
## Initialize Rose::DB code given the DB structure
use lib "/opt/testidp/IdPAccountManager/lib";
use Rose::DB;
use Rose::DB::Object::Loader;
use Getopt::Long;
use IdPAccountManager::Conf;
my %options;
unless (&GetOptions(\%options, 'database=s')) {
die "Unknown options.";
}
my $dbname = $options{'database'} || 'idp_account_manager';
my $dbname = $options{'database'} || $IdPAccountManager::Conf::global{'database_name'};
$loader =
Rose::DB::Object::Loader->new(
db_dsn => "dbi:mysql:dbname=$dbname;host=localhost",
db_username => 'idpadmin',
db_password => 'PQur;m9#I[',
db_dsn => 'dbi:'.$IdPAccountManager::Conf::global{'database_type'}.':dbname='.$dbname.';host='.$IdPAccountManager::Conf::global{'database_host'},
db_username => $IdPAccountManager::Conf::global{'database_user'},
db_password => $IdPAccountManager::Conf::global{'database_password'},
db_options => { AutoCommit => 1, ChopBlanks => 1 },
class_prefix => 'IdPAccountManager::Data',
#with_unique_keys => 0,
......@@ -26,3 +29,5 @@ $loader->make_modules(with_managers => 1,
module_dir => '/tmp',
#with_relationships => ['one to many','many to one']
);
printf "Database-related code created in /tmp/IdPAccountManager. You should copy this code in lib/ directory\n";
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment