devilbox/.devilbox/www/config.php

54 lines
1.2 KiB
PHP
Raw Normal View History

2016-10-09 16:47:49 +00:00
<?PHP
2016-11-06 12:36:07 +00:00
// Measure time
$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';
$VEN_DIR = $INCL_DIR . DIRECTORY_SEPARATOR . 'include';
$LOG_DIR = dirname(dirname($CONF_DIR)) . DIRECTORY_SEPARATOR . 'log' . DIRECTORY_SEPARATOR . 'devilbox';
2016-10-09 16:47:49 +00:00
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
$MYSQL_HOST_NAME = 'db';
$MYSQL_HOST_ADDR = gethostbyname($MYSQL_HOST_NAME);
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';
//
// Instantiate Basics
//
$Logger = \devilbox\Logger::getInstance();
$Docker = \devilbox\Docker::getInstance();
$MySQL = \devilbox\Mysql::getInstance('root', $Docker->getEnv('MYSQL_ROOT_PASSWORD'), $MYSQL_HOST_ADDR);
2016-10-09 16:47:49 +00:00
2016-11-06 12:36:07 +00:00
// VirtualHost DNS check
// Temporarily disable due to:
// https://github.com/cytopia/devilbox/issues/8
$ENABLE_VHOST_DNS_CHECK = false;