<?php
error_reporting(E_ALL);
// comment out the following two lines when deployed to production
defined('YII_DEBUG') or define('YII_DEBUG', false);
defined('YII_ENV') or define('YII_ENV', 'prod');
header("Access-Control-Allow-Headers:Origin, X-Requested-With, Content-Type,Content-Length, Accept, Authorization");
header("Access-Control-Allow-Origin:*");
header("Access-Control-Allow-Methods:PUT,POST,GET,DELETE,OPTIONS");

defined('UPLOAD_PATH') or define('UPLOAD_PATH', __DIR__.'/../../');
defined('LOGIN_EXP_TIME') or define('LOGIN_EXP_TIME', 3600*4);//登录缓存有效时间 4 小时
defined('SOLUTION_LIMIT_TIME') or define('SOLUTION_LIMIT_TIME', 3600*1);//提交方案时效限制 1小时内
defined('SOLUTION_LIMIT_UP') or define('SOLUTION_LIMIT_UP', 20);//提交方案个数限制 20 个
defined('LOGDIR') or define('LOGDIR', 'log');

//登录锁定：24小时内，密码错误4次，锁定1小时
defined('PWDERROR_EXP_TIME') or define('PWDERROR_EXP_TIME', 3600*24);
defined('PWDERROR_NUM') or define('PWDERROR_NUM', 4);
defined('PWDERROR_LOCK_TIME') or define('PWDERROR_LOCK_TIME', 3600*1);

require(__DIR__ . '/../../vendor/autoload.php');
require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
$config = require(__DIR__ . '/../../config/webm.php');

(new yii\web\Application($config))->run();
