WWW-Garden-Design
view release on metacpan or search on metacpan
config/www.garden.design.conf view on Meta::CPAN
# Defaults for database connexions.
AutoCommit = 1
# Set FLOWER_DB to match!
dsn = dbi:SQLite:dbname=data/flowers.sqlite
#dsn = dbi:mysql:database=flowers
#dsn = dbi:Pg:dbname=flowers
RaiseError = 1
username = local
password = local
mysql_enable_utf8 = 1
sqlite_string_mode = DBD_SQLITE_STRING_MODE_BYTES # Not used. See Create.pm.
# Defaults for fonts when the database is empty.
# Note: Values in the constants table take precedence. See Database.init_imager().
tile_font_file = /usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf
tile_font_size = 16
# Defaults for logging.
lib/WWW/Garden/Design/Database/MojoDriver.pm view on Meta::CPAN
# -----------------------------------------------
sub BUILD
{
my($self) = @_;
my($config) = $self -> config;
my($attr) =
{
AutoCommit => $$config{AutoCommit},
mysql_enable_utf8 => $$config{mysql_enable_utf8}, #Ignored if not using MySQL.
RaiseError => $$config{RaiseError},
sqlite_unicode => $$config{sqlite_unicode}, #Ignored if not using SQLite.
};
$self -> dbh(DBI -> connect($$config{dsn}, $$config{username}, $$config{password}, $attr) );
$self -> db(WWW::Garden::Design::Database::Mojo -> new({dbh => $self -> dbh}) );
} # End of BUILD;
# --------------------------------------------------
lib/WWW/Garden/Design/Util/Create.pm view on Meta::CPAN
# -----------------------------------------------
sub BUILD
{
my($self) = @_;
my($config) = $self -> config;
my($attr) =
{
AutoCommit => $$config{AutoCommit},
mysql_enable_utf8 => $$config{mysql_enable_utf8}, #Ignored if not using MySQL.
RaiseError => $$config{RaiseError},
sqlite_unicode => $$config{sqlite_unicode}, #Ignored if not using SQLite.
};
$self -> dbh(DBI -> connect($$config{dsn}, $$config{username}, $$config{password}, $attr) );
$self -> dbh -> do('PRAGMA foreign_keys = ON') if ($$config{dsn} =~ /SQLite/i);
$self -> creator
(
DBIx::Admin::CreateTable -> new
( run in 1.279 second using v1.01-cache-2.11-cpan-5deb9d3441d )