mirror of
https://github.com/cytopia/devilbox.git
synced 2024-12-20 05:17:53 +00:00
DVL-001 Prepare HHVM support
This commit is contained in:
parent
294123505b
commit
d396c921d7
@ -42,23 +42,51 @@ $MYSQL_HOST_ADDR = gethostbyname($MYSQL_HOST_NAME);
|
|||||||
$POSTGRES_HOST_NAME = 'postgres';
|
$POSTGRES_HOST_NAME = 'postgres';
|
||||||
$POSTGRES_HOST_ADDR = gethostbyname($POSTGRES_HOST_NAME);
|
$POSTGRES_HOST_ADDR = gethostbyname($POSTGRES_HOST_NAME);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Lazy Loader
|
||||||
|
//
|
||||||
|
function loadClass($class) {
|
||||||
|
|
||||||
//
|
global $LIB_DIR;
|
||||||
// Load files
|
global $MYSQL_HOST_ADDR;
|
||||||
//
|
global $POSTGRES_HOST_ADDR;
|
||||||
require $LIB_DIR . DIRECTORY_SEPARATOR . 'Logger.php';
|
|
||||||
require $LIB_DIR . DIRECTORY_SEPARATOR . 'Docker.php';
|
static $_LOADED_LIBS;
|
||||||
require $LIB_DIR . DIRECTORY_SEPARATOR . 'Mysql.php';
|
|
||||||
require $LIB_DIR . DIRECTORY_SEPARATOR . 'Postgres.php';
|
|
||||||
|
|
||||||
|
|
||||||
//
|
if (isset($_LOADED_LIBS[$class])) {
|
||||||
// Instantiate Basics
|
return $_LOADED_LIBS[$class];
|
||||||
//
|
} else {
|
||||||
$Logger = \devilbox\Logger::getInstance();
|
switch($class) {
|
||||||
$Docker = \devilbox\Docker::getInstance();
|
|
||||||
$MySQL = \devilbox\Mysql::getInstance('root', $Docker->getEnv('MYSQL_ROOT_PASSWORD'), $MYSQL_HOST_ADDR);
|
case 'Logger':
|
||||||
$Postgres = \devilbox\Postgres::getInstance($Docker->getEnv('POSTGRES_USER'), $Docker->getEnv('POSTGRES_PASSWORD'), $POSTGRES_HOST_ADDR);
|
require $LIB_DIR . DIRECTORY_SEPARATOR . $class . '.php';
|
||||||
|
$_LOADED_LIBS[$class] = \devilbox\Logger::getInstance();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Docker':
|
||||||
|
require $LIB_DIR . DIRECTORY_SEPARATOR . $class . '.php';
|
||||||
|
$_LOADED_LIBS[$class] = \devilbox\Docker::getInstance();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Mysql':
|
||||||
|
require $LIB_DIR . DIRECTORY_SEPARATOR . $class . '.php';
|
||||||
|
$Docker = loadClass('Docker');
|
||||||
|
$_LOADED_LIBS[$class] = \devilbox\Mysql::getInstance('root', $Docker->getEnv('MYSQL_ROOT_PASSWORD'), $MYSQL_HOST_ADDR);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Postgres':
|
||||||
|
require $LIB_DIR . DIRECTORY_SEPARATOR . $class . '.php';
|
||||||
|
$Docker = loadClass('Docker');
|
||||||
|
$_LOADED_LIBS[$class] = \devilbox\Postgres::getInstance($Docker->getEnv('POSTGRES_USER'), $Docker->getEnv('POSTGRES_PASSWORD'), $POSTGRES_HOST_ADDR);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
exit('Class does not exist: '.$class);
|
||||||
|
}
|
||||||
|
return $_LOADED_LIBS[$class];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,16 +4,16 @@ require '../config.php';
|
|||||||
if (isset($_GET['database'])) {
|
if (isset($_GET['database'])) {
|
||||||
if (isset($_GET['type']) && $_GET['type'] == 'mysql') {
|
if (isset($_GET['type']) && $_GET['type'] == 'mysql') {
|
||||||
echo json_encode(array(
|
echo json_encode(array(
|
||||||
'size' => (string)$MySQL->getDBSize($_GET['database']),
|
'size' => (string)loadClass('Mysql')->getDBSize($_GET['database']),
|
||||||
'table' => (string)$MySQL->getTableCount($_GET['database'])
|
'table' => (string)loadClass('Mysql')->getTableCount($_GET['database'])
|
||||||
));
|
));
|
||||||
} else if (isset($_GET['type']) && $_GET['type'] == 'postgres') {
|
} else if (isset($_GET['type']) && $_GET['type'] == 'postgres') {
|
||||||
$schema = isset($_GET['schema']) ? $_GET['schema'] : '';
|
$schema = isset($_GET['schema']) ? $_GET['schema'] : '';
|
||||||
echo json_encode(array(
|
echo json_encode(array(
|
||||||
'size' => (string)$Postgres->getSchemaSize($_GET['database'], $schema),
|
'size' => (string)loadClass('Postgres')->getSchemaSize($_GET['database'], $schema),
|
||||||
'table' => (string)$Postgres->getTableCount($_GET['database'], $schema)
|
'table' => (string)loadClass('Postgres')->getTableCount($_GET['database'], $schema)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
} else if (isset($_GET['vhost'])) {
|
} else if (isset($_GET['vhost'])) {
|
||||||
echo $Docker->PHP_checkVirtualHost($_GET['vhost']);
|
echo loadClass('Docker')->PHP_checkVirtualHost($_GET['vhost']);
|
||||||
}
|
}
|
||||||
|
@ -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>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<?php require '../config.php'; ?>
|
<?php require '../config.php'; ?>
|
||||||
|
<?php $Postgres = loadClass('Postgres'); ?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
|
||||||
<?php $errors = $Logger->getAll(); ?>
|
<?php $errors = loadClass('Logger')->getAll(); ?>
|
||||||
<?php if ($errors === false): ?>
|
<?php if ($errors === false): ?>
|
||||||
<p>Writing to logfile is not possible. Errors will be sent as mail instead. Check the mail section.</p>
|
<p>Writing to logfile is not possible. Errors will be sent as mail instead. Check the mail section.</p>
|
||||||
<?php elseif (count($errors) === 0): ?>
|
<?php elseif (count($errors) === 0): ?>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<?php require '../config.php'; ?>
|
<?php require '../config.php'; ?>
|
||||||
|
<?php $Docker = loadClass('Docker'); ?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
@ -162,28 +163,28 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<?php $error; $valid = $Docker->PHP_has_valid_mysql_socket($error); ?>
|
<?php $err=null; $valid = $Docker->PHP_has_valid_mysql_socket($err); ?>
|
||||||
<th>MySQL socket</th>
|
<th>MySQL socket</th>
|
||||||
<td class="<?php echo !$valid ? 'bg-danger' : '';?>">
|
<td class="<?php echo !$valid ? 'bg-danger' : '';?>">
|
||||||
<?php echo !$valid ? 'Error<br/><sub>'.$error.'</sub>' : $Docker->getEnv('MYSQL_SOCKET_PATH'); ?>
|
<?php echo !$valid ? 'Error<br/><sub>'.$err.'</sub>' : $Docker->getEnv('MYSQL_SOCKET_PATH'); ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<?php $err; $valid = \devilbox\Mysql::testConnection($err, 'root', $Docker->getEnv('MYSQL_ROOT_PASSWORD'), 'localhost'); ?>
|
<?php $err=null; $valid = \devilbox\Mysql::testConnection($err, 'root', $Docker->getEnv('MYSQL_ROOT_PASSWORD'), 'localhost'); ?>
|
||||||
<th>MySQL test</th>
|
<th>MySQL test</th>
|
||||||
<td class="<?php echo !$valid ? 'bg-danger' : '';?>">
|
<td class="<?php echo !$valid ? 'bg-danger' : '';?>">
|
||||||
<?php echo $valid ? '<span class="bg-success">OK</span> localhost:3306' : 'Failed: localhost:3306<br/><sub>'.$err.'</sub>'; ?>
|
<?php echo $valid ? '<span class="bg-success">OK</span> localhost:3306' : 'Failed: localhost:3306<br/><sub>'.$err.'</sub>'; ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<?php $err; $valid = \devilbox\Mysql::testConnection($err, 'root', $Docker->getEnv('MYSQL_ROOT_PASSWORD'), '127.0.0.1'); ?>
|
<?php $err=null; $valid = \devilbox\Mysql::testConnection($err, 'root', $Docker->getEnv('MYSQL_ROOT_PASSWORD'), '127.0.0.1'); ?>
|
||||||
<th>MySQL test</th>
|
<th>MySQL test</th>
|
||||||
<td class="<?php echo !$valid ? 'bg-danger' : '';?>">
|
<td class="<?php echo !$valid ? 'bg-danger' : '';?>">
|
||||||
<?php echo $valid ? '<span class="bg-success">OK</span> 127.0.0.1:3306' : 'Failed: 127.0.0.1:3306<br/><sub>'.$err.'</sub>'; ?>
|
<?php echo $valid ? '<span class="bg-success">OK</span> 127.0.0.1:3306' : 'Failed: 127.0.0.1:3306<br/><sub>'.$err.'</sub>'; ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<?php $err; $valid = \devilbox\Mysql::testConnection($err, 'root', $Docker->getEnv('MYSQL_ROOT_PASSWORD'), $MYSQL_HOST_ADDR); ?>
|
<?php $err=null; $valid = \devilbox\Mysql::testConnection($err, 'root', $Docker->getEnv('MYSQL_ROOT_PASSWORD'), $MYSQL_HOST_ADDR); ?>
|
||||||
<th>MySQL test</th>
|
<th>MySQL test</th>
|
||||||
<td class="<?php echo !$valid ? 'bg-danger' : '';?>">
|
<td class="<?php echo !$valid ? 'bg-danger' : '';?>">
|
||||||
<?php echo $valid ? '<span class="bg-success">OK</span> '.$MYSQL_HOST_ADDR.':3306' : 'Failed: '.$MYSQL_HOST_ADDR.':3306<br/><sub>'.$err.'</sub>'; ?>
|
<?php echo $valid ? '<span class="bg-success">OK</span> '.$MYSQL_HOST_ADDR.':3306' : 'Failed: '.$MYSQL_HOST_ADDR.':3306<br/><sub>'.$err.'</sub>'; ?>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
require '../config.php';
|
||||||
|
|
||||||
//
|
//
|
||||||
// $_POST submit for sending a test email
|
// $_POST submit for sending a test email
|
||||||
@ -7,7 +8,9 @@ if (isset($_GET['email']) && isset($_GET['subject']) && isset($_GET['message']))
|
|||||||
$mail = $_GET['email'];
|
$mail = $_GET['email'];
|
||||||
$subj = $_GET['subject'];
|
$subj = $_GET['subject'];
|
||||||
$mess = $_GET['message'];
|
$mess = $_GET['message'];
|
||||||
mail($mail, $subj, $mess);
|
if (! mail($mail, $subj, $mess)) {
|
||||||
|
loadClass('Logger')->error('Could not send mail to: '.$mail.' | subject: '.$subject);
|
||||||
|
}
|
||||||
header('Location: /mail.php');
|
header('Location: /mail.php');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
@ -15,7 +18,6 @@ if (isset($_GET['email']) && isset($_GET['subject']) && isset($_GET['message']))
|
|||||||
//
|
//
|
||||||
// Includes
|
// Includes
|
||||||
//
|
//
|
||||||
require '../config.php';
|
|
||||||
require $VEN_DIR . DIRECTORY_SEPARATOR . 'Mail' . DIRECTORY_SEPARATOR .'Mbox.php';
|
require $VEN_DIR . DIRECTORY_SEPARATOR . 'Mail' . DIRECTORY_SEPARATOR .'Mbox.php';
|
||||||
require $VEN_DIR . DIRECTORY_SEPARATOR . 'Mail' . DIRECTORY_SEPARATOR .'mimeDecode.php';
|
require $VEN_DIR . DIRECTORY_SEPARATOR . 'Mail' . DIRECTORY_SEPARATOR .'mimeDecode.php';
|
||||||
require $LIB_DIR . DIRECTORY_SEPARATOR . 'Mail.php';
|
require $LIB_DIR . DIRECTORY_SEPARATOR . 'Mail.php';
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<?php require '../config.php'; ?>
|
<?php require '../config.php'; ?>
|
||||||
|
<?php $Docker = loadClass('Docker'); ?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
@ -12,6 +12,10 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
<style>
|
||||||
|
/* prevent hhvm phpinfo() from shrinking the width */
|
||||||
|
body {width: 100% !important;}
|
||||||
|
</style>
|
||||||
<?php phpinfo(); ?>
|
<?php phpinfo(); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<?php require '../config.php'; ?>
|
<?php require '../config.php'; ?>
|
||||||
|
<?php $Docker = loadClass('Docker'); ?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<?php require '../config.php'; ?>
|
<?php require '../config.php'; ?>
|
||||||
|
<?php $Docker = loadClass('Docker'); ?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
@ -107,8 +107,7 @@ class Docker
|
|||||||
public function getEnv($variable)
|
public function getEnv($variable)
|
||||||
{
|
{
|
||||||
if (!isset($this->_env[$variable])) {
|
if (!isset($this->_env[$variable])) {
|
||||||
$Logger = \devilbox\Logger::getInstance();
|
loadClass('Logger')->error('Docker environment variable not found: '.$variable);
|
||||||
$Logger->error('Docker environment variable not found: '.$variable);
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return $this->_env[$variable];
|
return $this->_env[$variable];
|
||||||
@ -158,7 +157,12 @@ class Docker
|
|||||||
*/
|
*/
|
||||||
public function PHP_version()
|
public function PHP_version()
|
||||||
{
|
{
|
||||||
return 'PHP ' . phpversion() .' (' . php_sapi_name().')';
|
if (defined('HHVM_VERSION')) {
|
||||||
|
return 'HHVM ' .HHVM_VERSION . '<br/>(PHP '.str_replace('-hhvm', '', phpversion()).')';
|
||||||
|
//return 'PHP ' . phpversion() . '('. HHVM_VERSION . ')';
|
||||||
|
} else {
|
||||||
|
return 'PHP ' . phpversion() .' (' . php_sapi_name().')';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -338,7 +342,7 @@ class Docker
|
|||||||
};
|
};
|
||||||
|
|
||||||
$sql = 'SHOW VARIABLES;';
|
$sql = 'SHOW VARIABLES;';
|
||||||
$configs = \devilbox\Mysql::getInstance()->select($sql, $callback);
|
$configs = loadClass('Mysql')->select($sql, $callback);
|
||||||
|
|
||||||
return $configs ? $configs : array();
|
return $configs ? $configs : array();
|
||||||
|
|
||||||
@ -351,7 +355,7 @@ class Docker
|
|||||||
};
|
};
|
||||||
|
|
||||||
$sql = 'SHOW VARIABLES WHERE Variable_Name = "'.$key.'";';
|
$sql = 'SHOW VARIABLES WHERE Variable_Name = "'.$key.'";';
|
||||||
$val = \devilbox\Mysql::getInstance()->select($sql, $callback);
|
$val = loadClass('Mysql')->select($sql, $callback);
|
||||||
|
|
||||||
if (is_array($val) && $val) {
|
if (is_array($val) && $val) {
|
||||||
return array_values($val)[0];
|
return array_values($val)[0];
|
||||||
@ -379,7 +383,7 @@ class Docker
|
|||||||
$data = $row['version'];
|
$data = $row['version'];
|
||||||
};
|
};
|
||||||
|
|
||||||
$version = \devilbox\Postgres::getInstance()->select('SELECT version();', $callback);
|
$version = loadClass('Postgres')->select('SELECT version();', $callback);
|
||||||
|
|
||||||
// Extract shorthand
|
// Extract shorthand
|
||||||
preg_match('/\w+[[:space:]]*[.0-9]+/i', $version, $matches);
|
preg_match('/\w+[[:space:]]*[.0-9]+/i', $version, $matches);
|
||||||
@ -412,7 +416,7 @@ class Docker
|
|||||||
};
|
};
|
||||||
|
|
||||||
$sql = 'SELECT name, setting FROM pg_settings;';
|
$sql = 'SELECT name, setting FROM pg_settings;';
|
||||||
$configs = \devilbox\Postgres::getInstance()->select($sql, $callback);
|
$configs = loadClass('Postgres')->select($sql, $callback);
|
||||||
|
|
||||||
return $configs ? $configs : array();
|
return $configs ? $configs : array();
|
||||||
|
|
||||||
@ -423,7 +427,7 @@ class Docker
|
|||||||
};
|
};
|
||||||
|
|
||||||
$sql = "SELECT name, setting FROM pg_settings WHERE name = '".$key."';";
|
$sql = "SELECT name, setting FROM pg_settings WHERE name = '".$key."';";
|
||||||
$val = \devilbox\Postgres::getInstance()->select($sql, $callback);
|
$val = loadClass('Postgres')->select($sql, $callback);
|
||||||
|
|
||||||
return is_array($val) ? '' : $val;
|
return is_array($val) ? '' : $val;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class Mysql
|
|||||||
}
|
}
|
||||||
// If current MySQL instance was unable to connect
|
// If current MySQL instance was unable to connect
|
||||||
if ((static::$instance->getConnectError())) {
|
if ((static::$instance->getConnectError())) {
|
||||||
\devilbox\Logger::getInstance()->error('Instance has errors:' . "\r\n" . var_export(static::$instance, true) . "\r\n");
|
loadClass('Logger')->error('Instance has errors:' . "\r\n" . var_export(static::$instance, true) . "\r\n");
|
||||||
//return null;
|
//return null;
|
||||||
}
|
}
|
||||||
return static::$instance;
|
return static::$instance;
|
||||||
@ -130,7 +130,7 @@ class Mysql
|
|||||||
if (mysqli_connect_errno()) {
|
if (mysqli_connect_errno()) {
|
||||||
$this->_connect_error = 'Failed to connect: ' .mysqli_connect_error();
|
$this->_connect_error = 'Failed to connect: ' .mysqli_connect_error();
|
||||||
$this->_connect_errno = mysqli_connect_errno();
|
$this->_connect_errno = mysqli_connect_errno();
|
||||||
\devilbox\Logger::getInstance()->error($this->_connect_error);
|
loadClass('Logger')->error($this->_connect_error);
|
||||||
} else {
|
} else {
|
||||||
$this->_link = $link;
|
$this->_link = $link;
|
||||||
}
|
}
|
||||||
@ -162,14 +162,14 @@ class Mysql
|
|||||||
public function select($query, $callback = null)
|
public function select($query, $callback = null)
|
||||||
{
|
{
|
||||||
if (!$this->_link) {
|
if (!$this->_link) {
|
||||||
\devilbox\Logger::getInstance()->error('MySQL error, link is no resource in select()');
|
loadClass('Logger')->error('MySQL error, link is no resource in select()');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!($result = mysqli_query($this->_link, $query))) {
|
if (!($result = mysqli_query($this->_link, $query))) {
|
||||||
$this->_error = mysqli_error($this->_link);
|
$this->_error = mysqli_error($this->_link);
|
||||||
$this->_errno = mysqli_errno($this->_link);
|
$this->_errno = mysqli_errno($this->_link);
|
||||||
\devilbox\Logger::getInstance()->error($this->_error);
|
loadClass('Logger')->error($this->_error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ class Postgres
|
|||||||
}
|
}
|
||||||
// If current Postgres instance was unable to connect
|
// If current Postgres instance was unable to connect
|
||||||
if ((static::$instance->getConnectError())) {
|
if ((static::$instance->getConnectError())) {
|
||||||
\devilbox\Logger::getInstance()->error('Instance has errors:' . "\r\n" . var_export(static::$instance, true) . "\r\n");
|
loadClass('Logger')->error('Instance has errors:' . "\r\n" . var_export(static::$instance, true) . "\r\n");
|
||||||
//return null;
|
//return null;
|
||||||
}
|
}
|
||||||
return static::$instance;
|
return static::$instance;
|
||||||
@ -135,7 +135,7 @@ class Postgres
|
|||||||
if (!$link || pg_connection_status($link) !== PGSQL_CONNECTION_OK) {
|
if (!$link || pg_connection_status($link) !== PGSQL_CONNECTION_OK) {
|
||||||
$this->_connect_error = 'Failed to connect to '.$user.'@'.$host;
|
$this->_connect_error = 'Failed to connect to '.$user.'@'.$host;
|
||||||
$this->_connect_errno = 1;
|
$this->_connect_errno = 1;
|
||||||
\devilbox\Logger::getInstance()->error($this->_connect_error);
|
loadClass('Logger')->error($this->_connect_error);
|
||||||
} else {
|
} else {
|
||||||
$this->_link = $link;
|
$this->_link = $link;
|
||||||
}
|
}
|
||||||
@ -171,14 +171,14 @@ class Postgres
|
|||||||
public function select($query, $callback = null)
|
public function select($query, $callback = null)
|
||||||
{
|
{
|
||||||
if (!$this->_link) {
|
if (!$this->_link) {
|
||||||
\devilbox\Logger::getInstance()->error('Postgres error, link is no resource in select()');
|
loadClass('Logger')->error('Postgres error, link is no resource in select()');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!($result = pg_query($this->_link, $query))) {
|
if (!($result = pg_query($this->_link, $query))) {
|
||||||
$this->_error = 'PostgreSQL - error on result: '.pg_result_error($result)."\n" . 'query:'."\n" . $query;
|
$this->_error = 'PostgreSQL - error on result: '.pg_result_error($result)."\n" . 'query:'."\n" . $query;
|
||||||
$this->_errno = 1;
|
$this->_errno = 1;
|
||||||
\devilbox\Logger::getInstance()->error($this->_error);
|
loadClass('Logger')->error($this->_error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,7 +224,7 @@ class Postgres
|
|||||||
|
|
||||||
// Get schemas for each database
|
// Get schemas for each database
|
||||||
foreach ($databases as $name => &$database) {
|
foreach ($databases as $name => &$database) {
|
||||||
$PSQL = new Postgres('postgres', \devilbox\Docker::getInstance()->getEnv('POSTGRES_PASSWORD'), $GLOBALS['POSTGRES_HOST_ADDR'], $name);
|
$PSQL = new Postgres('postgres', loadClass('Docker')->getEnv('POSTGRES_PASSWORD'), $GLOBALS['POSTGRES_HOST_ADDR'], $name);
|
||||||
|
|
||||||
$sql = "SELECT n.nspname AS schemas FROM pg_catalog.pg_namespace AS n WHERE n.nspname !~ '^pg_' AND n.nspname <> 'information_schema';";
|
$sql = "SELECT n.nspname AS schemas FROM pg_catalog.pg_namespace AS n WHERE n.nspname !~ '^pg_' AND n.nspname <> 'information_schema';";
|
||||||
$callback = function ($row, &$data) {
|
$callback = function ($row, &$data) {
|
||||||
@ -247,7 +247,7 @@ class Postgres
|
|||||||
*/
|
*/
|
||||||
public function getSchemaSize($database, $schema)
|
public function getSchemaSize($database, $schema)
|
||||||
{
|
{
|
||||||
$PSQL = new Postgres('postgres', \devilbox\Docker::getInstance()->getEnv('POSTGRES_PASSWORD'), $GLOBALS['POSTGRES_HOST_ADDR'], $database);
|
$PSQL = new Postgres('postgres', loadClass('Docker')->getEnv('POSTGRES_PASSWORD'), $GLOBALS['POSTGRES_HOST_ADDR'], $database);
|
||||||
$callback = function ($row, &$data) {
|
$callback = function ($row, &$data) {
|
||||||
$data = $row['size'];
|
$data = $row['size'];
|
||||||
|
|
||||||
@ -276,7 +276,7 @@ class Postgres
|
|||||||
*/
|
*/
|
||||||
public function getTableCount($database, $schema)
|
public function getTableCount($database, $schema)
|
||||||
{
|
{
|
||||||
$PSQL = new Postgres('postgres', \devilbox\Docker::getInstance()->getEnv('POSTGRES_PASSWORD'), $GLOBALS['POSTGRES_HOST_ADDR'], $database);
|
$PSQL = new Postgres('postgres', loadClass('Docker')->getEnv('POSTGRES_PASSWORD'), $GLOBALS['POSTGRES_HOST_ADDR'], $database);
|
||||||
$callback = function ($row, &$data) {
|
$callback = function ($row, &$data) {
|
||||||
$data = $row['count'];
|
$data = $row['count'];
|
||||||
};
|
};
|
||||||
|
1112
.devilbox/www/include/vendor/Mail/PEAR.php
vendored
Normal file
1112
.devilbox/www/include/vendor/Mail/PEAR.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
.gitignore
vendored
1
.gitignore
vendored
@ -31,6 +31,7 @@ cfg/php-fpm-5.5/*.ini
|
|||||||
cfg/php-fpm-5.6/*.ini
|
cfg/php-fpm-5.6/*.ini
|
||||||
cfg/php-fpm-7.0/*.ini
|
cfg/php-fpm-7.0/*.ini
|
||||||
cfg/php-fpm-7.1/*.ini
|
cfg/php-fpm-7.1/*.ini
|
||||||
|
cfg/hhvm-latest/*.ini
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@ env:
|
|||||||
- SERVER=php VERSION=php-fpm-5.6
|
- SERVER=php VERSION=php-fpm-5.6
|
||||||
- SERVER=php VERSION=php-fpm-7.0
|
- SERVER=php VERSION=php-fpm-7.0
|
||||||
- SERVER=php VERSION=php-fpm-7.1
|
- SERVER=php VERSION=php-fpm-7.1
|
||||||
|
- SERVER=php VERSION=hhvm-latest
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
@ -54,6 +55,14 @@ before_install:
|
|||||||
- uname -a
|
- uname -a
|
||||||
|
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
|
||||||
|
# Disable services enabled by default
|
||||||
|
# http://docs.travis-ci.com/user/database-setup/#MySQL
|
||||||
|
- sudo /etc/init.d/mysql stop
|
||||||
|
- sudo /etc/init.d/postgresql stop
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
### Test
|
### Test
|
||||||
###
|
###
|
||||||
|
12
README.md
12
README.md
@ -79,12 +79,12 @@ No need to install and configure different versions locally. Simply choose your
|
|||||||
|
|
||||||
| Webserver | MySQL | PostgreSQL | PHP |
|
| Webserver | MySQL | PostgreSQL | PHP |
|
||||||
|-----------|-------|------------|-----|
|
|-----------|-------|------------|-----|
|
||||||
| [![Build Status](https://travis-ci.org/cytopia/docker-apache-2.2.svg?branch=master)](https://travis-ci.org/cytopia/docker-apache-2.2) [Apache 2.2](https://github.com/cytopia/docker-apache-2.2) | [![Build Status](https://travis-ci.org/cytopia/docker-mysql-5.5.svg?branch=master)](https://travis-ci.org/cytopia/docker-mysql-5.5) [MySQL 5.5](https://github.com/cytopia/docker-mysql-5.5) | [![Build Status](https://travis-ci.org/docker-library/postgres.svg?branch=master)](https://travis-ci.org/docker-library/postgres/branches) [PostgreSQL 9.2](https://hub.docker.com/_/postgres/) | [![Build Status](https://travis-ci.org/cytopia/docker-php-fpm-5.4.svg?branch=master)](https://travis-ci.org/cytopia/docker-php-fpm-5.4) [PHP 5.4](https://github.com/cytopia/docker-php-fpm-5.4) |
|
| [![Build Status](https://travis-ci.org/cytopia/docker-apache-2.2.svg?branch=master)](https://travis-ci.org/cytopia/docker-apache-2.2) [Apache 2.2](https://github.com/cytopia/docker-apache-2.2) | [![Build Status](https://travis-ci.org/cytopia/docker-mysql-5.5.svg?branch=master)](https://travis-ci.org/cytopia/docker-mysql-5.5) [MySQL 5.5](https://github.com/cytopia/docker-mysql-5.5) | [![Build Status](https://travis-ci.org/docker-library/postgres.svg?branch=master)](https://travis-ci.org/docker-library/postgres/branches) [PgSQL 9.2](https://hub.docker.com/_/postgres/) | [![Build Status](https://travis-ci.org/cytopia/docker-php-fpm-5.4.svg?branch=master)](https://travis-ci.org/cytopia/docker-php-fpm-5.4) [PHP 5.4](https://github.com/cytopia/docker-php-fpm-5.4) |
|
||||||
| [![Build Status](https://travis-ci.org/cytopia/docker-apache-2.4.svg?branch=master)](https://travis-ci.org/cytopia/docker-apache-2.4) [Apache 2.4](https://github.com/cytopia/docker-apache-2.4) | [![Build Status](https://travis-ci.org/cytopia/docker-mysql-5.6.svg?branch=master)](https://travis-ci.org/cytopia/docker-mysql-5.6) [MySQL 5.6](https://github.com/cytopia/docker-mysql-5.6) | [![Build Status](https://travis-ci.org/docker-library/postgres.svg?branch=master)](https://travis-ci.org/docker-library/postgres/branches) [PostgreSQL 9.3](https://hub.docker.com/_/postgres/) | [![Build Status](https://travis-ci.org/cytopia/docker-php-fpm-5.5.svg?branch=master)](https://travis-ci.org/cytopia/docker-php-fpm-5.5) [PHP 5.5](https://github.com/cytopia/docker-php-fpm-5.5) |
|
| [![Build Status](https://travis-ci.org/cytopia/docker-apache-2.4.svg?branch=master)](https://travis-ci.org/cytopia/docker-apache-2.4) [Apache 2.4](https://github.com/cytopia/docker-apache-2.4) | [![Build Status](https://travis-ci.org/cytopia/docker-mysql-5.6.svg?branch=master)](https://travis-ci.org/cytopia/docker-mysql-5.6) [MySQL 5.6](https://github.com/cytopia/docker-mysql-5.6) | [![Build Status](https://travis-ci.org/docker-library/postgres.svg?branch=master)](https://travis-ci.org/docker-library/postgres/branches) [PgSQL 9.3](https://hub.docker.com/_/postgres/) | [![Build Status](https://travis-ci.org/cytopia/docker-php-fpm-5.5.svg?branch=master)](https://travis-ci.org/cytopia/docker-php-fpm-5.5) [PHP 5.5](https://github.com/cytopia/docker-php-fpm-5.5) |
|
||||||
| [![Build Status](https://travis-ci.org/cytopia/docker-nginx-stable.svg?branch=master)](https://travis-ci.org/cytopia/docker-nginx-stable) [Nginx stable](https://github.com/cytopia/docker-nginx-stable) | [![Build Status](https://travis-ci.org/cytopia/docker-mysql-5.7.svg?branch=master)](https://travis-ci.org/cytopia/docker-mysql-5.7) [MySQL 5.7](https://github.com/cytopia/docker-mysql-5.7) | [![Build Status](https://travis-ci.org/docker-library/postgres.svg?branch=master)](https://travis-ci.org/docker-library/postgres/branches) [PostgreSQL 9.4](https://hub.docker.com/_/postgres/) | [![Build Status](https://travis-ci.org/cytopia/docker-php-fpm-5.6.svg?branch=master)](https://travis-ci.org/cytopia/docker-php-fpm-5.6) [PHP 5.6](https://github.com/cytopia/docker-php-fpm-5.6) |
|
| [![Build Status](https://travis-ci.org/cytopia/docker-nginx-stable.svg?branch=master)](https://travis-ci.org/cytopia/docker-nginx-stable) [Nginx stable](https://github.com/cytopia/docker-nginx-stable) | [![Build Status](https://travis-ci.org/cytopia/docker-mysql-5.7.svg?branch=master)](https://travis-ci.org/cytopia/docker-mysql-5.7) [MySQL 5.7](https://github.com/cytopia/docker-mysql-5.7) | [![Build Status](https://travis-ci.org/docker-library/postgres.svg?branch=master)](https://travis-ci.org/docker-library/postgres/branches) [PgSQL 9.4](https://hub.docker.com/_/postgres/) | [![Build Status](https://travis-ci.org/cytopia/docker-php-fpm-5.6.svg?branch=master)](https://travis-ci.org/cytopia/docker-php-fpm-5.6) [PHP 5.6](https://github.com/cytopia/docker-php-fpm-5.6) |
|
||||||
| [![Build Status](https://travis-ci.org/cytopia/docker-nginx-mainline.svg?branch=master)](https://travis-ci.org/cytopia/docker-nginx-mainline) [Nginx mainline](https://github.com/cytopia/docker-nginx-mainline) | [![Build Status](https://travis-ci.org/cytopia/docker-mariadb-5.5.svg?branch=master)](https://travis-ci.org/cytopia/docker-mariadb-5.5) [MariaDB 5.5](https://github.com/cytopia/docker-mariadb-5.5) | [![Build Status](https://travis-ci.org/docker-library/postgres.svg?branch=master)](https://travis-ci.org/docker-library/postgres/branches) [PostgreSQL 9.5](https://hub.docker.com/_/postgres/) | [![Build Status](https://travis-ci.org/cytopia/docker-php-fpm-7.0.svg?branch=master)](https://travis-ci.org/cytopia/docker-php-fpm-7.0) [PHP 7.0](https://github.com/cytopia/docker-php-fpm-7.0) |
|
| [![Build Status](https://travis-ci.org/cytopia/docker-nginx-mainline.svg?branch=master)](https://travis-ci.org/cytopia/docker-nginx-mainline) [Nginx mainline](https://github.com/cytopia/docker-nginx-mainline) | [![Build Status](https://travis-ci.org/cytopia/docker-mariadb-5.5.svg?branch=master)](https://travis-ci.org/cytopia/docker-mariadb-5.5) [MariaDB 5.5](https://github.com/cytopia/docker-mariadb-5.5) | [![Build Status](https://travis-ci.org/docker-library/postgres.svg?branch=master)](https://travis-ci.org/docker-library/postgres/branches) [PgSQL 9.5](https://hub.docker.com/_/postgres/) | [![Build Status](https://travis-ci.org/cytopia/docker-php-fpm-7.0.svg?branch=master)](https://travis-ci.org/cytopia/docker-php-fpm-7.0) [PHP 7.0](https://github.com/cytopia/docker-php-fpm-7.0) |
|
||||||
| | [![Build Status](https://travis-ci.org/cytopia/docker-mariadb-10.0.svg?branch=master)](https://travis-ci.org/cytopia/docker-mariadb-10.0) [MariaDB 10.0](https://github.com/cytopia/docker-mariadb-10.0) | [![Build Status](https://travis-ci.org/docker-library/postgres.svg?branch=master)](https://travis-ci.org/docker-library/postgres/branches) [PostgreSQL 9.6](https://hub.docker.com/_/postgres/) | [![Build Status](https://travis-ci.org/cytopia/docker-php-fpm-7.1.svg?branch=master)](https://travis-ci.org/cytopia/docker-php-fpm-7.1) [PHP 7.1](https://github.com/cytopia/docker-php-fpm-7.1) |
|
| | [![Build Status](https://travis-ci.org/cytopia/docker-mariadb-10.0.svg?branch=master)](https://travis-ci.org/cytopia/docker-mariadb-10.0) [MariaDB 10.0](https://github.com/cytopia/docker-mariadb-10.0) | [![Build Status](https://travis-ci.org/docker-library/postgres.svg?branch=master)](https://travis-ci.org/docker-library/postgres/branches) [PgSQL 9.6](https://hub.docker.com/_/postgres/) | [![Build Status](https://travis-ci.org/cytopia/docker-php-fpm-7.1.svg?branch=master)](https://travis-ci.org/cytopia/docker-php-fpm-7.1) [PHP 7.1](https://github.com/cytopia/docker-php-fpm-7.1) |
|
||||||
| | [![Build Status](https://travis-ci.org/cytopia/docker-mariadb-10.1.svg?branch=master)](https://travis-ci.org/cytopia/docker-mariadb-10.1) [MariaDB 10.1](https://github.com/cytopia/docker-mariadb-10.1) | |
|
| | [![Build Status](https://travis-ci.org/cytopia/docker-mariadb-10.1.svg?branch=master)](https://travis-ci.org/cytopia/docker-mariadb-10.1) [MariaDB 10.1](https://github.com/cytopia/docker-mariadb-10.1) | | [![Build Status](https://travis-ci.org/cytopia/docker-hhvm-latest.svg?branch=master)](https://travis-ci.org/cytopia/docker-hhvm-latest) [HHVM latest](https://github.com/cytopia/docker-hhvm-latest)
|
||||||
| | [![Build Status](https://travis-ci.org/cytopia/docker-mariadb-10.2.svg?branch=master)](https://travis-ci.org/cytopia/docker-mariadb-10.2) [MariaDB 10.2](https://github.com/cytopia/docker-mariadb-10.2) | |
|
| | [![Build Status](https://travis-ci.org/cytopia/docker-mariadb-10.2.svg?branch=master)](https://travis-ci.org/cytopia/docker-mariadb-10.2) [MariaDB 10.2](https://github.com/cytopia/docker-mariadb-10.2) | |
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,273 +26,271 @@ version: '2'
|
|||||||
################################################################################
|
################################################################################
|
||||||
services:
|
services:
|
||||||
|
|
||||||
# ----------------------------------------
|
# ----------------------------------------
|
||||||
# HTTP
|
# HTTP
|
||||||
# ----------------------------------------
|
# ----------------------------------------
|
||||||
httpd:
|
httpd:
|
||||||
image: cytopia/${HTTPD_SERVER}:0.8
|
image: cytopia/${HTTPD_SERVER}:latest
|
||||||
|
|
||||||
# Manually build via `docker-compose build`
|
# Manually build via `docker-compose build`
|
||||||
#build:
|
#build:
|
||||||
#context: https://github.com/cytopia/docker-${HTTPD_SERVER}.git#1
|
#context: https://github.com/cytopia/docker-${HTTPD_SERVER}.git#1
|
||||||
# context: https://github.com/cytopia/docker-${HTTPD_SERVER}.git
|
# context: https://github.com/cytopia/docker-${HTTPD_SERVER}.git
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
|
||||||
# Show all executed commands during docker entrypoint?
|
# Show all executed commands during docker entrypoint?
|
||||||
- DEBUG_COMPOSE_ENTRYPOINT=${DEBUG_COMPOSE_ENTRYPOINT}
|
- DEBUG_COMPOSE_ENTRYPOINT=${DEBUG_COMPOSE_ENTRYPOINT}
|
||||||
|
|
||||||
# Adjust timezone
|
# Adjust timezone
|
||||||
- TIMEZONE=${TIMEZONE}
|
- TIMEZONE=${TIMEZONE}
|
||||||
|
|
||||||
# Enable PHP-FPM support
|
# Enable PHP-FPM support
|
||||||
- PHP_FPM_ENABLE=1
|
- PHP_FPM_ENABLE=1
|
||||||
- PHP_FPM_SERVER_ADDR=172.16.238.11
|
- PHP_FPM_SERVER_ADDR=172.16.238.11
|
||||||
- PHP_FPM_SERVER_PORT=9000
|
- PHP_FPM_SERVER_PORT=9000
|
||||||
|
|
||||||
# Tell the webserver to look into this directory
|
# Tell the webserver to look into this directory
|
||||||
# for additional configuration files.
|
# for additional configuration files.
|
||||||
#
|
#
|
||||||
# @see volumes:: - ./etc/${HTTPD_SERVER}:/etc/${HTTPD_SERVER}
|
# @see volumes:: - ./etc/${HTTPD_SERVER}:/etc/${HTTPD_SERVER}
|
||||||
- CUSTOM_HTTPD_CONF_DIR=/etc/${HTTPD_SERVER}
|
- CUSTOM_HTTPD_CONF_DIR=/etc/${HTTPD_SERVER}
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
# ---- Format: ----
|
# ---- Format: ----
|
||||||
# [HOST-ADDR : ] HOST-PORT : DOCKER-PORT
|
# [HOST-ADDR : ] HOST-PORT : DOCKER-PORT
|
||||||
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_HTTPD}:80"
|
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_HTTPD}:80"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
app_net:
|
app_net:
|
||||||
ipv4_address: 172.16.238.10
|
ipv4_address: 172.16.238.10
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
# ---- Format: ----
|
# ---- Format: ----
|
||||||
# HOST-DIRECTORY : DOCKER-DIRECTORY
|
# HOST-DIRECTORY : DOCKER-DIRECTORY
|
||||||
|
|
||||||
# Custom scripts/binaries required for httpd server vhost
|
# Custom scripts/binaries required for httpd server vhost
|
||||||
# configuration to work.
|
# configuration to work.
|
||||||
# (configured in /etc/${HTTPD_SERVER}/02-vhost-mass.conf)
|
# (configured in /etc/${HTTPD_SERVER}/02-vhost-mass.conf)
|
||||||
- ${DEVILBOX_PATH}/.devilbox/bin/${HTTPD_SERVER}:/opt/bin:ro
|
- ${DEVILBOX_PATH}/.devilbox/bin/${HTTPD_SERVER}:/opt/bin:ro
|
||||||
|
|
||||||
# Mount user-defined httpd configuration files
|
# Mount user-defined httpd configuration files
|
||||||
# @see environment::CUSTOM_HTTPD_CONF_DIR for how this
|
# @see environment::CUSTOM_HTTPD_CONF_DIR for how this
|
||||||
# is added in httpd server
|
# is added in httpd server
|
||||||
- ${DEVILBOX_PATH}/.devilbox/etc/${HTTPD_SERVER}:/etc/${HTTPD_SERVER}:ro
|
- ${DEVILBOX_PATH}/.devilbox/etc/${HTTPD_SERVER}:/etc/${HTTPD_SERVER}:ro
|
||||||
|
|
||||||
# Mount custom intranet
|
# Mount custom intranet
|
||||||
# (configured in /etc/${HTTPD_SERVER}/01-vhost-default.conf)
|
# (configured in /etc/${HTTPD_SERVER}/01-vhost-default.conf)
|
||||||
- ${DEVILBOX_PATH}/.devilbox/www:/var/www/default:ro
|
- ${DEVILBOX_PATH}/.devilbox/www:/var/www/default:ro
|
||||||
|
|
||||||
# Mount user-defined httpd log
|
# Mount user-defined httpd log
|
||||||
# @see ./etc/${HTTPD_SERVER}/*.conf for log defines
|
# @see ./etc/${HTTPD_SERVER}/*.conf for log defines
|
||||||
- ${DEVILBOX_PATH}/log/${HTTPD_SERVER}:/var/log/${HTTPD_SERVER}
|
- ${DEVILBOX_PATH}/log/${HTTPD_SERVER}:/var/log/${HTTPD_SERVER}
|
||||||
|
|
||||||
# Mount custom mass virtual hosting
|
# Mount custom mass virtual hosting
|
||||||
# (configured in /etc/${HTTPD_SERVER}/02-vhost-mass.conf)
|
# (configured in /etc/${HTTPD_SERVER}/02-vhost-mass.conf)
|
||||||
- ${HOST_PATH_TO_WWW_DOCROOTS}:/shared/httpd:ro
|
- ${HOST_PATH_TO_WWW_DOCROOTS}:/shared/httpd:ro
|
||||||
|
|
||||||
links:
|
links:
|
||||||
# ---- Format: ----
|
# ---- Format: ----
|
||||||
# SERVICE [ : ALIAS]
|
# SERVICE [ : ALIAS]
|
||||||
- "php:php-fpm"
|
- "php:php-fpm"
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------------------------------
|
||||||
# ----------------------------------------
|
# PHP-FPM
|
||||||
# PHP-FPM
|
# ----------------------------------------
|
||||||
# ----------------------------------------
|
php:
|
||||||
php:
|
# TODO: remove latest, once it is ready for the next release
|
||||||
# TODO: remove latest, once it is ready for the next release
|
image: cytopia/${PHP_SERVER}:latest
|
||||||
image: cytopia/${PHP_SERVER}:latest
|
|
||||||
|
# Manually build via `docker-compose build`
|
||||||
# Manually build via `docker-compose build`
|
#build:
|
||||||
#build:
|
#context: https://github.com/cytopia/docker-${PHP_SERVER}.git#1
|
||||||
#context: https://github.com/cytopia/docker-${PHP_SERVER}.git#1
|
# context: https://github.com/cytopia/docker-${PHP_SERVER}.git
|
||||||
# context: https://github.com/cytopia/docker-${PHP_SERVER}.git
|
|
||||||
|
environment:
|
||||||
environment:
|
|
||||||
|
# Show all executed commands during docker entrypoint?
|
||||||
# Show all executed commands during docker entrypoint?
|
- DEBUG_COMPOSE_ENTRYPOINT=${DEBUG_COMPOSE_ENTRYPOINT}
|
||||||
- DEBUG_COMPOSE_ENTRYPOINT=${DEBUG_COMPOSE_ENTRYPOINT}
|
|
||||||
|
# Adjust timezone
|
||||||
# Adjust timezone
|
- TIMEZONE=${TIMEZONE}
|
||||||
- TIMEZONE=${TIMEZONE}
|
|
||||||
|
##
|
||||||
##
|
## PHP Xdebug
|
||||||
## PHP Xdebug
|
##
|
||||||
##
|
- PHP_XDEBUG_ENABLE=${PHP_XDEBUG_ENABLE}
|
||||||
- PHP_XDEBUG_ENABLE=${PHP_XDEBUG_ENABLE}
|
- PHP_XDEBUG_REMOTE_PORT=${PHP_XDEBUG_REMOTE_PORT}
|
||||||
- PHP_XDEBUG_REMOTE_PORT=${PHP_XDEBUG_REMOTE_PORT}
|
- PHP_XDEBUG_REMOTE_HOST=${PHP_XDEBUG_REMOTE_HOST}
|
||||||
- PHP_XDEBUG_REMOTE_HOST=${PHP_XDEBUG_REMOTE_HOST}
|
|
||||||
|
##
|
||||||
|
## Postfix on
|
||||||
|
##
|
||||||
|
- ENABLE_MAIL=1
|
||||||
|
|
||||||
|
##
|
||||||
|
## Map remote MySQL Port to 127.0.0.1
|
||||||
|
##
|
||||||
|
- FORWARD_MYSQL_PORT_TO_LOCALHOST=1
|
||||||
|
- MYSQL_REMOTE_ADDR=172.16.238.12
|
||||||
|
- MYSQL_REMOTE_PORT=3306
|
||||||
|
- MYSQL_LOCAL_PORT=3306
|
||||||
|
|
||||||
##
|
##
|
||||||
## Postfix on
|
## Mount remote MySQL socket file to local disk
|
||||||
##
|
##
|
||||||
- ENABLE_MAIL=1
|
- MOUNT_MYSQL_SOCKET_TO_LOCALDISK=1
|
||||||
|
- MYSQL_SOCKET_PATH=/tmp/mysql/mysqld.sock
|
||||||
|
|
||||||
|
##
|
||||||
|
## Map remote PostgreSQL Port to 127.0.0.1
|
||||||
|
##
|
||||||
|
# TODO
|
||||||
|
|
||||||
|
##
|
||||||
|
## Mount remote PostgreSQL socket file to local disk
|
||||||
|
##
|
||||||
|
# TODO
|
||||||
|
|
||||||
##
|
##
|
||||||
## Map remote MySQL Port to 127.0.0.1
|
## Additional variables needed by custom intranet
|
||||||
##
|
##
|
||||||
- FORWARD_MYSQL_PORT_TO_LOCALHOST=1
|
- HOST_PATH_TO_WWW_DOCROOTS=${HOST_PATH_TO_WWW_DOCROOTS}
|
||||||
- MYSQL_REMOTE_ADDR=172.16.238.12
|
- HOST_PORT_HTTPD=${HOST_PORT_HTTPD}
|
||||||
- MYSQL_REMOTE_PORT=3306
|
- HOST_PATH_TO_MYSQL_DATADIR=${HOST_PATH_TO_MYSQL_DATADIR}
|
||||||
- MYSQL_LOCAL_PORT=3306
|
- HOST_PATH_TO_POSTGRES_DATADIR=${HOST_PATH_TO_POSTGRES_DATADIR}
|
||||||
|
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
||||||
|
- POSTGRES_USER=${POSTGRES_USER}
|
||||||
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||||
|
|
||||||
##
|
networks:
|
||||||
## Mount remote MySQL socket file to local disk
|
app_net:
|
||||||
##
|
ipv4_address: 172.16.238.11
|
||||||
- MOUNT_MYSQL_SOCKET_TO_LOCALDISK=1
|
|
||||||
- MYSQL_SOCKET_PATH=/tmp/mysql/mysqld.sock
|
|
||||||
|
|
||||||
##
|
volumes:
|
||||||
## Map remote PostgreSQL Port to 127.0.0.1
|
# ---- Format: ----
|
||||||
##
|
# HOST-DIRECTORY : DOCKER-DIRECTORY
|
||||||
# TODO
|
|
||||||
|
|
||||||
##
|
# Mount custom intranet
|
||||||
## Mount remote PostgreSQL socket file to local disk
|
# (configured in /etc/${HTTPD_SERVER}/01-vhost-default.conf)
|
||||||
##
|
- ${DEVILBOX_PATH}/.devilbox/www:/var/www/default:ro
|
||||||
# TODO
|
|
||||||
|
|
||||||
##
|
# Mount logs
|
||||||
## Additional variables needed by custom intranet
|
- ${DEVILBOX_PATH}/log/${PHP_SERVER}:/var/log/php-fpm
|
||||||
##
|
|
||||||
- HOST_PATH_TO_WWW_DOCROOTS=${HOST_PATH_TO_WWW_DOCROOTS}
|
|
||||||
- HOST_PORT_HTTPD=${HOST_PORT_HTTPD}
|
|
||||||
- HOST_PATH_TO_MYSQL_DATADIR=${HOST_PATH_TO_MYSQL_DATADIR}
|
|
||||||
- HOST_PATH_TO_POSTGRES_DATADIR=${HOST_PATH_TO_POSTGRES_DATADIR}
|
|
||||||
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
|
||||||
- POSTGRES_USER=${POSTGRES_USER}
|
|
||||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
|
||||||
|
|
||||||
networks:
|
# Mount MySQL Socket directory
|
||||||
app_net:
|
- ${DEVILBOX_PATH}/run/mysql:/tmp/mysql
|
||||||
ipv4_address: 172.16.238.11
|
|
||||||
|
|
||||||
volumes:
|
# Mount Mail directory
|
||||||
# ---- Format: ----
|
- ${DEVILBOX_PATH}/run/mail:/var/mail
|
||||||
# HOST-DIRECTORY : DOCKER-DIRECTORY
|
|
||||||
|
|
||||||
# Mount custom intranet
|
# Mount devilbox user-defined *.ini files in order
|
||||||
# (configured in /etc/${HTTPD_SERVER}/01-vhost-default.conf)
|
# to overwrite the default PHP configuration
|
||||||
- ${DEVILBOX_PATH}/.devilbox/www:/var/www/default:ro
|
- ${DEVILBOX_PATH}/cfg/${PHP_SERVER}:/etc/php-custom.d:ro
|
||||||
|
|
||||||
# Mount logs
|
|
||||||
- ${DEVILBOX_PATH}/log/${PHP_SERVER}:/var/log/php-fpm
|
|
||||||
|
|
||||||
# Mount MySQL Socket directory
|
# Mount custom mass virtual hosting
|
||||||
- ${DEVILBOX_PATH}/run/mysql:/tmp/mysql
|
# (configured in /etc/${HTTPD_SERVER}/02-vhost-mass.conf)
|
||||||
|
- ${HOST_PATH_TO_WWW_DOCROOTS}:/shared/httpd
|
||||||
|
|
||||||
# Mount Mail directory
|
|
||||||
- ${DEVILBOX_PATH}/run/mail:/var/mail
|
|
||||||
|
|
||||||
# Mount devilbox user-defined *.ini files in order
|
links:
|
||||||
# to overwrite the default PHP configuration
|
# ---- Format: ----
|
||||||
- ${DEVILBOX_PATH}/cfg/${PHP_SERVER}:/etc/php-custom.d:ro
|
# SERVICE [ : ALIAS]
|
||||||
|
- "mysql:mariadb"
|
||||||
|
- "postgres:postgresql"
|
||||||
|
|
||||||
|
|
||||||
# Mount custom mass virtual hosting
|
# ----------------------------------------
|
||||||
# (configured in /etc/${HTTPD_SERVER}/02-vhost-mass.conf)
|
# DATABASE
|
||||||
- ${HOST_PATH_TO_WWW_DOCROOTS}:/shared/httpd
|
# ----------------------------------------
|
||||||
|
mysql:
|
||||||
|
image: cytopia/${MYSQL_SERVER}:latest
|
||||||
|
|
||||||
|
# Manually build via `docker-compose build`
|
||||||
|
#build:
|
||||||
|
#context: https://github.com/cytopia/docker-${MYSQL_SERVER}.git#1
|
||||||
|
# context: https://github.com/cytopia/docker-${MYSQL_SERVER}.git
|
||||||
|
|
||||||
links:
|
environment:
|
||||||
# ---- Format: ----
|
|
||||||
# SERVICE [ : ALIAS]
|
|
||||||
- "mysql:mariadb"
|
|
||||||
- "postgres:postgresql"
|
|
||||||
|
|
||||||
|
# Show all executed commands during docker entrypoint?
|
||||||
|
- DEBUG_COMPOSE_ENTRYPOINT=${DEBUG_COMPOSE_ENTRYPOINT}
|
||||||
|
|
||||||
|
# Adjust timezone
|
||||||
|
- TIMEZONE=${TIMEZONE}
|
||||||
|
|
||||||
# ----------------------------------------
|
|
||||||
# DATABASE
|
|
||||||
# ----------------------------------------
|
|
||||||
mysql:
|
|
||||||
image: cytopia/${MYSQL_SERVER}:0.8
|
|
||||||
|
|
||||||
# Manually build via `docker-compose build`
|
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
||||||
#build:
|
- MYSQL_SOCKET_DIR=/tmp/mysql
|
||||||
#context: https://github.com/cytopia/docker-${MYSQL_SERVER}.git#1
|
|
||||||
# context: https://github.com/cytopia/docker-${MYSQL_SERVER}.git
|
|
||||||
|
|
||||||
environment:
|
# Runtime settings
|
||||||
|
- MYSQL_GENERAL_LOG=${MYSQL_GENERAL_LOG}
|
||||||
|
|
||||||
# Show all executed commands during docker entrypoint?
|
ports:
|
||||||
- DEBUG_COMPOSE_ENTRYPOINT=${DEBUG_COMPOSE_ENTRYPOINT}
|
# [local-machine:]local-port:docker-port
|
||||||
|
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_MYSQL}:3306"
|
||||||
|
|
||||||
# Adjust timezone
|
networks:
|
||||||
- TIMEZONE=${TIMEZONE}
|
app_net:
|
||||||
|
ipv4_address: 172.16.238.12
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
# ---- Format: ----
|
||||||
|
# HOST-DIRECTORY : DOCKER-DIRECTORY
|
||||||
|
|
||||||
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
# Mount logs
|
||||||
- MYSQL_SOCKET_DIR=/tmp/mysql
|
- ${DEVILBOX_PATH}/log/${MYSQL_SERVER}:/var/log/mysql
|
||||||
|
|
||||||
# Runtime settings
|
# Mount MySQL Socket directory
|
||||||
- MYSQL_GENERAL_LOG=${MYSQL_GENERAL_LOG}
|
- ${DEVILBOX_PATH}/run/mysql:/tmp/mysql
|
||||||
|
|
||||||
ports:
|
# Mount devilbox user-defined cnf files in order
|
||||||
# [local-machine:]local-port:docker-port
|
# to overwrite the MySQL server configuration
|
||||||
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_MYSQL}:3306"
|
- ${DEVILBOX_PATH}/cfg/${MYSQL_SERVER}:/etc/mysql/conf.d:ro
|
||||||
|
|
||||||
networks:
|
# Mount MySQL Data directory
|
||||||
app_net:
|
- ${HOST_PATH_TO_MYSQL_DATADIR}:/var/lib/mysql
|
||||||
ipv4_address: 172.16.238.12
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
# ---- Format: ----
|
|
||||||
# HOST-DIRECTORY : DOCKER-DIRECTORY
|
|
||||||
|
|
||||||
# Mount logs
|
# ----------------------------------------
|
||||||
- ${DEVILBOX_PATH}/log/${MYSQL_SERVER}:/var/log/mysql
|
# POSTGRES
|
||||||
|
# ----------------------------------------
|
||||||
|
postgres:
|
||||||
|
image: postgres:${POSTGRES_SERVER}
|
||||||
|
|
||||||
# Mount MySQL Socket directory
|
# Manually build via `docker-compose build`
|
||||||
- ${DEVILBOX_PATH}/run/mysql:/tmp/mysql
|
#build:
|
||||||
|
#context: https://github.com/cytopia/docker-${MYSQL_SERVER}.git#1
|
||||||
|
# context: https://github.com/cytopia/docker-${MYSQL_SERVER}.git
|
||||||
|
|
||||||
# Mount devilbox user-defined cnf files in order
|
environment:
|
||||||
# to overwrite the MySQL server configuration
|
|
||||||
- ${DEVILBOX_PATH}/cfg/${MYSQL_SERVER}:/etc/mysql/conf.d:ro
|
|
||||||
|
|
||||||
# Mount MySQL Data directory
|
- POSTGRES_USER=${POSTGRES_USER}
|
||||||
- ${HOST_PATH_TO_MYSQL_DATADIR}:/var/lib/mysql
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||||
|
- PGDATA=/var/lib/postgresql/data/pgdata
|
||||||
|
|
||||||
|
ports:
|
||||||
|
# [local-machine:]local-port:docker-port
|
||||||
|
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_POSTGRES}:5432"
|
||||||
|
|
||||||
# ----------------------------------------
|
networks:
|
||||||
# POSTGRES
|
app_net:
|
||||||
# ----------------------------------------
|
ipv4_address: 172.16.238.13
|
||||||
postgres:
|
|
||||||
image: postgres:${POSTGRES_SERVER}
|
|
||||||
|
|
||||||
# Manually build via `docker-compose build`
|
volumes:
|
||||||
#build:
|
# ---- Format: ----
|
||||||
#context: https://github.com/cytopia/docker-${MYSQL_SERVER}.git#1
|
# HOST-DIRECTORY : DOCKER-DIRECTORY
|
||||||
# context: https://github.com/cytopia/docker-${MYSQL_SERVER}.git
|
|
||||||
|
|
||||||
environment:
|
# Mount logs
|
||||||
|
- ${DEVILBOX_PATH}/log/postgres-${POSTGRES_SERVER}:/var/log/postgresql
|
||||||
|
|
||||||
- POSTGRES_USER=${POSTGRES_USER}
|
# Mount PostgreSQL Socket directory
|
||||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
- ${DEVILBOX_PATH}/run/postgres:/var/run/postgresql
|
||||||
- PGDATA=/var/lib/postgresql/data/pgdata
|
|
||||||
|
|
||||||
ports:
|
# Mount PostgreSQL Data directory
|
||||||
# [local-machine:]local-port:docker-port
|
- ${HOST_PATH_TO_POSTGRES_DATADIR}:/var/lib/postgresql/data/pgdata
|
||||||
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_POSTGRES}:5432"
|
|
||||||
|
|
||||||
networks:
|
|
||||||
app_net:
|
|
||||||
ipv4_address: 172.16.238.13
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
# ---- Format: ----
|
|
||||||
# HOST-DIRECTORY : DOCKER-DIRECTORY
|
|
||||||
|
|
||||||
# Mount logs
|
|
||||||
- ${DEVILBOX_PATH}/log/postgres-${POSTGRES_SERVER}:/var/log/postgresql
|
|
||||||
|
|
||||||
# Mount PostgreSQL Socket directory
|
|
||||||
- ${DEVILBOX_PATH}/run/postgres:/var/run/postgresql
|
|
||||||
|
|
||||||
# Mount PostgreSQL Data directory
|
|
||||||
- ${HOST_PATH_TO_POSTGRES_DATADIR}:/var/lib/postgresql/data/pgdata
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -306,5 +304,5 @@ networks:
|
|||||||
ipam:
|
ipam:
|
||||||
driver: default
|
driver: default
|
||||||
config:
|
config:
|
||||||
- subnet: 172.16.238.0/24
|
- subnet: 172.16.238.0/24
|
||||||
gateway: 172.16.238.1
|
gateway: 172.16.238.1
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
###
|
###
|
||||||
### 1: Yes
|
### 1: Yes
|
||||||
### 0: No
|
### 0: No
|
||||||
DEBUG_COMPOSE_ENTRYPOINT=0
|
DEBUG_COMPOSE_ENTRYPOINT=1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -96,8 +96,7 @@ POSTGRES_SERVER=9.6
|
|||||||
#PHP_SERVER=php-fpm-5.6
|
#PHP_SERVER=php-fpm-5.6
|
||||||
PHP_SERVER=php-fpm-7.0
|
PHP_SERVER=php-fpm-7.0
|
||||||
#PHP_SERVER=php-fpm-7.1
|
#PHP_SERVER=php-fpm-7.1
|
||||||
#PHP_SERVER=hhvm-3
|
#PHP_SERVER=hhvm-latest
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
|
Loading…
Reference in New Issue
Block a user