2016-10-09 16:47:49 +00:00
|
|
|
<?PHP
|
2016-11-06 12:36:07 +00:00
|
|
|
// Measure time
|
2016-10-11 13:45:21 +00:00
|
|
|
$TIME_START = microtime(true);
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2016-11-06 12:36:07 +00:00
|
|
|
// PHP Error reporting
|
|
|
|
error_reporting(-1);
|
2016-10-09 16:47:49 +00:00
|
|
|
|
|
|
|
|
2016-11-06 12:36:07 +00:00
|
|
|
//
|
|
|
|
// Set Directories
|
|
|
|
//
|
|
|
|
$CONF_DIR = dirname(__FILE__);
|
|
|
|
$INCL_DIR = $CONF_DIR . DIRECTORY_SEPARATOR . 'include';
|
|
|
|
$LIB_DIR = $INCL_DIR . DIRECTORY_SEPARATOR . 'lib';
|
2016-11-06 16:20:51 +00:00
|
|
|
$VEN_DIR = $INCL_DIR . DIRECTORY_SEPARATOR . 'vendor';
|
2016-11-06 12:36:07 +00:00
|
|
|
$LOG_DIR = dirname(dirname($CONF_DIR)) . DIRECTORY_SEPARATOR . 'log' . DIRECTORY_SEPARATOR . 'devilbox';
|
2016-10-09 16:47:49 +00:00
|
|
|
|
|
|
|
|
2016-11-06 12:57:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* TLD suffix for mass virtual hosts.
|
|
|
|
*
|
|
|
|
* This is currently hardcoded and must be changed here
|
|
|
|
* as well as in the webserver config.
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
$TLD_SUFFIX = 'loc';
|
|
|
|
|
|
|
|
|
2016-11-06 12:36:07 +00:00
|
|
|
//
|
|
|
|
// Set Docker addresses
|
|
|
|
//
|
2016-10-09 16:47:49 +00:00
|
|
|
$HTTPD_HOST_NAME = 'httpd';
|
|
|
|
$HTTPD_HOST_ADDR = gethostbyname($HTTPD_HOST_NAME);
|
|
|
|
|
2016-11-06 12:36:07 +00:00
|
|
|
$PHP_HOST_NAME = 'php';
|
|
|
|
$PHP_HOST_ADDR = gethostbyname($PHP_HOST_NAME);
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2016-11-15 18:39:34 +00:00
|
|
|
$MYSQL_HOST_NAME = 'mysql';
|
2016-10-09 16:47:49 +00:00
|
|
|
$MYSQL_HOST_ADDR = gethostbyname($MYSQL_HOST_NAME);
|
|
|
|
|
2016-11-15 18:39:34 +00:00
|
|
|
$POSTGRES_HOST_NAME = 'postgres';
|
|
|
|
$POSTGRES_HOST_ADDR = gethostbyname($POSTGRES_HOST_NAME);
|
|
|
|
|
2016-10-11 13:45:21 +00:00
|
|
|
|
2016-11-06 12:36:07 +00:00
|
|
|
//
|
|
|
|
// Load files
|
|
|
|
//
|
|
|
|
require $LIB_DIR . DIRECTORY_SEPARATOR . 'Logger.php';
|
|
|
|
require $LIB_DIR . DIRECTORY_SEPARATOR . 'Docker.php';
|
|
|
|
require $LIB_DIR . DIRECTORY_SEPARATOR . 'Mysql.php';
|
2016-11-15 18:39:34 +00:00
|
|
|
require $LIB_DIR . DIRECTORY_SEPARATOR . 'Postgres.php';
|
2016-11-06 12:36:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Instantiate Basics
|
|
|
|
//
|
2016-11-15 18:39:34 +00:00
|
|
|
$Logger = \devilbox\Logger::getInstance();
|
|
|
|
$Docker = \devilbox\Docker::getInstance();
|
|
|
|
$MySQL = \devilbox\Mysql::getInstance('root', $Docker->getEnv('MYSQL_ROOT_PASSWORD'), $MYSQL_HOST_ADDR);
|
|
|
|
$Postgres = \devilbox\Postgres::getInstance($Docker->getEnv('POSTGRES_USER'), $Docker->getEnv('POSTGRES_PASSWORD'), $POSTGRES_HOST_ADDR);
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2016-10-11 13:45:21 +00:00
|
|
|
|
2016-11-06 12:36:07 +00:00
|
|
|
|
|
|
|
// VirtualHost DNS check
|
|
|
|
// Temporarily disable due to:
|
|
|
|
// https://github.com/cytopia/devilbox/issues/8
|
2016-11-15 18:39:34 +00:00
|
|
|
$ENABLE_VHOST_DNS_CHECK = true;
|