File: D:/HostingSpaces/SBogers10/verrassendveel.komma.pro/wwwroot/config/komma.php
<?php
define('SITE_NAME','Verrassend Veel');
define('DOCUMENT_ROOT',$_SERVER['DOCUMENT_ROOT']);
// Detect environment
if(strpos($_SERVER['HTTP_HOST'],'komma') !== false)
{
define('ENVIRONMENT','development');
}
else if(strpos($_SERVER['HTTP_HOST'],'local') !== false)
{
define('ENVIRONMENT','local');
}
else
{
define('ENVIRONMENT','production');
}
// Error reporting
if(ENVIRONMENT != 'production')
{
error_reporting(E_ALL);
ini_set('display_errors', 1);
}
// Convert old htaccess variables
$uri = substr($_SERVER['REQUEST_URI'],1); // skip the first /
if($uri != '/')
{
// Get all variables
$variables = explode('/',$uri);
// Escape admin
if($variables[0] == 'admin')
{
unset($variables[0]);
$variables = array_values($variables);
}
// Loop through all variables
foreach($variables as $key => $variable)
{
if( empty($variable)) continue;
// First one is page variable
if($key == 0)
{
$_GET['page'] = $variable;
continue;
}
// First sub has no key attached
if($key == 1)
{
$_GET['sub'] = $variable;
continue;
}
// Sub variables
$_GET['sub' . $key] = $variable;
}
}
// Set default timezone
date_default_timezone_set('Europe/Amsterdam');
/**
* Add nice dd function
*
* @param $value
*/
function dd($value)
{
echo '<pre>';
var_dump($value);
exit;
}
/**
* Add komma-ip check
*
* @return bool
*/
function komma_ip()
{
return $_SERVER['REMOTE_ADDR'] == '5.172.219.238';
}