2016-09-16 03:58:28 +05:30
|
|
|
<?php
|
2017-11-13 19:44:58 +05:30
|
|
|
|
|
|
|
use api\aop\AspectKernel;
|
|
|
|
use common\config\ConfigLoader;
|
|
|
|
use yii\web\Application;
|
|
|
|
|
2017-11-17 05:34:14 +05:30
|
|
|
$time = microtime(true);
|
|
|
|
|
2019-04-06 19:22:23 +05:30
|
|
|
require __DIR__ . '/../vendor/autoload.php';
|
2016-09-16 03:58:28 +05:30
|
|
|
|
2019-04-06 19:22:23 +05:30
|
|
|
defined('YII_DEBUG') || define('YII_DEBUG', in_array(getenv('YII_DEBUG'), ['true', '1'], false));
|
2019-02-26 04:56:02 +05:30
|
|
|
defined('YII_ENV') || define('YII_ENV', getenv('YII_ENV'));
|
2016-09-16 03:58:28 +05:30
|
|
|
|
2017-11-13 19:44:58 +05:30
|
|
|
// Initialize an application aspect container
|
|
|
|
AspectKernel::getInstance()->init([
|
|
|
|
'debug' => YII_DEBUG,
|
2019-04-06 19:22:23 +05:30
|
|
|
'appDir' => dirname(__DIR__),
|
|
|
|
'cacheDir' => __DIR__ . '/runtime/aspect',
|
2017-11-13 19:44:58 +05:30
|
|
|
'excludePaths' => [
|
2019-04-06 19:22:23 +05:30
|
|
|
__DIR__ . '/runtime/aspect',
|
|
|
|
__DIR__ . '/../vendor',
|
2017-11-13 19:44:58 +05:30
|
|
|
],
|
|
|
|
]);
|
|
|
|
|
2019-04-06 19:22:23 +05:30
|
|
|
require __DIR__ . '/../vendor/yiisoft/yii2/Yii.php';
|
|
|
|
require __DIR__ . '/../common/config/bootstrap.php';
|
|
|
|
require __DIR__ . '/config/bootstrap.php';
|
2016-09-16 03:58:28 +05:30
|
|
|
|
2017-11-13 19:44:58 +05:30
|
|
|
$config = ConfigLoader::load('api');
|
2016-09-16 03:58:28 +05:30
|
|
|
|
2017-11-13 19:44:58 +05:30
|
|
|
$application = new Application($config);
|
2016-09-16 03:58:28 +05:30
|
|
|
$application->run();
|
2017-11-17 05:34:14 +05:30
|
|
|
|
|
|
|
$timeDifference = (microtime(true) - $time) * 1000;
|
|
|
|
fastcgi_finish_request();
|
|
|
|
Yii::$app->statsd->time('request.time', $timeDifference);
|