devilbox/.devilbox/www/htdocs/index.php

360 lines
9.6 KiB
PHP
Raw Normal View History

2016-10-22 15:38:21 +00:00
<?php $CONNECT = TRUE; require '../config.php'; ?>
2016-10-09 16:47:49 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
2016-10-22 14:39:08 +00:00
<?php require '../include/head.php'; ?>
2016-10-09 16:47:49 +00:00
</head>
<body>
2016-10-22 14:39:08 +00:00
<?php require '../include/navigation.php'; ?>
2016-10-09 16:47:49 +00:00
2016-10-22 14:39:08 +00:00
<div class="container">
<div class="row">
<div class="col-md-12">
<img class="float-xs-left" src="/assets/img/devilbox_80.png" />
<h1 class="float-xs-left text-muted">The devilbox</h1>
2016-10-09 16:47:49 +00:00
</div>
</div>
2016-10-22 14:39:08 +00:00
<br/>
<hr/>
<br/>
2016-10-09 16:47:49 +00:00
2016-10-22 14:39:08 +00:00
<div class="row">
<div class="col-md-12">
<h2 class="text-xs-center">Docker setup</h2>
</div>
</div>
2016-10-09 16:47:49 +00:00
<br/>
<br/>
<div class="row">
2016-10-22 14:39:08 +00:00
<!-- ############################################################ -->
<!-- HTTPD Docker Circle -->
<!-- ############################################################ -->
<div class="col-md-4">
<div class="circles">
<div>
<div class="bg-danger">
<div>
<div>
2016-10-22 15:38:21 +00:00
<h3><?php echo getHttpVersion();?></h3>
2016-10-22 14:39:08 +00:00
</div>
</div>
</div>
</div>
</div>
</div>
2016-10-09 16:47:49 +00:00
2016-10-22 14:39:08 +00:00
<!-- ############################################################ -->
<!-- PHP Docker Circle -->
<!-- ############################################################ -->
<div class="col-md-4">
<div class="circles">
<div>
<div class="bg-info">
<div>
<div>
2016-10-22 15:38:21 +00:00
<h3><?php echo getPHPVersion(); ?></h3>
2016-10-22 14:39:08 +00:00
</div>
</div>
</div>
</div>
</div>
</div>
2016-10-09 16:47:49 +00:00
2016-10-22 14:39:08 +00:00
<!-- ############################################################ -->
<!-- MySQL Docker Circle-->
<!-- ############################################################ -->
<div class="col-md-4">
<div class="circles">
<div>
<div class="bg-warning">
<div>
<div>
2016-10-22 15:38:21 +00:00
<h3><?php echo getMySQLVersion();?></h3>
2016-10-22 14:39:08 +00:00
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br/><br/>
2016-10-09 16:47:49 +00:00
2016-10-22 14:39:08 +00:00
<div class="row">
<!-- ############################################################ -->
<!-- HTTPD Docker -->
<!-- ############################################################ -->
<div class="col-md-4">
<table class="table table-striped table-sm">
<thead class="thead-inverse">
2016-10-09 16:47:49 +00:00
<tr>
2016-10-22 14:39:08 +00:00
<th colspan="2">httpd docker</th>
2016-10-09 16:47:49 +00:00
</tr>
2016-10-22 14:39:08 +00:00
</thead>
<tbody>
2016-10-09 16:47:49 +00:00
<tr>
2016-10-22 14:39:08 +00:00
<th>IP Address</th>
<td><?php echo $HTTPD_HOST_ADDR;?></td>
2016-10-09 16:47:49 +00:00
</tr>
<tr>
2016-10-22 14:39:08 +00:00
<th>Document Root</th>
<td>/shared/httpd</td>
2016-10-09 16:47:49 +00:00
</tr>
2016-10-22 14:39:08 +00:00
</tbody>
</table>
</div>
2016-10-09 16:47:49 +00:00
2016-10-22 14:39:08 +00:00
<!-- ############################################################ -->
<!-- PHP Docker -->
<!-- ############################################################ -->
<div class="col-md-4">
<table class="table table-striped table-sm">
<thead class="thead-inverse">
2016-10-09 16:47:49 +00:00
<tr>
2016-10-22 14:39:08 +00:00
<th colspan="2">php docker</th>
2016-10-09 16:47:49 +00:00
</tr>
2016-10-22 14:39:08 +00:00
</thead>
<tbody>
2016-10-09 16:47:49 +00:00
<tr>
2016-10-22 14:39:08 +00:00
<th>IP Address</th>
<td><?php echo $PHP_HOST_ADDR;?></td>
2016-10-09 16:47:49 +00:00
</tr>
<tr>
2016-10-22 14:39:08 +00:00
<th>Document Root</th>
<td>/shared/httpd</td>
2016-10-09 16:47:49 +00:00
</tr>
<tr>
2016-10-22 14:39:08 +00:00
<th>Custom config</th>
<td>
<?php foreach (scandir('/etc/php-custom.d') as $file): ?>
<?php if (preg_match('/.*\.ini$/', $file) === 1): ?>
<?php echo $file.'<br/>';?>
<?php endif; ?>
<?php endforeach; ?>
2016-10-09 16:47:49 +00:00
</td>
</tr>
<tr>
2016-10-22 14:39:08 +00:00
<?php $error; $valid = php_has_valid_mysql_socket($error); ?>
<th>MySQL socket</th>
<td class="<?php echo !$valid ? 'bg-danger' : '';?>">
2016-10-25 19:13:23 +00:00
<?php echo !$valid ? 'Error<br/><sub>'.$error.'</sub>' : $ENV['MYSQL_SOCKET_PATH']; ?>
2016-10-22 14:39:08 +00:00
</td>
2016-10-09 16:47:49 +00:00
</tr>
<tr>
2016-10-22 14:39:08 +00:00
<?php $err; $valid = my_mysql_connection_test($err, 'localhost'); ?>
<th>MySQL test</th>
<td class="<?php echo !$valid ? 'bg-danger' : '';?>">
2016-10-25 19:13:23 +00:00
<?php echo $valid ? '<span class="bg-success">OK</span> localhost:3306' : 'Failed: localhost:3306<br/><sub>'.$err.'</sub>'; ?>
2016-10-22 14:39:08 +00:00
</td>
2016-10-09 16:47:49 +00:00
</tr>
<tr>
2016-10-22 14:39:08 +00:00
<?php $err; $valid = my_mysql_connection_test($err, '127.0.0.1'); ?>
<th>MySQL test</th>
<td class="<?php echo !$valid ? 'bg-danger' : '';?>">
2016-10-25 19:13:23 +00:00
<?php echo $valid ? '<span class="bg-success">OK</span> 127.0.0.1:3306' : 'Failed: 127.0.0.1:3306<br/><sub>'.$err.'</sub>'; ?>
2016-10-22 14:39:08 +00:00
</td>
2016-10-09 16:47:49 +00:00
</tr>
<tr>
2016-10-22 14:39:08 +00:00
<?php $err; $valid = my_mysql_connection_test($err, $MYSQL_HOST_ADDR); ?>
<th>MySQL test</th>
<td class="<?php echo !$valid ? 'bg-danger' : '';?>">
2016-10-25 19:13:23 +00:00
<?php echo $valid ? '<span class="bg-success">OK</span> '.$MYSQL_HOST_ADDR.':3306' : 'Failed: '.$MYSQL_HOST_ADDR.':3306<br/><sub>'.$err.'</sub>'; ?>
2016-10-09 16:47:49 +00:00
</td>
</tr>
2016-10-22 14:39:08 +00:00
<tr>
<th>Postfix</th>
<td><?php echo $ENV['ENABLE_MAIL'] ? '<span class="bg-success">OK</span> Enabled' : '<span class="bg-danger">No</span> Disabled';?></td>
</tr>
2016-10-22 14:39:08 +00:00
2016-10-16 18:08:56 +00:00
<tr>
2016-10-22 14:39:08 +00:00
<th>Xdebug enabled</th>
2016-10-16 18:08:56 +00:00
<td>
<?php if ($ENV['PHP_XDEBUG_ENABLE'] == ini_get('xdebug.remote_enable')): ?>
<?php echo ini_get('xdebug.remote_enable') == 1 ? 'Yes' : ini_get('xdebug.remote_enable'); ?>
<?php else: ?>
<?php echo '.env file setting differs from custom php .ini file<br/>'; ?>
<?php echo 'Effective setting: '.ini_get('xdebug.remote_enable'); ?>
<?php endif; ?>
</td>
</tr>
<tr>
2016-10-22 14:39:08 +00:00
<th>Xdebug remote</th>
2016-10-16 18:08:56 +00:00
<td>
<?php if ($ENV['PHP_XDEBUG_REMOTE_HOST'] == ini_get('xdebug.remote_host')): ?>
<?php echo ini_get('xdebug.remote_host'); ?>
<?php else: ?>
<?php echo '.env file setting differs from custom php .ini file<br/>'; ?>
<?php echo 'Effective setting: '.ini_get('xdebug.remote_host'); ?>
<?php endif; ?>
</td>
</tr>
<tr>
2016-10-22 14:39:08 +00:00
<th>Xdebug Port</th>
2016-10-16 18:08:56 +00:00
<td>
<?php if ($ENV['PHP_XDEBUG_REMOTE_PORT'] == ini_get('xdebug.remote_port')): ?>
<?php echo ini_get('xdebug.remote_port'); ?>
<?php else: ?>
<?php echo '.env file setting differs from custom php .ini file<br/>'; ?>
<?php echo 'Effective setting: '.ini_get('xdebug.remote_port'); ?>
<?php endif; ?>
</td>
</tr>
2016-10-09 16:47:49 +00:00
2016-10-22 14:39:08 +00:00
</tbody>
</table>
</div>
<!-- ############################################################ -->
<!-- MySQL Docker -->
<!-- ############################################################ -->
<div class="col-md-4">
<table class="table table-striped table-sm">
<thead class="thead-inverse">
2016-10-09 16:47:49 +00:00
<tr>
2016-10-22 14:39:08 +00:00
<th colspan="2">db docker</th>
2016-10-09 16:47:49 +00:00
</tr>
2016-10-22 14:39:08 +00:00
</thead>
<tbody>
2016-10-09 16:47:49 +00:00
<tr>
2016-10-22 14:39:08 +00:00
<th>IP Address</th>
<td><?php echo $MYSQL_HOST_ADDR;?></td>
2016-10-09 16:47:49 +00:00
</tr>
<tr>
<th>MySQL socket</th>
<td><?php echo getMySQLConfigByKey('socket'); ?></td>
2016-10-09 16:47:49 +00:00
</tr>
<tr>
2016-10-22 14:39:08 +00:00
<th>MySQL datadir</th>
<td><?php echo getMySQLConfigByKey('datadir'); ?></td>
2016-10-09 16:47:49 +00:00
</tr>
2016-10-22 14:39:08 +00:00
</tbody>
</table>
</div>
</div>
2016-10-09 16:47:49 +00:00
2016-10-22 14:39:08 +00:00
<br/>
<br/>
<div class="row">
<div class="col-md-12">
<h2 class="text-xs-center">Docker to Host mounts</h2>
</div>
</div>
<br/>
<br/>
<div class="row">
<!-- ############################################################ -->
<!-- HTTPD Docker Mounts -->
<!-- ############################################################ -->
<div class="col-md-4">
<table class="table table-striped table-sm">
<thead class="thead-inverse">
<tr>
<th>httpd docker</th>
<th>host</th>
</tr>
</thead>
<tbody>
<tr>
<th>Document Root</th>
<td><?php echo $ENV['HOST_PATH_TO_WWW_DOCROOTS'];?></td>
</tr>
<tr>
<th>Log directory</th>
<td>./log</td>
</tr>
2016-10-09 16:47:49 +00:00
</tbody>
</table>
2016-10-22 14:39:08 +00:00
</div>
2016-10-09 16:47:49 +00:00
2016-10-22 14:39:08 +00:00
<!-- ############################################################ -->
<!-- PHP Docker Mounts -->
<!-- ############################################################ -->
<div class="col-md-4">
<table class="table table-striped table-sm">
<thead class="thead-inverse">
<tr>
<th>php docker</th>
<th>host</th>
</tr>
</thead>
<tbody>
<tr>
<th>Document Root</th>
<td><?php echo $ENV['HOST_PATH_TO_WWW_DOCROOTS'];?></td>
</tr>
<tr>
<th>Custom config</th>
<td>./etc</td>
</tr>
<tr>
2016-10-25 19:13:23 +00:00
<th>MySQL socket</th>
<td>./run/mysql/mysqld.sock</td>
</tr> <tr>
2016-10-22 14:39:08 +00:00
<th>Log directory</th>
<td>./log</td>
</tr>
</tbody>
</table>
</div>
<!-- ############################################################ -->
<!-- MySQL Docker Mounts -->
<!-- ############################################################ -->
<div class="col-md-4">
<table class="table table-striped table-sm">
<thead class="thead-inverse">
<tr>
<th>db docker</th>
<th>host</th>
</tr>
</thead>
<tbody>
<tr>
<th>MySQL datadir</th>
<td><?php echo $ENV['HOST_PATH_TO_MYSQL_DATADIR'];?></td>
</tr>
<tr>
<th>MySQL socket</th>
<td>./run/mysql/mysqld.sock</td>
</tr>
<tr>
<th>Log directory</th>
<td>./log</td>
</tr>
</tbody>
</table>
</div>
2016-10-09 16:47:49 +00:00
2016-10-22 14:39:08 +00:00
</div>
2016-10-09 16:47:49 +00:00
</div><!-- /.container -->
<?php require '../include/footer.php'; ?>
<script>
// self executing function here
(function() {
// your page initialization code here
// the DOM will be available here
})();
</script>
2016-10-09 16:47:49 +00:00
</body>
</html>