Skip to content

Commit

Permalink
Update check system
Browse files Browse the repository at this point in the history
  • Loading branch information
HungNA - Technical Manager committed Aug 20, 2024
1 parent d685deb commit 2bd8c15
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/CheckSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public function checkPhpVersion()
$minVersion = $this->phpMinVersion;
$operator = '>=';

$message_pattern = 'Current PHP Version: {{current_version}} - Suggest PHP Version {{operator}} {{min_version}}';
$message = 'Current PHP Version: ' . PHP_VERSION . ' - Suggest PHP Version ' . $operator . ' ' . $minVersion;

if (version_compare(PHP_VERSION, $minVersion, $operator)) {
Expand All @@ -95,7 +96,11 @@ public function checkPhpVersion()
return array(
'code' => $code,
'message' => $message,
'message_pattern' => $message_pattern,
'status' => $status,
'current_version' => PHP_VERSION,
'min_version' => $minVersion,
'operator' => $operator,
);
}

Expand Down Expand Up @@ -134,12 +139,16 @@ public function connectUsePhpTelnet($hostname = '', $port = '')
$code = false;
}
$result = array(
'hostname' => $hostname,
'port' => $port,
'code' => $code,
'message' => $message,
'status' => $code === true ? 'OK' : 'NOK'
);
} catch (Exception $exception) {
$result = array(
'hostname' => $hostname,
'port' => $port,
'code' => false,
'message' => $message,
'status' => 'NOK',
Expand Down

0 comments on commit 2bd8c15

Please sign in to comment.