REL-0.9 Check if container are running

This commit is contained in:
cytopia 2017-05-08 09:43:43 +02:00
parent d9a255ae6a
commit dfa8ff99dc
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
9 changed files with 196 additions and 155 deletions

View File

@ -1,4 +1,5 @@
<?php require '../config.php'; ?>
<?php $Postgres = loadClass('Memcd'); ?>
<!DOCTYPE html>
<html lang="en">
<head>
@ -17,22 +18,26 @@
<div class="row">
<div class="col-md-12">
<table class="table table-striped ">
<thead class="thead-inverse ">
<tr>
<th>Key</th>
<th>Value</th>
</th>
</thead>
<tbody>
<?php foreach (loadClass('Memcd')->getKeys() as $data): ?>
<?php if (!\devilbox\Memcd::isAvailable($GLOBALS['MEMCD_HOST_NAME'])): ?>
<p>Memcahed container is not running.</p>
<?php else: ?>
<table class="table table-striped ">
<thead class="thead-inverse ">
<tr>
<td><?php print_r($data['key']);?></td>
<td><?php print_r($data['value']);?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<th>Key</th>
<th>Value</th>
</th>
</thead>
<tbody>
<?php foreach (loadClass('Memcd')->getKeys() as $data): ?>
<tr>
<td><?php print_r($data['key']);?></td>
<td><?php print_r($data['value']);?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
</div>

View File

@ -18,33 +18,37 @@
<div class="row">
<div class="col-md-12">
<table class="table table-striped ">
<thead class="thead-inverse ">
<tr>
<th>Name</th>
<th>Charset</th>
<th>Collation</th>
<th>Tables</th>
<th>Size</th>
</th>
</thead>
<tbody>
<?php
$len_table = 4;
$len_size = 9;
?>
<?php foreach ($MySQL->getDatabases() as $name => $keys): ?>
<?php if (!\devilbox\Mysql::isAvailable($GLOBALS['MYSQL_HOST_NAME'])): ?>
<p>MySQL container is not running.</p>
<?php else: ?>
<table class="table table-striped ">
<thead class="thead-inverse ">
<tr>
<td><?php echo $name;?></td>
<td><?php echo $keys['charset'];?></td>
<td><?php echo $keys['collation'];?></td>
<td><code><span class="table" id="table-<?php echo $name;?>"><?php echo str_repeat('&nbsp;', $len_table);?></span></code></td>
<td><code><span class="size" id="size-<?php echo $name;?>"><?php echo str_repeat('&nbsp;', $len_size);?></span></code></td>
</tr>
<input type="hidden" name="database[]" class="database" value="<?php echo $name;?>" />
<?php endforeach; ?>
</tbody>
</table>
<th>Name</th>
<th>Charset</th>
<th>Collation</th>
<th>Tables</th>
<th>Size</th>
</th>
</thead>
<tbody>
<?php
$len_table = 4;
$len_size = 9;
?>
<?php foreach ($MySQL->getDatabases() as $name => $keys): ?>
<tr>
<td><?php echo $name;?></td>
<td><?php echo $keys['charset'];?></td>
<td><?php echo $keys['collation'];?></td>
<td><code><span class="table" id="table-<?php echo $name;?>"><?php echo str_repeat('&nbsp;', $len_table);?></span></code></td>
<td><code><span class="size" id="size-<?php echo $name;?>"><?php echo str_repeat('&nbsp;', $len_size);?></span></code></td>
</tr>
<input type="hidden" name="database[]" class="database" value="<?php echo $name;?>" />
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
</div>

View File

@ -18,43 +18,47 @@
<div class="row">
<div class="col-md-12">
<table class="table table-striped ">
<thead class="thead-inverse ">
<tr>
<th>Name</th>
<th>Charset</th>
<th>Collation</th>
<th>Tables</th>
<th>Size</th>
</th>
</thead>
<tbody>
<?php
$len_table = 4;
$len_size = 9;
?>
<?php foreach ($Postgres->getDatabases() as $name => $database): ?>
<tr class="table-info">
<th>
<?php echo $name;?>
</th>
<td><?php echo $database['charset'];?></td>
<td><?php echo $database['collation'];?></td>
<td colspan="2"></td>
</tr>
<?php foreach ($database['schemas'] as $schema => $data): ?>
<tr>
<td><?php echo $schema;?></td>
<?php if (!\devilbox\Pgsql::isAvailable($GLOBALS['PGSQL_HOST_NAME'])): ?>
<p>PgSQL container is not running.</p>
<?php else: ?>
<table class="table table-striped ">
<thead class="thead-inverse ">
<tr>
<th>Name</th>
<th>Charset</th>
<th>Collation</th>
<th>Tables</th>
<th>Size</th>
</th>
</thead>
<tbody>
<?php
$len_table = 4;
$len_size = 9;
?>
<?php foreach ($Postgres->getDatabases() as $name => $database): ?>
<tr class="table-info">
<th>
<?php echo $name;?>
</th>
<td><?php echo $database['charset'];?></td>
<td><?php echo $database['collation'];?></td>
<td colspan="2"></td>
<td><code><span class="table" id="table-<?php echo $name.'-'.$schema;?>"><?php echo str_repeat('&nbsp;', $len_table);?></span></code></td>
<td><code><span class="size" id="size-<?php echo $name.'-'.$schema;?>"><?php echo str_repeat('&nbsp;', $len_size);?></span></code></td>
</tr>
<input type="hidden" name="schema[]" data-database="<?php echo $name;?>" class="schema" value="<?php echo $schema;?>" />
<?php endforeach; ?>
<?php foreach ($database['schemas'] as $schema => $data): ?>
<tr>
<td><?php echo $schema;?></td>
<td colspan="2"></td>
<td><code><span class="table" id="table-<?php echo $name.'-'.$schema;?>"><?php echo str_repeat('&nbsp;', $len_table);?></span></code></td>
<td><code><span class="size" id="size-<?php echo $name.'-'.$schema;?>"><?php echo str_repeat('&nbsp;', $len_size);?></span></code></td>
</tr>
<input type="hidden" name="schema[]" data-database="<?php echo $name;?>" class="schema" value="<?php echo $schema;?>" />
<?php endforeach; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
</div>

View File

@ -1,4 +1,5 @@
<?php require '../config.php'; ?>
<?php $Postgres = loadClass('Redis'); ?>
<!DOCTYPE html>
<html lang="en">
<head>
@ -17,22 +18,26 @@
<div class="row">
<div class="col-md-12">
<table class="table table-striped ">
<thead class="thead-inverse ">
<tr>
<th>Key</th>
<th>Value</th>
</th>
</thead>
<tbody>
<?php foreach (loadClass('Redis')->getKeys() as $key => $value): ?>
<?php if (!\devilbox\Redis::isAvailable($GLOBALS['REDIS_HOST_NAME'])): ?>
<p>Redis container is not running.</p>
<?php else: ?>
<table class="table table-striped ">
<thead class="thead-inverse ">
<tr>
<td><?php echo $key;?></td>
<td><?php print_r($value);?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<th>Key</th>
<th>Value</th>
</th>
</thead>
<tbody>
<?php foreach (loadClass('Redis')->getKeys() as $key => $value): ?>
<tr>
<td><?php echo $key;?></td>
<td><?php print_r($value);?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
</div>

View File

@ -1,4 +1,5 @@
<?php require '../config.php'; ?>
<?php $Postgres = loadClass('Memcd'); ?>
<!DOCTYPE html>
<html lang="en">
<head>
@ -17,25 +18,29 @@
<div class="row">
<div class="col-md-12">
<?php foreach (loadClass('Memcd')->getInfo() as $srv => $data): ?>
<h2><?php echo $srv; ?></h2>
<table class="table table-striped">
<thead class="thead-inverse">
<tr>
<th>Variable</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php foreach ($data as $key => $val): ?>
<?php if (!\devilbox\Memcd::isAvailable($GLOBALS['MEMCD_HOST_NAME'])): ?>
<p>Memcahed container is not running.</p>
<?php else: ?>
<?php foreach (loadClass('Memcd')->getInfo() as $srv => $data): ?>
<h2><?php echo $srv; ?></h2>
<table class="table table-striped">
<thead class="thead-inverse">
<tr>
<td><?php echo $key;?></td>
<td class="break-word"><code><?php echo $val;?></code></td>
<th>Variable</th>
<th>Value</th>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endforeach; ?>
</thead>
<tbody>
<?php foreach ($data as $key => $val): ?>
<tr>
<td><?php echo $key;?></td>
<td class="break-word"><code><?php echo $val;?></code></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>

