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
Issues
486
Issues
486
List
Boards
Labels
Service Desk
Milestones
Merge Requests
23
Merge Requests
23
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ISPConfig
ISPConfig 3
Commits
1c365f0c
Commit
1c365f0c
authored
Oct 18, 2018
by
Till Brehm
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'stable-3.1' into 'stable-3.1'
fix getDatabaseSize() See merge request
ispconfig/ispconfig3!829
parents
6d28d421
8c4359bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
14 deletions
+36
-14
interface/lib/classes/db_mysql.inc.php
interface/lib/classes/db_mysql.inc.php
+18
-7
server/lib/classes/db_mysql.inc.php
server/lib/classes/db_mysql.inc.php
+18
-7
No files found.
interface/lib/classes/db_mysql.inc.php
View file @
1c365f0c
...
...
@@ -654,18 +654,29 @@ class db
* @return int - database-size in bytes
*/
public
function
getDatabaseSize
(
$database_name
)
{
global
$app
;
require_once
'lib/mysql_clientdb.conf'
;
$result
=
$this
->
_query
(
"SELECT SUM(data_length+index_length) FROM information_schema.TABLES WHERE table_schema='"
.
$this
->
escape
(
$database_name
)
.
"'"
);
global
$app
,
$conf
;
static
$db
=
null
;
if
(
!
$db
)
{
$clientdb_host
=
(
$conf
[
'db_host'
])
?
$conf
[
'db_host'
]
:
NULL
;
$clientdb_user
=
(
$conf
[
'db_user'
])
?
$conf
[
'db_user'
]
:
NULL
;
$clientdb_password
=
(
$conf
[
'db_password'
])
?
$conf
[
'db_password'
]
:
NULL
;
$clientdb_port
=
((
int
)
$conf
[
'db_port'
])
?
(
int
)
$conf
[
'db_port'
]
:
NULL
;
$clientdb_flags
=
(
$conf
[
'db_flags'
]
!==
NULL
)
?
$conf
[
'db_flags'
]
:
NULL
;
require_once
'lib/mysql_clientdb.conf'
;
$db
=
new
db
(
$clientdb_host
,
$clientdb_user
,
$clientdb_password
,
NULL
,
$clientdb_port
,
$clientdb_flags
);
}
$result
=
$db
->
_query
(
"SELECT SUM(data_length+index_length) FROM information_schema.TABLES WHERE table_schema='"
.
$db
->
escape
(
$database_name
)
.
"'"
);
if
(
!
$result
)
{
$
this
->
_sqlerror
(
'Unable to determine the size of database '
.
$database_name
);
$
db
->
_sqlerror
(
'Unable to determine the size of database '
.
$database_name
);
return
;
}
$database_size
=
$result
->
getAsRow
();
$result
->
free
();
return
$database_size
[
0
]
?
$database_size
[
0
]
:
0
;
return
$database_size
[
0
]
?
$database_size
[
0
]
:
0
;
}
//** Function to fill the datalog with a full differential record.
...
...
server/lib/classes/db_mysql.inc.php
View file @
1c365f0c
...
...
@@ -654,18 +654,29 @@ class db
* @return int - database-size in bytes
*/
public
function
getDatabaseSize
(
$database_name
)
{
global
$app
;
require_once
'lib/mysql_clientdb.conf'
;
$result
=
$this
->
_query
(
"SELECT SUM(data_length+index_length) FROM information_schema.TABLES WHERE table_schema='"
.
$this
->
escape
(
$database_name
)
.
"'"
);
global
$app
,
$conf
;
static
$db
=
null
;
if
(
!
$db
)
{
$clientdb_host
=
(
$conf
[
'db_host'
])
?
$conf
[
'db_host'
]
:
NULL
;
$clientdb_user
=
(
$conf
[
'db_user'
])
?
$conf
[
'db_user'
]
:
NULL
;
$clientdb_password
=
(
$conf
[
'db_password'
])
?
$conf
[
'db_password'
]
:
NULL
;
$clientdb_port
=
((
int
)
$conf
[
'db_port'
])
?
(
int
)
$conf
[
'db_port'
]
:
NULL
;
$clientdb_flags
=
(
$conf
[
'db_flags'
]
!==
NULL
)
?
$conf
[
'db_flags'
]
:
NULL
;
require_once
'lib/mysql_clientdb.conf'
;
$db
=
new
db
(
$clientdb_host
,
$clientdb_user
,
$clientdb_password
,
NULL
,
$clientdb_port
,
$clientdb_flags
);
}
$result
=
$db
->
_query
(
"SELECT SUM(data_length+index_length) FROM information_schema.TABLES WHERE table_schema='"
.
$db
->
escape
(
$database_name
)
.
"'"
);
if
(
!
$result
)
{
$
this
->
_sqlerror
(
'Unable to determine the size of database '
.
$database_name
);
$
db
->
_sqlerror
(
'Unable to determine the size of database '
.
$database_name
);
return
;
}
$database_size
=
$result
->
getAsRow
();
$result
->
free
();
return
$database_size
[
0
]
?
$database_size
[
0
]
:
0
;
return
$database_size
[
0
]
?
$database_size
[
0
]
:
0
;
}
//** Function to fill the datalog with a full differential record.
...
...
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