<?php
//默认跳转https（阿里云需要开启HTTP_X_FORWARDED_PROTO）
//if($_SERVER['HTTP_X_FORWARDED_PROTO']!="https")
//{
//    $url = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
//    header("HTTP/1.1 301 Moved Permanently");
//    header("Location: ".$url);
//    exit;
//}
/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| First we need to get an application instance. This creates an instance
| of the application / container and bootstraps the application so it
| is ready to receive HTTP / Console requests from the environment.
|
*/

$license_file = __DIR__.'/license.php';
if(file_exists($license_file)){
    require_once   __DIR__.'/license.php';
}else{
    if(!class_exists("Fanwe")){
        die("Please install fanwe extension.");
    }

    define('LICENSE_PATH', __DIR__ . '/');
    if(!file_exists(LICENSE_PATH."license")){
        die("License not exist.");
    }

    $fanwe = new Fanwe;
    $fanwe->init();
}

$app = require __DIR__.'/../bootstrap/app.php';

/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/

$app->run();
