Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change PHP keywords to comply with PSR2 #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/apc-check.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
function file_get_contents_curl($url) {
$ch = curl_init();

curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1/apc-stats.php?apc=' . $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

$data = curl_exec($ch);
curl_close($ch);
Expand Down
2 changes: 1 addition & 1 deletion bin/opcache.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}

$configuration = opcache_get_configuration();
$status = opcache_get_status(FALSE);
$status = opcache_get_status(false);

switch($_GET['item']) {
// CONFIGURATION
Expand Down
30 changes: 15 additions & 15 deletions bin/ss_get_mysql_stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
$mysql_user = 'zabbix';
$mysql_pass = 'wJ44mR6a59r3duDr';
$mysql_port = 3306;
$mysql_ssl = FALSE; # Whether to use SSL to connect to MySQL.
$mysql_ssl = false; # Whether to use SSL to connect to MySQL.
$mysql_ssl_key = '/etc/pki/tls/certs/mysql/client-key.pem';
$mysql_ssl_cert = '/etc/pki/tls/certs/mysql/client-cert.pem';
$mysql_ssl_ca = '/etc/pki/tls/certs/mysql/ca-cert.pem';

$heartbeat = FALSE; # Whether to use pt-heartbeat table for repl. delay calculation.
$heartbeat_utc = FALSE; # Whether pt-heartbeat is run with --utc option.
$heartbeat = false; # Whether to use pt-heartbeat table for repl. delay calculation.
$heartbeat_utc = false; # Whether pt-heartbeat is run with --utc option.
$heartbeat_server_id = 0; # Server id to associate with a heartbeat. Leave 0 if no preference.
$heartbeat_table = 'percona.heartbeat'; # db.tbl.

Expand All @@ -51,9 +51,9 @@
'get_qrt' => true, # Get query response times from Percona Server or MariaDB?
);

$use_ss = FALSE; # Whether to use the script server or not
$debug = FALSE; # Define whether you want debugging behavior.
$debug_log = FALSE; # If $debug_log is a filename, it'll be used.
$use_ss = false; # Whether to use the script server or not
$debug = false; # Define whether you want debugging behavior.
$debug_log = false; # If $debug_log is a filename, it'll be used.

# ============================================================================
# You should not need to change anything below this line.
Expand Down Expand Up @@ -309,11 +309,11 @@ function ss_get_mysql_stats( $options ) {
}
if ( $mysql_ssl ) {
$conn = mysqli_init();
mysqli_ssl_set($conn, $mysql_ssl_key, $mysql_ssl_cert, $mysql_ssl_ca, NULL, NULL);
mysqli_real_connect($conn, $host, $user, $pass, NULL, $port);
mysqli_ssl_set($conn, $mysql_ssl_key, $mysql_ssl_cert, $mysql_ssl_ca, null, null);
mysqli_real_connect($conn, $host, $user, $pass, null, $port);
}
else {
$conn = mysqli_connect($host, $user, $pass, NULL, $port);
$conn = mysqli_connect($host, $user, $pass, null, $port);
}
if ( mysqli_connect_errno() ) {
debug("MySQL connection failed: " . mysqli_connect_error());
Expand Down Expand Up @@ -821,7 +821,7 @@ function ss_get_mysql_stats( $options ) {
}
$result = implode(' ', $output);
if ( $fp ) {
if ( fwrite($fp, $result) === FALSE ) {
if ( fwrite($fp, $result) === false ) {
die("Can't write '$cache_file'");
}
fclose($fp);
Expand Down Expand Up @@ -896,7 +896,7 @@ function get_innodb_array($text) {
'innodb_sem_waits' => null,
'innodb_sem_wait_time_ms' => null,
);
$txn_seen = FALSE;
$txn_seen = false;
foreach ( explode("\n", $text) as $line ) {
$line = trim($line);
$row = preg_split('/ +/', $line);
Expand All @@ -917,7 +917,7 @@ function get_innodb_array($text) {
$results['os_waits'][] = to_int($row[5]);
$results['os_waits'][] = to_int($row[11]);
}
elseif (strpos($line, 'RW-shared spins') === 0 && strpos($line, '; RW-excl spins') === FALSE) {
elseif (strpos($line, 'RW-shared spins') === 0 && strpos($line, '; RW-excl spins') === false) {
# Post 5.5.17 SHOW ENGINE INNODB STATUS syntax
# RW-shared spins 604733, rounds 8107431, OS waits 241268
$results['spin_waits'][] = to_int($row[2]);
Expand All @@ -944,7 +944,7 @@ function get_innodb_array($text) {
# Trx id counter 861B144C
$results['innodb_transactions'] = make_bigint(
$row[3], (isset($row[4]) ? $row[4] : null));
$txn_seen = TRUE;
$txn_seen = true;
}
elseif ( strpos($line, 'Purge done for trx') === 0 ) {
# Purge done for trx's n:o < 0 1170663853 undo n:o < 0 0
Expand Down Expand Up @@ -1364,12 +1364,12 @@ function debug($val) {
$calls[] = "at $file:$line";
}
fwrite($fp, date('Y-m-d H:i:s') . ' ' . implode(' <- ', $calls));
fwrite($fp, "\n" . var_export($val, TRUE) . "\n");
fwrite($fp, "\n" . var_export($val, true) . "\n");
fclose($fp);
}
else { # Disable logging
print("Warning: disabling debug logging to $debug_log\n");
$debug_log = FALSE;
$debug_log = false;
}
}