Created
July 4, 2013 13:23
-
-
Save gmann1982/5927691 to your computer and use it in GitHub Desktop.
main config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors', 1); | |
include 'Mobile_Detect.php'; | |
$detect = new Mobile_Detect(); | |
require_once('php-activerecord/ActiveRecord.php'); | |
// require_once 'vendor/autoload.php'; | |
require_once('classLoader.php'); | |
define('BASEDIR', dirname(__file__)); | |
define('BASEURL', 'http://'.$_SERVER['SERVER_NAME']); | |
include 'functions.php'; | |
ActiveRecord\config::initialize(function($cfg){ | |
$cfg->set_model_directory(BASEDIR.'/models'); | |
$cfg->set_connections(array( | |
'development' => 'mysql://root:root@localhost/fonesites', | |
'production' => 'mysql://root:Keeper132@localhost/fonesites' | |
)); | |
}); | |
$domain = $domain = Domain::find_by_url($_SERVER['SERVER_NAME']); | |
$domain_id = $domain->id; | |
define('DOMAIN_ID', $domain_id); | |
define('DOMAIN_NAME', $domain->url); | |
define('THEME_ID', $domain->template_id); | |
//define('ANALYTICS_CODE', $domain->analytics_code); | |
define('ADVERTS', $domain->ads); | |
$template = Template::getTheme(); | |
define('THEME', $template->template_path); | |
if($detect->isMobile()){ | |
echo "<script type='text/javascript'>window.location='http://" . str_replace('www.', 'm.', DOMAIN_NAME) . "';</script>"; | |
} | |
include 'routes.php'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment