File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,6 @@ if [ "$DBPORT" != "" ]
85
85
then
86
86
DBCMD=" $DBCMD -P$DBPORT "
87
87
fi
88
- DBCMD=" $DBCMD $DBNAME "
89
88
90
89
# ##
91
90
#
@@ -96,7 +95,7 @@ if [ "$INITDB" ]
96
95
then
97
96
PATCH_LEVEL=0
98
97
else
99
- PATCH_LEVEL=$( $DBCMD -e ' select max(patch_number) as num from patch_history' | grep -v num)
98
+ PATCH_LEVEL=$( $DBCMD $DBNAME -e ' select max(patch_number) as num from patch_history' | grep -v num)
100
99
101
100
if [ $? -gt 0 ]
102
101
then
@@ -118,13 +117,15 @@ MAX_PATCH_LEVEL=$(ls $PATCH_DIR/patch*.sql | egrep -o 'patch[0-9]*.sql' | egrep
118
117
if [ " $INITDB " ]
119
118
then
120
119
echo -n " Dropping and recreating DB before initialising it..."
121
- $( $DBCMD -e " drop database $DBNAME ; create database $DBNAME ;" )
120
+ echo $DBCMD ;
121
+ $( $DBCMD -e " drop database if exists $DBNAME ; create database $DBNAME ;" )
122
122
echo -n " Initialising DB..."
123
- $( $DBCMD < $PATCH_DIR /init_db.sql)
124
- $( $DBCMD < $PATCH_DIR /init_data.sql)
123
+ $( $DBCMD $DBNAME < $PATCH_DIR /init_db.sql)
124
+ $( $DBCMD $DBNAME < $PATCH_DIR /init_data.sql)
125
125
echo " Ok"
126
126
fi
127
127
128
+ DBCMD=" $DBCMD $DBNAME "
128
129
129
130
for (( i= $(($PATCH_LEVEL + 1 )) ; i < = $(( $MAX_PATCH_LEVEL )) ; i++));
130
131
do
Original file line number Diff line number Diff line change @@ -51,9 +51,9 @@ if (! defined('BASEPATH')) {
51
51
$active_group = "default";
52
52
$active_record = true;
53
53
54
- $db['default']['hostname'] = "localhost";
55
- $db['default']['username'] = "joind_in ";
56
- $db['default']['password'] = "pleasechangeme ";
54
+ $db['default']['hostname'] = getenv('MYSQL_HOST') ?: "localhost";
55
+ $db['default']['username'] = getenv('MYSQL_USER') ?: "joindin ";
56
+ $db['default']['password'] = getenv('MYSQL_PASSWORD') ?: "password ";
57
57
$db['default']['database'] = "joindin";
58
58
$db['default']['dbdriver'] = "mysql";
59
59
$db['default']['dbprefix'] = "";
Original file line number Diff line number Diff line change 6
6
if (!function_exists ('apache_request_headers ' )) {
7
7
include '../inc/nginx-helper.php ' ;
8
8
}
9
-
9
+ if (!ini_get ('date.timezone ' )) {
10
+ date_default_timezone_set ('UTC ' );
11
+ }
10
12
// Add exception handler
11
13
function handle_exception ($ e )
12
14
{
You can’t perform that action at this time.
0 commit comments