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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,5 @@
<?php require '../config.php'; ?> <?php require '../config.php'; ?>
<?php $MySQL = loadClass('Mysql'); ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
@ -17,29 +18,33 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<p>For reference see here:</p> <?php if (!\devilbox\Mysql::isAvailable($GLOBALS['MYSQL_HOST_NAME'])): ?>
<ul> <p>MySQL container is not running.</p>
<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> <?php else: ?>
<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> <p>For reference see here:</p>
<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>
</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"> <table class="table table-striped">
<thead class="thead-inverse"> <thead class="thead-inverse">
<tr>
<th>Variable</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php foreach (loadClass('Mysql')->getConfig() as $key => $val): ?>
<tr> <tr>
<td><?php echo $key;?></td> <th>Variable</th>
<td class="break-word"><code><?php echo $val;?></code></td> <th>Value</th>
</tr> </tr>
<?php endforeach; ?> </thead>
</tbody> <tbody>
</table> <?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>
</div> </div>

View File

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

View File

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

View File

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