Ensure Adminer and phpMyAdmin work with old PHP versions

This commit is contained in:
cytopia 2018-12-16 00:29:50 +01:00
parent 60b2d99c09
commit a459597759
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
2 changed files with 1939 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -86,7 +86,7 @@ class Html
'menu' => array(
array(
'name' => 'Adminer',
'path' => '/vendor/adminer-4.7.0-en.php',
'path' => '__ADMINER__',
'target' => '_blank'
),
array(
@ -383,7 +383,10 @@ HTML;
// Replace
if ($el['path'] == '__PHPMYADMIN__') {
$el['path'] = (strpos(loadClass('Php')->getVersion(), '5.4') !== false) ? '/vendor/phpmyadmin-4.0/index.php' : '/vendor/phpmyadmin-4.8/index.php';
$el['path'] = (version_compare(loadClass('Php')->getVersion(), '5.4', '<=')) ? '/vendor/phpmyadmin-4.0/index.php' : '/vendor/phpmyadmin-4.8/index.php';
}
if ($el['path'] == '__ADMINER__') {
$el['path'] = (version_compare(loadClass('Php')->getVersion(), '5.3', '<=')) ? '/vendor/adminer-4.6.3-en.php' : '/vendor/adminer-4.7.0-en.php';
}
$target = isset($el['target']) ? 'target="'.$el['target'].'"' : '';