summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-06-19 20:40:24 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-06-19 20:40:24 +0800
commit58944b2528fbcadaf91587799c9bf9f0261f87b8 (patch)
tree5b3f3be9677da4b51a280ff3291a7beeda8d5256
parent6491311d11a8c3f9c7cecdc1cc39d5c7ef8eeb9d (diff)
downloadpttbbs-58944b2528fbcadaf91587799c9bf9f0261f87b8.tar
pttbbs-58944b2528fbcadaf91587799c9bf9f0261f87b8.tar.gz
pttbbs-58944b2528fbcadaf91587799c9bf9f0261f87b8.tar.bz2
pttbbs-58944b2528fbcadaf91587799c9bf9f0261f87b8.tar.lz
pttbbs-58944b2528fbcadaf91587799c9bf9f0261f87b8.tar.xz
pttbbs-58944b2528fbcadaf91587799c9bf9f0261f87b8.tar.zst
pttbbs-58944b2528fbcadaf91587799c9bf9f0261f87b8.zip
$BLOG(dbname|dbhost|dbuser|dbpasswd)
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@943 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rwxr-xr-xblog/blog.pl9
-rw-r--r--sample/LocalVars.pm5
2 files changed, 9 insertions, 5 deletions
diff --git a/blog/blog.pl b/blog/blog.pl
index e3ba2744..725d3d01 100755
--- a/blog/blog.pl
+++ b/blog/blog.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# $Id: blog.pl,v 1.21 2003/06/18 09:06:21 in2 Exp $
+# $Id: blog.pl,v 1.22 2003/06/19 12:40:24 in2 Exp $
use CGI qw/:standard/;
use lib qw/./;
use LocalVars;
@@ -311,10 +311,9 @@ sub dodbi
my($ret);
use DBI;
use DBD::mysql;
- my $dbh = DBI->connect("DBI:mysql:database=blog;".
- "host=localhost",
- 'root',
- '',
+ my $dbh = DBI->connect("DBI:mysql:database=$BLOGdbname;".
+ "host=$BLOGdbhost",
+ $BLOGdbuser, $BLOGdbpasswd,
{'RaiseError' => 1});
eval {
$ret = &{$func}($dbh);
diff --git a/sample/LocalVars.pm b/sample/LocalVars.pm
index 4e52d0f0..de215da7 100644
--- a/sample/LocalVars.pm
+++ b/sample/LocalVars.pm
@@ -7,6 +7,7 @@ require Exporter;
$BBSHOME $JOBSPOOL $TMP
$TAR $LYNX $GREP
$BLOGDATA $BLOGCACHE
+ $BLOGdbname $BLOGdbhost $BLOGdbuser $BLOGdbpasswd
/;
# host
@@ -31,3 +32,7 @@ $GREP = '/usr/bin/grep';
# ¶·¬° apache owner ¥i¼g¤J
$BLOGDATA = '/home/bbs/blog/data';
$BLOGCACHE = '/home/bbs/blog/cache';
+$BLOGdbname = 'myblog';
+$BLOGdbhost = 'localhost';
+$BLOGdbuser = 'root';
+$BLOGdbpasswd = '';