Интергрирован фреймворк для поддержки аспектного программирования

This commit is contained in:
ErickSkrauch 2017-11-13 17:14:58 +03:00
parent e6fe2f3755
commit 867c1a2b3b
3 changed files with 41 additions and 4 deletions

13
api/aop/AspectKernel.php Normal file
View File

@ -0,0 +1,13 @@
<?php
namespace api\aop;
use api\aop\aspects;
use Go\Core\AspectContainer;
use Go\Core\AspectKernel as BaseAspectKernel;
class AspectKernel extends BaseAspectKernel {
protected function configureAop(AspectContainer $container): void {
}
}

View File

@ -1,14 +1,31 @@
<?php
use api\aop\AspectKernel;
use common\config\ConfigLoader;
use yii\web\Application;
require __DIR__ . '/../../vendor/autoload.php';
defined('YII_DEBUG') or define('YII_DEBUG', in_array(getenv('YII_DEBUG'), ['false', '1']));
defined('YII_DEBUG') or define('YII_DEBUG', in_array(getenv('YII_DEBUG'), ['true', '1']));
defined('YII_ENV') or define('YII_ENV', getenv('YII_ENV'));
// Initialize an application aspect container
AspectKernel::getInstance()->init([
'debug' => YII_DEBUG,
'appDir' => __DIR__ . '/../../',
'cacheDir' => __DIR__ . '/../runtime/aspect',
'excludePaths' => [
__DIR__ . '/../runtime/aspect',
__DIR__ . '/../../vendor',
],
]);
require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php';
spl_autoload_unregister(['Yii', 'autoload']);
require __DIR__ . '/../../common/config/bootstrap.php';
require __DIR__ . '/../config/bootstrap.php';
$config = \common\config\ConfigLoader::load('api');
$config = ConfigLoader::load('api');
$application = new yii\web\Application($config);
$application = new Application($config);
$application->run();

View File

@ -23,7 +23,9 @@
"spomky-labs/otphp": "^9.0.2",
"bacon/bacon-qr-code": "^1.0",
"paragonie/constant_time_encoding": "^2.0",
"webmozart/assert": "^1.2.0"
"webmozart/assert": "^1.2.0",
"goaop/framework": "~2.1.2",
"domnikl/statsd": "^2.6"
},
"require-dev": {
"yiisoft/yii2-debug": "*",
@ -51,6 +53,11 @@
}
],
"autoload": {
"psr-4": {
"api\\": "api",
"common\\": "common",
"console\\": "console"
},
"files": [
"common/consts.php"
]