<?php
require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');

list($tld, $domain, $subdomain, $subdomain2) = array_reverse(explode('.', $_SERVER['HTTP_HOST']));

//Set subdomains that should point to backend
$backendIndicators = array(
    'admin'
//    ,'administracja'
);
$app = (in_array($subdomain,$backendIndicators) || in_array($subdomain2,$backendIndicators)) ? 'backend' : 'frontend';  //if subdomain or subdomain2 equals backendIndicator - point to backend, in every other condition - point to frontend

$configuration = ProjectConfiguration::getApplicationConfiguration($app, 'prod', false);    //switch apps based on $app
sfContext::createInstance($configuration)->dispatch();

//if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.') === true)
//{
//    echo 'IE 6';
//}
//else
//{
//    echo 'Superaśnie ';
//}
