// Allow from any origin
if (isset($_SERVER['HTTP_ORIGIN'])) {
    header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}");
    header('Access-Control-Allow-Credentials: true');
    header('Access-Control-Max-Age: 86400');
    // cache for 1 day
}
// Access-Control headers are received during OPTIONS requests
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
    if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'])) {
        header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
    }
    if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])) {
        header("Access-Control-Allow-Headers:        {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");
    }
    exit(0);
}
require_once 'vendor\\SPR0\\AutoLoad\\spr0Loader.php';
$classLoader = new \SPR0\AutoLoad\spr0Loader("vendor", '');
$classLoader->register();
/*
require_once 'vendor\Proxy\AbstractProxy.php';
require_once 'vendor\Proxy\Proxy.php';   
require_once 'vendor\Slim\SlimTestProxy.php';*/
//$proxyClass = new \vendor\Slim\SlimTestProxy();
$proxyClass = new \vendor\Slim\SlimHmacProxy();
$proxyClass->setRestApiBaseUrl("http://localhost/slim_test/");
$proxyClass->setRestApiEndPoint("index.php/");
//$proxyClass->setEndPointUrl('http://88.249.18.205:8090/slim2_ecoman/index.php/');
//$ecoman->setEndPointUrl('http://88.249.18.205:8090/slim2_ecoman/index.php/');
echo $proxyClass->redirect();
    if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'])) {
        header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
    }
    if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])) {
        header("Access-Control-Allow-Headers:        {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");
    }
    exit(0);
}
require_once 'vendor\\SPR0\\AutoLoad\\spr0Loader.php';
$classLoader = new \SPR0\AutoLoad\spr0Loader("vendor", '');
$classLoader->register();
/*
require_once 'vendor\Proxy\AbstractProxy.php';
require_once 'vendor\Proxy\Proxy.php';   
require_once 'vendor\Slim\SlimTestProxy.php';*/
//$proxyClass = new \vendor\Slim\SlimTestProxy();
$proxyClass = new \vendor\Slim\SlimHmacProxy();
// $proxyClass->setRestApiBaseUrl("http://localhost/Slim_SanalFabrika/");
/**
 * bazı browser larda crossdomain hataları oluştuğu için yapısal değişiklik yapıldı.  
 * @since 23.12.2015
 * @author Okan CIRAN
 * 
 */
$proxyClass->setRestApiBaseUrl("http://slim.sanalfabrika.com:9990/");
//$proxyClass->setRestApiBaseUrl("http://sanalfabrika.slim.com:9990/");
//$proxyClass->setRestApiBaseUrl("https://slim.sanalfabrika.com/");
$proxyClass->setRestApiEndPoint("index.php/");
//$proxyClass->setEndPointUrl('http://88.249.18.205:8090/slim2_ecoman/index.php/');
//$ecoman->setEndPointUrl('http://88.249.18.205:8090/slim2_ecoman/index.php/');
echo $proxyClass->redirect();