mirror of https://github.com/MISP/MISP
new: Added a php version check to teh diagnostics page
parent
a86730e4a6
commit
80b6bca48f
|
@ -46,6 +46,9 @@ class AppController extends Controller {
|
|||
public $helpers = array('Utility');
|
||||
|
||||
private $__jsVersion = '2.4.48';
|
||||
|
||||
public $phpmin = '5.5.9';
|
||||
public $phprec = '5.6.0';
|
||||
|
||||
// Used for _isAutomation(), a check that returns true if the controller & action combo matches an action that is a non-xml and non-json automation method
|
||||
// This is used to allow authentication via headers for methods not covered by _isRest() - as that only checks for JSON and XML formats
|
||||
|
|
|
@ -690,7 +690,7 @@ class ServersController extends AppController {
|
|||
)
|
||||
|
||||
);
|
||||
|
||||
|
||||
foreach ($phpSettings as $setting => &$settingArray) {
|
||||
$settingArray['value'] = ini_get($setting);
|
||||
if ($settingArray['unit']) $settingArray['value'] = intval(rtrim($settingArray['value'], $settingArray['unit']));
|
||||
|
@ -752,6 +752,9 @@ class ServersController extends AppController {
|
|||
$this->set('workerIssueCount', $workerIssueCount);
|
||||
$priorityErrorColours = array(0 => 'red', 1 => 'yellow', 2 => 'green');
|
||||
$this->set('priorityErrorColours', $priorityErrorColours);
|
||||
$this->set('phpversion', phpversion());
|
||||
$this->set('phpmin', $this->phpmin);
|
||||
$this->set('phprec', $this->phprec);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -76,6 +76,19 @@
|
|||
?>
|
||||
</div>
|
||||
<h3>PHP Settings</h3>
|
||||
<?php
|
||||
$phpcolour = 'green';
|
||||
$phptext = 'Up to date';
|
||||
if (version_compare($phpversion, $phprec) < 1) {
|
||||
$phpcolour = 'orange';
|
||||
$phptext = 'Update highly recommended';
|
||||
if (version_compare($phpversion, $phpmin) < 1) {
|
||||
$phpcolour = 'red';
|
||||
$phptext = 'Version unsupported, update ASAP';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<p><span class="bold">PHP Version (<?php echo $phprec; ?> recommended): </span><span class="<?php echo $phpcolour; ?>"><?php echo h($phpversion) . ' (' . $phptext . ')';?></span></p>
|
||||
<p>The following settings might have a negative impact on certain functionalities of MISP with their current and recommended minimum settings. You can adjust these in your php.ini. Keep in mind that the recommendations are not requirements, just recommendations. Depending on usage you might want to go beyond the recommended values.</p>
|
||||
<?php
|
||||
foreach ($phpSettings as $settingName => &$phpSetting):
|
||||
|
|
Loading…
Reference in New Issue