diff --git a/.devilbox/www/htdocs/_ajax_callback.php b/.devilbox/www/htdocs/_ajax_callback.php index fc9c3304..3e17387e 100644 --- a/.devilbox/www/htdocs/_ajax_callback.php +++ b/.devilbox/www/htdocs/_ajax_callback.php @@ -3,12 +3,17 @@ require '../config.php'; if (loadClass('Helper')->isLoggedIn()) { + // + // ?database= + // if (isset($_GET['database'])) { + // &type=mysql 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']) )); + // &type=postgres } else if (isset($_GET['type']) && $_GET['type'] == 'postgres') { $schema = isset($_GET['schema']) ? $_GET['schema'] : ''; echo json_encode(array( @@ -16,12 +21,93 @@ if (loadClass('Helper')->isLoggedIn()) { 'table' => (string)loadClass('Pgsql')->getTableCount($_GET['database'], $schema) )); } - } else if (isset($_GET['vhost'])) { - echo loadClass('Httpd')->checkVirtualHost($_GET['vhost']); - } else { - loadClass('Helper')->redirect('/'); } -} else { + // + // ?vhost= + // + else if (isset($_GET['vhost'])) { + echo loadClass('Httpd')->checkVirtualHost($_GET['vhost']); + } + + + // + // ?software= + // + else if (isset($_GET['software'])) { + $no = 'not installed'; + $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 + )); + } + else if ($_GET['software'] == 'drush') { + echo json_encode(array( + $_GET['software'] => (($version = loadClass('Php')->getDrushVersion()) !== false) ? $version : $no + )); + } + 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( + $_GET['software'] => (($version = loadClass('Php')->getPhalconVersion()) !== false) ? $version : $no + )); + } + else if ($_GET['software'] == 'wpcli') { + echo json_encode(array( + $_GET['software'] => (($version = loadClass('Php')->getSymfonyVersion()) !== false) ? $version : $no + )); + } else { + echo json_encode(array($_GET['software'] => 'unknown software')); + } + } + + // + // WRONG REQUEST + // + else { + loadClass('Helper')->redirect('/'); + } +} + +// +// Not logged in +// +else { loadClass('Helper')->redirect('/'); } diff --git a/.devilbox/www/htdocs/index.php b/.devilbox/www/htdocs/index.php index 11fc9d14..87ed2836 100644 --- a/.devilbox/www/htdocs/index.php +++ b/.devilbox/www/htdocs/index.php @@ -30,6 +30,7 @@ $connection = array(); $error = null; // ---- HTTPD (required) ---- + $host = $GLOBALS['HTTPD_HOST_NAME']; $succ = loadClass('Httpd')->canConnect($error, $host); $connection['Httpd'][$host] = array( @@ -51,7 +52,6 @@ $connection['Httpd'][$host] = array( 'host' => $host, 'succ' => $succ ); - // ---- MYSQL ---- if ($avail_mysql) { $host = $GLOBALS['MYSQL_HOST_NAME']; @@ -127,6 +127,7 @@ if ($avail_redis) { ); } + // ---- MEMCACHED ---- if ($avail_memcd) { $host = $GLOBALS['MEMCD_HOST_NAME']; @@ -417,47 +418,47 @@ $HEALTH_PERCENT = 100 - ceil(100 * $HEALTH_FAILS / $HEALTH_TOTAL);