Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ISPConfig 3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Zvonimir
ISPConfig 3
Commits
0ccfef02
Commit
0ccfef02
authored
Apr 25, 2014
by
Till Brehm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added silent sql update option in updater.
parent
f3cc7cd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
install/lib/update.lib.php
install/lib/update.lib.php
+9
-2
No files found.
install/lib/update.lib.php
View file @
0ccfef02
...
...
@@ -164,6 +164,9 @@ function updateDbAndIni() {
$next_db_version
=
intval
(
$current_db_version
+
1
);
$sql_patch_filename
=
realpath
(
dirname
(
__FILE__
)
.
'/../'
)
.
'/sql/incremental/upd_'
.
str_pad
(
$next_db_version
,
4
,
'0'
,
STR_PAD_LEFT
)
.
'.sql'
;
$php_patch_filename
=
realpath
(
dirname
(
__FILE__
)
.
'/../'
)
.
'/patches/upd_'
.
str_pad
(
$next_db_version
,
4
,
'0'
,
STR_PAD_LEFT
)
.
'.php'
;
// comma separated list of version numbers were a update has to be done silently
$silent_update_versions
=
'75'
;
if
(
is_file
(
$sql_patch_filename
))
{
...
...
@@ -186,10 +189,14 @@ function updateDbAndIni() {
//* Load patch file into database
if
(
!
empty
(
$conf
[
"mysql"
][
"admin_password"
])
)
{
system
(
"mysql --default-character-set="
.
escapeshellarg
(
$conf
[
'mysql'
][
'charset'
])
.
" --force -h "
.
escapeshellarg
(
$conf
[
'mysql'
][
'host'
])
.
" -u "
.
escapeshellarg
(
$conf
[
'mysql'
][
'admin_user'
])
.
" -p"
.
escapeshellarg
(
$conf
[
'mysql'
][
'admin_password'
])
.
" "
.
escapeshellarg
(
$conf
[
'mysql'
][
'database'
])
.
" < "
.
$sql_patch_filename
)
;
$cmd
=
"mysql --default-character-set="
.
escapeshellarg
(
$conf
[
'mysql'
][
'charset'
])
.
" --force -h "
.
escapeshellarg
(
$conf
[
'mysql'
][
'host'
])
.
" -u "
.
escapeshellarg
(
$conf
[
'mysql'
][
'admin_user'
])
.
" -p"
.
escapeshellarg
(
$conf
[
'mysql'
][
'admin_password'
])
.
" "
.
escapeshellarg
(
$conf
[
'mysql'
][
'database'
])
.
" < "
.
$sql_patch_filename
;
}
else
{
system
(
"mysql --default-character-set="
.
escapeshellarg
(
$conf
[
'mysql'
][
'charset'
])
.
" --force -h "
.
escapeshellarg
(
$conf
[
'mysql'
][
'host'
])
.
" -u "
.
escapeshellarg
(
$conf
[
'mysql'
][
'admin_user'
])
.
" "
.
escapeshellarg
(
$conf
[
'mysql'
][
'database'
])
.
" < "
.
$sql_patch_filename
)
;
$cmd
=
"mysql --default-character-set="
.
escapeshellarg
(
$conf
[
'mysql'
][
'charset'
])
.
" --force -h "
.
escapeshellarg
(
$conf
[
'mysql'
][
'host'
])
.
" -u "
.
escapeshellarg
(
$conf
[
'mysql'
][
'admin_user'
])
.
" "
.
escapeshellarg
(
$conf
[
'mysql'
][
'database'
])
.
" < "
.
$sql_patch_filename
;
}
if
(
in_array
(
$next_db_version
,
explode
(
','
,
$silent_update_versions
)))
$cmd
.
=
' > /dev/null 2> /dev/null'
;
system
(
$cmd
);
swriteln
(
$inst
->
lng
(
'Loading SQL patch file'
)
.
': '
.
$sql_patch_filename
);
//* Exec onAfterSQL function
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment