Erster Stand des mvc-Frameworks
This commit is contained in:
97
.config/config_global.php
Normal file
97
.config/config_global.php
Normal file
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Umgebung definieren
|
||||
*/
|
||||
$environment = getenv('ENVIRONMENT');
|
||||
if ($environment === false)
|
||||
{
|
||||
$tmpPath = __DIR__;
|
||||
$found = false;
|
||||
while ($tmpPath != '/')
|
||||
{
|
||||
$htFile = $tmpPath . '/.htaccess';
|
||||
if (is_file($htFile) && is_readable($htFile))
|
||||
{
|
||||
$htContent = file($htFile);
|
||||
foreach ($htContent as $line => $text)
|
||||
{
|
||||
if (strpos($text, 'SetEnv') !== false && strpos($text, 'ENVIRONMENT') !== false)
|
||||
{
|
||||
$found = true;
|
||||
$environment = trim(str_replace(array('SetEnv', 'ENVIRONMENT'), '', $text));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($found)
|
||||
{
|
||||
break;
|
||||
}
|
||||
$tmpPath = dirname($tmpPath);
|
||||
}
|
||||
}
|
||||
|
||||
define('ENVIRONMENT', $environment);
|
||||
|
||||
if (isset($_SERVER['HTTPS']))
|
||||
{
|
||||
define('SCHEME', 'https');
|
||||
}
|
||||
else
|
||||
{
|
||||
define('SCHEME', 'http');
|
||||
}
|
||||
|
||||
if (ENVIRONMENT === 'local')
|
||||
{
|
||||
define('HOST_URL', SCHEME . '://192.168.178.66/ahd/');
|
||||
define('PATH_PREFIX', '/ahd');
|
||||
}
|
||||
elseif (ENVIRONMENT === 'testing')
|
||||
{
|
||||
define('HOST_URL', SCHEME . '://');
|
||||
}
|
||||
elseif (ENVIRONMENT === 'production')
|
||||
{
|
||||
define('HOST_URL', SCHEME . '://www.ahd-allradhaus.de/');
|
||||
define('PATH_PREFIX', '');
|
||||
}
|
||||
else
|
||||
{
|
||||
die('Umgebungsvariable ist nicht gesetzt!');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Pfade definieren
|
||||
*/
|
||||
define('PATH_ROOT', dirname(__DIR__) . '/');
|
||||
define('PATH_CLS', PATH_ROOT . '.classes/');
|
||||
define('PATH_CNF', PATH_ROOT . '.config/');
|
||||
define('PATH_LIB', PATH_ROOT . 'vendor/');
|
||||
define('PATH_TPL', PATH_ROOT . 'templates/');
|
||||
|
||||
|
||||
/**
|
||||
* Relative URLs für die Templates definieren
|
||||
*/
|
||||
define('HTML_IMG', PATH_PREFIX . '/images/');
|
||||
define('HTML_CSS', PATH_PREFIX . '/css/');
|
||||
|
||||
|
||||
/**
|
||||
* Datenbank konfigurieren
|
||||
*/
|
||||
define('DB_TYPE', 'mysqli');
|
||||
define('DB_HOST', 'localhost');
|
||||
define('DB_NAME', 'ahd_2016');
|
||||
define('DB_USER', 'ahd');
|
||||
define('DB_PASS', '2YcEOiFRUhk5ELeT9gZ3');
|
||||
|
||||
|
||||
/**
|
||||
* Tabellennamen definieren
|
||||
*/
|
||||
define('TBL_FRONT_NAVIGATION', 'ahd_navigation');
|
||||
define('TBL_IMAGE_TEXT', 'ahd_image_text');
|
||||
Reference in New Issue
Block a user