<?php
/*  GET VARIABLES FOR DEBUGING
 * 	
 * 	&debug = 1;  run debug mode, display errors 
 *  &nodebug =   debug mode off 
 *  &nocache = cleare cache in your shop
 */

/** @see \Core::debug */
/** @see \Core::cache */

if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
    $_SERVER['HTTPS'] = 'on';
}

include_once(dirname(__FILE__) . '/app/frame/core/Core.php');

define('PARTNER_USER_ID', 1000);
define('DEFAULT_PILL', 1);
define('BESTSELLERS', 36);
define('MENS_ED_PACKS', 11);
define('ED_CATEGORY', 31);
define('SHOP_MODE', 'production');

$server = Core::getServerName();

if ($_SERVER['REQUEST_URI'] == '/robots.txt') {
    header("Content-Type: text/plain");
    $file    = dirname(__FILE__) . '/configs/' . $server . '/data/robots.txt';
    $content = file_get_contents($file);
    echo trim($content);
    die;
}

if ($_SERVER['REQUEST_URI'] == '/sitemap.xml') {
    header("Content-Type: text/xml");
    $file    = dirname(__FILE__) . '/configs/' . $server . '/data/sitemap.xml';
    $content = file_get_contents($file);
    $content = htmlspecialchars_decode($content);
    echo trim($content);
    die;
}

Core::getInstance(array(
    'app'           => 'frontend3',
    'server'        => $server,
    'cookie'        => $server,
    'model'         => 'production3',
    'document_root' => dirname(__FILE__) . '/',
    'app_root'      => dirname(__FILE__) . '/app/',
))->proccess();
