Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Александр Буш
/
minesite
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4a6a0f77
authored
Mar 10, 2013
by
Alex Bush
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mysql
1 parent
ddc133aa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
5 deletions
minecraft
minecraft.conf.example
minecraft
View file @
4a6a0f7
...
...
@@ -13,10 +13,25 @@ app->secret($config->{secret} || 'minecraft');
plugin
charset
=>
{
charset
=>
$config
->
{
encoding
}};
# Connect to db
our
$dbi
=
DBIx::
Custom
->
connect
(
dsn
=>
"dbi:$config->{db_driver}:database=$config->{db}"
,
option
=>
{
sqlite_unicode
=>
1
},
);
if
(
$config
->
{
db_driver
}
eq
'SQLite'
)
{
our
$dbi
=
DBIx::
Custom
->
connect
(
dsn
=>
"dbi:$config->{db_driver}:database=$config->{db}"
,
option
=>
{
sqlite_unicode
=>
1
},
);
}
elsif
(
$config
->
{
db_driver
}
eq
'mysql'
)
{
my
$dbi
=
DBIx::
Custom
->
connect
(
dsn
=>
"dbi:$config->{db_driver}:database=$config->{db}"
,
user
=>
$config
->
{
db_username
},
password
=>
$config
->
{
db_password
},
option
=>
{
mysql_enable_utf8
=>
1
}
);
my
$dbi
=
DBIx::
Custom
->
connect
(
dsn
=>
"dbi:mysql:database=$config->{db};host=$config->{db_host};port=$config->{db_port}"
,
user
=>
$config
->
{
db_username
},
password
=>
$config
->
{
db_password
},
option
=>
{
PrintError
=>
1
,
mysql_enable_utf8
=>
1
}
);
}
sub
wikitree
{
my
$tree_row
=
$dbi
->
select
(
...
...
minecraft.conf.example
View file @
4a6a0f7
{
secret => 'minecraft',
encoding => 'utf-8',
db_driver => 'SQLite',
# DB
#
# For mysql:
# db => 'DBNAME',
# dh_host => 'db_host' # 'localhost'
# db_port => '3306',
# db_driver => 'mysql',
# db_username => 'DBUSER',
# db_password => 'DBPASSWORD',
#
db => 'minecraft.sqlite',
db_driver => 'SQLite',
db_username => '',
db_passwd => '',
# Auth
username => 'admin',
userpass => 'test',
};
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment