2016-11-15 18:39:11 +00:00
|
|
|
<?php
|
|
|
|
require '../config.php';
|
|
|
|
|
2017-09-09 08:40:07 +00:00
|
|
|
if (loadClass('Helper')->isLoggedIn()) {
|
|
|
|
|
2017-10-02 10:42:29 +00:00
|
|
|
//
|
|
|
|
// ?database=
|
|
|
|
//
|
2017-09-09 08:40:07 +00:00
|
|
|
if (isset($_GET['database'])) {
|
2017-10-02 10:42:29 +00:00
|
|
|
// &type=mysql
|
2017-09-09 08:40:07 +00:00
|
|
|
if (isset($_GET['type']) && $_GET['type'] == 'mysql') {
|
|
|
|
echo json_encode(array(
|
|
|
|
'size' => (string)loadClass('Mysql')->getDBSize($_GET['database']),
|
|
|
|
'table' => (string)loadClass('Mysql')->getTableCount($_GET['database'])
|
|
|
|
));
|
2017-10-02 10:42:29 +00:00
|
|
|
// &type=postgres
|
2017-09-09 08:40:07 +00:00
|
|
|
} else if (isset($_GET['type']) && $_GET['type'] == 'postgres') {
|
|
|
|
$schema = isset($_GET['schema']) ? $_GET['schema'] : '';
|
|
|
|
echo json_encode(array(
|
|
|
|
'size' => (string)loadClass('Pgsql')->getSchemaSize($_GET['database'], $schema),
|
|
|
|
'table' => (string)loadClass('Pgsql')->getTableCount($_GET['database'], $schema)
|
|
|
|
));
|
|
|
|
}
|
2017-10-02 10:42:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// ?vhost=
|
|
|
|
//
|
|
|
|
else if (isset($_GET['vhost'])) {
|
2017-09-09 08:40:07 +00:00
|
|
|
echo loadClass('Httpd')->checkVirtualHost($_GET['vhost']);
|
2017-10-02 10:42:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// ?software=
|
|
|
|
//
|
|
|
|
else if (isset($_GET['software'])) {
|
|
|
|
$no = '<span class="text-danger">not installed</span>';
|
|
|
|
$software = array();
|
|
|
|
|
|
|
|
if ($_GET['software'] == 'composer') {
|
|
|
|
echo json_encode(array(
|
|
|
|
$_GET['software'] => (($version = loadClass('Php')->getComposerVersion()) !== false) ? $version : $no
|
|
|
|
));
|
|
|
|
}
|
|
|
|
else if ($_GET['software'] == 'drupalc') {
|
|
|
|
echo json_encode(array(
|
|
|
|
$_GET['software'] => (($version = loadClass('Php')->getDrupalConsoleVersion()) !== false) ? $version : $no
|
|
|
|
));
|
|
|
|
}
|
2018-11-01 09:19:43 +00:00
|
|
|
else if ($_GET['software'] == 'drush7') {
|
2017-10-02 10:42:29 +00:00
|
|
|
echo json_encode(array(
|
2018-11-01 09:19:43 +00:00
|
|
|
$_GET['software'] => (($version = loadClass('Php')->getDrushVersion(7)) !== false) ? $version : $no
|
|
|
|
));
|
|
|
|
}
|
|
|
|
else if ($_GET['software'] == 'drush8') {
|
|
|
|
echo json_encode(array(
|
|
|
|
$_GET['software'] => (($version = loadClass('Php')->getDrushVersion(8)) !== false) ? $version : $no
|
|
|
|
));
|
|
|
|
}
|
|
|
|
else if ($_GET['software'] == 'drush9') {
|
|
|
|
echo json_encode(array(
|
|
|
|
$_GET['software'] => (($version = loadClass('Php')->getDrushVersion(9)) !== false) ? $version : $no
|
2017-10-02 10:42:29 +00:00
|
|
|
));
|
|
|
|
}
|
|
|
|
else if ($_GET['software'] == 'git') {
|
|
|
|
echo json_encode(array(
|
|
|
|
$_GET['software'] => (($version = loadClass('Php')->getGitVersion()) !== false) ? $version : $no
|
|
|
|
));
|
|
|
|
}
|
|
|
|
else if ($_GET['software'] == 'laravel') {
|
|
|
|
echo json_encode(array(
|
|
|
|
$_GET['software'] => (($version = loadClass('Php')->getLaravelVersion()) !== false) ? $version : $no
|
|
|
|
));
|
|
|
|
}
|
|
|
|
else if ($_GET['software'] == 'mds') {
|
|
|
|
echo json_encode(array(
|
|
|
|
$_GET['software'] => (($version = loadClass('Php')->getMdsVersion()) !== false) ? $version : $no
|
|
|
|
));
|
|
|
|
}
|
|
|
|
else if ($_GET['software'] == 'node') {
|
|
|
|
echo json_encode(array(
|
|
|
|
$_GET['software'] => (($version = loadClass('Php')->getNodeVersion()) !== false) ? $version : $no
|
|
|
|
));
|
|
|
|
}
|
|
|
|
else if ($_GET['software'] == 'npm') {
|
|
|
|
echo json_encode(array(
|
|
|
|
$_GET['software'] => (($version = loadClass('Php')->getNpmVersion()) !== false) ? $version : $no
|
|
|
|
));
|
|
|
|
}
|
|
|
|
else if ($_GET['software'] == 'phalcon') {
|
|
|
|
echo json_encode(array(
|
|
|
|
$_GET['software'] => (($version = loadClass('Php')->getPhalconVersion()) !== false) ? $version : $no
|
|
|
|
));
|
|
|
|
}
|
|
|
|
else if ($_GET['software'] == 'symfony') {
|
|
|
|
echo json_encode(array(
|
2017-10-02 11:00:48 +00:00
|
|
|
$_GET['software'] => (($version = loadClass('Php')->getSymfonyVersion()) !== false) ? $version : $no
|
2017-10-02 10:42:29 +00:00
|
|
|
));
|
|
|
|
}
|
|
|
|
else if ($_GET['software'] == 'wpcli') {
|
|
|
|
echo json_encode(array(
|
2017-10-02 11:00:48 +00:00
|
|
|
$_GET['software'] => (($version = loadClass('Php')->getWpcliVersion()) !== false) ? $version : $no
|
2017-10-02 10:42:29 +00:00
|
|
|
));
|
|
|
|
} else {
|
|
|
|
echo json_encode(array($_GET['software'] => 'unknown software'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// WRONG REQUEST
|
|
|
|
//
|
|
|
|
else {
|
2017-09-09 08:40:07 +00:00
|
|
|
loadClass('Helper')->redirect('/');
|
2016-11-15 18:39:11 +00:00
|
|
|
}
|
2017-10-02 10:42:29 +00:00
|
|
|
}
|
2017-09-09 08:40:07 +00:00
|
|
|
|
2017-10-02 10:42:29 +00:00
|
|
|
//
|
|
|
|
// Not logged in
|
|
|
|
//
|
|
|
|
else {
|
2017-09-09 08:40:07 +00:00
|
|
|
loadClass('Helper')->redirect('/');
|
2016-11-15 18:39:11 +00:00
|
|
|
}
|