View File

@ -1,4 +1,5 @@
<?php require '../config.php'; ?>
<?php $MySQL = loadClass('Mysql'); ?>
<!DOCTYPE html>
<html lang="en">
<head>
@ -17,29 +18,33 @@
<div class="row">
<div class="col-md-12">
<p>For reference see here:</p>
<ul>
<li><a target="_blank" href="https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html">https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html</a></li>
<li><a target="_blank" href="https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html">https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html</a></li>
<li><a target="_blank" href="https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html">https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html</a></li>
</ul>
<?php if (!\devilbox\Mysql::isAvailable($GLOBALS['MYSQL_HOST_NAME'])): ?>
<p>MySQL container is not running.</p>
<?php else: ?>
<p>For reference see here:</p>
<ul>
<li><a target="_blank" href="https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html">https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html</a></li>
<li><a target="_blank" href="https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html">https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html</a></li>
<li><a target="_blank" href="https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html">https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html</a></li>
</ul>
<table class="table table-striped">
<thead class="thead-inverse">
<tr>
<th>Variable</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php foreach (loadClass('Mysql')->getConfig() as $key => $val): ?>
<table class="table table-striped">
<thead class="thead-inverse">
<tr>
<td><?php echo $key;?></td>
<td class="break-word"><code><?php echo $val;?></code></td>
<th>Variable</th>
<th>Value</th>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</thead>
<tbody>
<?php foreach (loadClass('Mysql')->getConfig() as $key => $val): ?>
<tr>
<td><?php echo $key;?></td>
<td class="break-word"><code><?php echo $val;?></code></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
</div>

View File

@ -1,4 +1,5 @@
<?php require '../config.php'; ?>
<?php $Postgres = loadClass('Pgsql'); ?>
<!DOCTYPE html>
<html lang="en">
<head>
@ -17,22 +18,26 @@
<div class="row">
<div class="col-md-12">
<table class="table table-striped">
<thead class="thead-inverse">
<tr>
<th>Variable</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php foreach (loadClass('Pgsql')->getConfig() as $key => $val): ?>
<?php if (!\devilbox\Pgsql::isAvailable($GLOBALS['PGSQL_HOST_NAME'])): ?>
<p>PgSQL container is not running.</p>
<?php else: ?>
<table class="table table-striped">
<thead class="thead-inverse">
<tr>
<td><?php echo $key;?></td>
<td class="break-word"><code><?php echo $val;?></code></td>
<th>Variable</th>
<th>Value</th>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</thead>
<tbody>
<?php foreach (loadClass('Pgsql')->getConfig() as $key => $val): ?>
<tr>
<td><?php echo $key;?></td>
<td class="break-word"><code><?php echo $val;?></code></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
</div>

View File

@ -1,4 +1,5 @@
<?php require '../config.php'; ?>
<?php $Postgres = loadClass('Redis'); ?>
<!DOCTYPE html>
<html lang="en">
<head>
@ -17,22 +18,26 @@
<div class="row">
<div class="col-md-12">
<table class="table table-striped">
<thead class="thead-inverse">
<tr>
<th>Variable</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php foreach (loadClass('Redis')->getInfo() as $key => $val): ?>
<?php if (!\devilbox\Redis::isAvailable($GLOBALS['REDIS_HOST_NAME'])): ?>
<p>Redis container is not running.</p>
<?php else: ?>
<table class="table table-striped">
<thead class="thead-inverse">
<tr>
<td><?php echo $key;?></td>
<td class="break-word"><code><?php echo $val;?></code></td>
<th>Variable</th>
<th>Value</th>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</thead>
<tbody>
<?php foreach (loadClass('Redis')->getInfo() as $key => $val): ?>
<tr>
<td><?php echo $key;?></td>
<td class="break-word"><code><?php echo $val;?></code></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
</div>

View File

@ -12,6 +12,9 @@ class _Base
*
*********************************************************************************/
/** TODO: isAvailable (make instance) */
private static $_available = array();
private static $_hostname = array();