diff --git a/.devilbox/www/htdocs/index.php b/.devilbox/www/htdocs/index.php index 9bbf8c19..f97a5871 100644 --- a/.devilbox/www/htdocs/index.php +++ b/.devilbox/www/htdocs/index.php @@ -12,6 +12,7 @@ * Load required files *************************************************************/ loadFile('Php'); +loadFile('Dns'); loadFile('Httpd'); loadFile('Mysql'); loadFile('Pgsql'); @@ -23,6 +24,7 @@ loadFile('Memcd'); * Get availability *************************************************************/ $avail_php = \devilbox\Php::isAvailable($GLOBALS['PHP_HOST_NAME']); +$avail_dns = \devilbox\Dns::isAvailable($GLOBALS['DNS_HOST_NAME']); $avail_httpd = \devilbox\Httpd::isAvailable($GLOBALS['HTTPD_HOST_NAME']); $avail_mysql = \devilbox\Mysql::isAvailable($GLOBALS['MYSQL_HOST_NAME']); $avail_pgsql = \devilbox\Pgsql::isAvailable($GLOBALS['PGSQL_HOST_NAME']); @@ -30,7 +32,6 @@ $avail_redis = \devilbox\Redis::isAvailable($GLOBALS['REDIS_HOST_NAME']); $avail_memcd = \devilbox\Memcd::isAvailable($GLOBALS['MEMCD_HOST_NAME']); - /************************************************************* * Test Connectivity *************************************************************/ @@ -161,6 +162,23 @@ if ($avail_memcd) { ); } +// ---- BIND ---- +if ($avail_dns) { + $host = $GLOBALS['DNS_HOST_NAME']; + $succ = \devilbox\Dns::testConnection($error, $host); + $connection['Bind'][$host] = array( + 'error' => $error, + 'host' => $host, + 'succ' => $succ + ); + $host = \devilbox\Dns::getIpAddress($GLOBALS['DNS_HOST_NAME']); + $succ = \devilbox\Dns::testConnection($error, $host); + $connection['Bind'][$host] = array( + 'error' => $error, + 'host' => $host, + 'succ' => $succ + ); +} /************************************************************* * Test Health @@ -195,6 +213,12 @@ $HEALTH_PERCENT = 100 - ceil(100 * $HEALTH_FAILS / $HEALTH_TOTAL); function getCirle($name) { switch ($name) { + case 'dns': + $class = 'bg-info'; + $version = loadClass('Dns')->getVersion(); + $available = $GLOBALS['avail_'.$name]; + $name = loadClass('Dns')->getName(); + break; case 'php': $class = 'bg-info'; $version = loadClass('Php')->getVersion(); @@ -207,12 +231,6 @@ function getCirle($name) { $available = $GLOBALS['avail_'.$name]; $name = loadClass('Httpd')->getName(); break; - case 'httpd': - $class = 'bg-info'; - $version = loadClass('Httpd')->getVersion(); - $available = $GLOBALS['avail_'.$name]; - $name = loadClass('Httpd')->getName(); - break; case 'mysql': $class = 'bg-warning'; $version = loadClass('Mysql')->getVersion(); @@ -328,15 +346,15 @@ function getCirle($name) {
Base Stack
+
+ +
-
- -
@@ -390,6 +408,7 @@ function getCirle($name) {
PHP Container Setup
+

You can also enter the php container and work from inside. The following is available inside the container:

@@ -410,23 +429,45 @@ function getCirle($name) { - + - + - + - + - +
Settings
DNSEnabledEnabledOffline
PostfixEnabledgetEnv('ENABLE_MAIL') ? 'Enabled' : 'No Disabled';?>
XdebugEnabled + getEnv('PHP_XDEBUG_ENABLE') == 0) ? '' : $Docker->getEnv('PHP_XDEBUG_ENABLE'); ?> + PHP_config('xdebug.remote_enable')): ?> + PHP_config('xdebug.remote_enable') == 1 ? 'Yes' : 'No'; ?> + + not installed.env file setting differs from custom php .ini file
'; ?> + PHP_config('xdebug.remote_enable'); ?> + +
Xdebug Remote192.168.0.215 + getEnv('PHP_XDEBUG_REMOTE_HOST') == $Docker->PHP_config('xdebug.remote_host')): ?> + PHP_config('xdebug.remote_host'); ?> + + not installed.env file setting differs from custom php .ini file
'; ?> + PHP_config('xdebug.remote_host'); ?> + +
Xdebug Port9000 + getEnv('PHP_XDEBUG_REMOTE_PORT') == $Docker->PHP_config('xdebug.remote_port')): ?> + PHP_config('xdebug.remote_port'); ?> + + not installed.env file setting differs from custom php .ini file
'; ?> + PHP_config('xdebug.remote_port'); ?> + +
@@ -484,7 +525,7 @@ function getCirle($name) { $docker): ?> - connect + connect @@ -575,6 +616,13 @@ function getCirle($name) { + + + bind + + + +
@@ -636,6 +684,16 @@ function getCirle($name) { 11211 + + + bind + + getEnv('LOCAL_LISTEN_ADDR').loadClass('Docker')->getEnv('HOST_PORT_BIND');?>/tcp
+ getEnv('LOCAL_LISTEN_ADDR').loadClass('Docker')->getEnv('HOST_PORT_BIND');?>/udp + + 53/tcp
53/udp + + @@ -739,6 +797,13 @@ function getCirle($name) { - + + + bind + - + - + + @@ -800,6 +865,13 @@ function getCirle($name) { - + + + bind + - + - + + @@ -861,6 +933,13 @@ function getCirle($name) { /var/log/memcached + + + bind + - + - + + diff --git a/.devilbox/www/include/lib/Dns.php b/.devilbox/www/include/lib/Dns.php new file mode 100644 index 00000000..a51969d7 --- /dev/null +++ b/.devilbox/www/include/lib/Dns.php @@ -0,0 +1,127 @@ +egrep('/"[0-9.-]+.*"/', isset($output[0]) ? $output[0] : ''); + $version = $this->egrep('/[0-9.-]+/', $version); + $version = $version ? $version : ''; + return $version; + } +} diff --git a/.devilbox/www/include/lib/Httpd.php b/.devilbox/www/include/lib/Httpd.php index fbae1c82..3888e778 100644 --- a/.devilbox/www/include/lib/Httpd.php +++ b/.devilbox/www/include/lib/Httpd.php @@ -58,8 +58,6 @@ class Httpd extends _Base implements _iBase $err = false; // Silence errors and try to connect - //error_reporting(0); - $url = 'http://'.$host.'/not-existing-page-which-returns-404.php'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_NOBODY, true); @@ -67,7 +65,6 @@ class Httpd extends _Base implements _iBase curl_exec($ch); $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); - error_reporting(-1); if ($http_code == 0) { $err = 'Failed to connect to Httpd host on '.$host; diff --git a/.devilbox/www/include/lib/Memcd.php b/.devilbox/www/include/lib/Memcd.php index 00fa7298..1ce602ce 100644 --- a/.devilbox/www/include/lib/Memcd.php +++ b/.devilbox/www/include/lib/Memcd.php @@ -118,16 +118,18 @@ class Memcd extends _Base implements _iBase $memcd = new \Memcached('_devilbox'); $list = $memcd->getServerList(); +// if (!empty($list)) { +// $memcd->resetServerList(); +// } if (empty($list)) { - //$memcd->setOption(\Memcached::OPT_RECV_TIMEOUT, 1000); - //$memcd->setOption(\Memcached::OPT_SEND_TIMEOUT, 1000); + //$memcd->setOption(\Memcached::OPT_RECV_TIMEOUT, 100); + //$memcd->setOption(\Memcached::OPT_SEND_TIMEOUT, 100); $memcd->setOption(\Memcached::OPT_LIBKETAMA_COMPATIBLE, true); $memcd->setOption(\Memcached::OPT_BINARY_PROTOCOL, false); //$memcd->setOption(\Memcached::OPT_SERVER_FAILURE_LIMIT, 50); - //$memcd->setOption(\Memcached::OPT_CONNECT_TIMEOUT, 500); - //$memcd->setOption(\Memcached::OPT_RETRY_TIMEOUT, 300); + //$memcd->setOption(\Memcached::OPT_CONNECT_TIMEOUT, 100); + //$memcd->setOption(\Memcached::OPT_RETRY_TIMEOUT, 100); //$memcd->setOption(\Memcached::OPT_REMOVE_FAILED_SERVERS, true); - $memcd->addServer($host, 11211); } @@ -137,16 +139,16 @@ class Memcd extends _Base implements _iBase $memcd->quit(); $err = 'Failed to connect to Memcached host on '.$host; } - if (!isset($stats[$host.':11211']['pid'])) { + else if (!isset($stats[$host.':11211']['pid'])) { $memcd->quit(); $err = 'Failed to connect to Memcached host on '.$host; } - if ($stats[$host.':11211']['pid'] < 1) { + else if ($stats[$host.':11211']['pid'] < 1) { $memcd->quit(); $err = 'Failed to connect to Memcached host on '.$host; } - if ($err === false) { + else if ($err === false) { $memcd->set('devilbox-version', $GLOBALS['DEVILBOX_VERSION'].' ('.$GLOBALS['DEVILBOX_DATE'].')'); $this->_memcached = $memcd; } else { diff --git a/.devilbox/www/include/lib/_Base.php b/.devilbox/www/include/lib/_Base.php index b0d66227..c4381fe7 100644 --- a/.devilbox/www/include/lib/_Base.php +++ b/.devilbox/www/include/lib/_Base.php @@ -21,7 +21,7 @@ class _Base public static function isAvailable($hostname) { if (!isset(self::$_available[$hostname])) { - $ip = gethostbyname($hostname); + $ip = self::getIpAddress($hostname); self::$_available[$hostname] = ($ip == $hostname) ? false : true; } return self::$_available[$hostname];