diff options
author | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2022-03-05 09:58:15 +0300 |
---|---|---|
committer | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2022-03-07 23:31:11 +0300 |
commit | 1438cb211ea4b9660c609842ccebe68fb0c0e3a7 (patch) | |
tree | ac7776bd2b13d9df71e12b160c0d133e84aecc64 /libraries/classes/Engines | |
parent | 0339dc09049310d2a99f7a32e221a936f0a04b13 (diff) |
Replace `global` keyword with `$GLOBALS`
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
Diffstat (limited to 'libraries/classes/Engines')
-rw-r--r-- | libraries/classes/Engines/Innodb.php | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/libraries/classes/Engines/Innodb.php b/libraries/classes/Engines/Innodb.php index 716bfae3a3..51626e7ecc 100644 --- a/libraries/classes/Engines/Innodb.php +++ b/libraries/classes/Engines/Innodb.php @@ -117,15 +117,13 @@ class Innodb extends StorageEngine */ public function getPageBufferpool() { - global $dbi; - // The following query is only possible because we know // that we are on MySQL 5 here (checked above)! // side note: I love MySQL 5 for this. :-) $sql = 'SHOW STATUS' . ' WHERE Variable_name LIKE \'Innodb\\_buffer\\_pool\\_%\'' . ' OR Variable_name = \'Innodb_page_size\';'; - $status = $dbi->fetchResult($sql, 0, 1); + $status = $GLOBALS['dbi']->fetchResult($sql, 0, 1); /** @var string[] $bytes */ $bytes = Util::formatByteDown($status['Innodb_buffer_pool_pages_total'] * $status['Innodb_page_size']); @@ -261,10 +259,8 @@ class Innodb extends StorageEngine */ public function getPageStatus() { - global $dbi; - return '<pre id="pre_innodb_status">' . "\n" - . htmlspecialchars((string) $dbi->fetchValue( + . htmlspecialchars((string) $GLOBALS['dbi']->fetchValue( 'SHOW ENGINE INNODB STATUS;', 'Status' )) . "\n" . '</pre>' . "\n"; @@ -288,9 +284,7 @@ class Innodb extends StorageEngine */ public function getInnodbPluginVersion() { - global $dbi; - - return $dbi->fetchValue('SELECT @@innodb_version;') ?: ''; + return $GLOBALS['dbi']->fetchValue('SELECT @@innodb_version;') ?: ''; } /** @@ -302,9 +296,7 @@ class Innodb extends StorageEngine */ public function getInnodbFileFormat(): ?string { - global $dbi; - - $value = $dbi->fetchValue("SHOW GLOBAL VARIABLES LIKE 'innodb_file_format';", 1); + $value = $GLOBALS['dbi']->fetchValue("SHOW GLOBAL VARIABLES LIKE 'innodb_file_format';", 1); if ($value === false) { // This variable does not exist anymore on MariaDB >= 10.6.0 @@ -322,8 +314,6 @@ class Innodb extends StorageEngine */ public function supportsFilePerTable(): bool { - global $dbi; - - return $dbi->fetchValue("SHOW GLOBAL VARIABLES LIKE 'innodb_file_per_table';", 1) === 'ON'; + return $GLOBALS['dbi']->fetchValue("SHOW GLOBAL VARIABLES LIKE 'innodb_file_per_table';", 1) === 'ON'; } } |