CPAN-MetaCurator

 view release on metacpan or  search on metacpan

data/cpan.metacurator.conf  view on Meta::CPAN

# Database stuff
# --------------

AutoCommit				= 1
dsn						= dbi:SQLite:dbname=data/cpan.metacurator.sqlite
#dsn					= dbi:mysql:database=cpan.metacurator
#dsn					= dbi:Pg:dbname=cpan.metacurator
RaiseError				= 1
username				= local
password				= local
mysql_enable_utf8		= 1
mysql_enable_utf8mb4	= 1
pg_enable_utf8			= 1

# General stuff
# -------------

log_path = log/development.log

[webhost]

# TBA.

data/cpan.metapackager.conf  view on Meta::CPAN

# Database stuff
# --------------

AutoCommit				= 0
dsn						= dbi:SQLite:dbname=/tmp/cpan.metapackager.sqlite
#dsn					= dbi:mysql:database=cpan.metapackager
#dsn					= dbi:Pg:dbname=cpan.metapackager
RaiseError				= 1
username				= local
password				= local
mysql_enable_utf8		= 1
mysql_enable_utf8mb4	= 1
pg_enable_utf8			= 1

[webhost]

# TBA.

lib/CPAN/MetaCurator/Database.pm  view on Meta::CPAN

# -----------------------------------------------

sub init_db
{
	my($self)		= @_;
	my($config)		= $self -> config;

	my(%attributes)	=
	(
		AutoCommit 				=> $$config{AutoCommit},
		mysql_enable_utf8		=> $$config{mysql_enable_utf8},		# Ignored if not using MySQL.
		mysql_enable_utf8mb4	=> $$config{mysql_enable_utf8mb4},	# Ignored if not using MySQL.
		pg_enable_utf8			=> $$config{pg_enable_utf8},		# Ignored if not using Pg.
		RaiseError 				=> $$config{RaiseError},
		sqlite_unicode			=> $$config{sqlite_unicode},		# Ignored if not using SQLite.
	);

	my(@dsn)	= split('=', $$config{dsn});
	$dsn[1]	 	= File::Spec -> catfile($self -> home_path, $dsn[1]);
	$dsn[0]		= "$dsn[0]=$dsn[1]";

	$self -> dbh(DBI -> connect($dsn[0], $$config{username}, $$config{password}, \%attributes) );

lib/CPAN/MetaCurator/Database.pm  view on Meta::CPAN

# -----------------------------------------------

sub init_metapackager_db
{
	my($self)		= @_;
	my($config)		= $self -> metapackager_config;

	my(%attributes)	=
	(
		AutoCommit 				=> $$config{AutoCommit},
		mysql_enable_utf8		=> $$config{mysql_enable_utf8},		# Ignored if not using MySQL.
		mysql_enable_utf8mb4	=> $$config{mysql_enable_utf8mb4},	# Ignored if not using MySQL.
		pg_enable_utf8			=> $$config{pg_enable_utf8},		# Ignored if not using Pg.
		RaiseError 				=> $$config{RaiseError},
		sqlite_unicode			=> $$config{sqlite_unicode},		# Ignored if not using SQLite.
	);

	my(@dsn)	= split('=', $$config{dsn});
	$dsn[1]	 	= File::Spec -> catfile($dsn[1]);
	$dsn[0]		= "$dsn[0]=$dsn[1]";

	$self -> metapackager_dbh(DBI -> connect($dsn[0], $$config{username}, $$config{password}, \%attributes) );



( run in 1.144 second using v1.01-cache-2.11-cpan-437f7b0c052 )