Skip to content

Instantly share code, notes, and snippets.

@ti-ka
Created November 29, 2015 22:21
Show Gist options
  • Save ti-ka/be182766f83833acff7e to your computer and use it in GitHub Desktop.
Save ti-ka/be182766f83833acff7e to your computer and use it in GitHub Desktop.
<?php
define("SERVER_INIT" , microtime(true));
if(!isset($_SESSION)){
session_start();
}
if( ! ini_get('date.timezone') )
{
date_default_timezone_set('America/Chicago');
}
if(!defined("BASE_DIR")){
define("BASE_DIR", dirname(__DIR__));
$parts = explode($_SERVER['DOCUMENT_ROOT'], BASE_DIR);
if(count($parts) === 2){
define("BASE_URL_RELATIVE", $parts[1] . DIRECTORY_SEPARATOR);
} else {
define("BASE_URL_RELATIVE", DIRECTORY_SEPARATOR);
}
define("BASE_URL", $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST']. BASE_URL_RELATIVE);
}
//Grabbing constants
require_once BASE_DIR . '/config/constants.php';
require_once BASE_DIR . '/config/autoloader.php';
require_once BASE_DIR.'/config/routes.php';
require_once BASE_DIR.'/config/helperFunctions.php';
require_once BASE_DIR.'/config/class_alias.php';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment