limingxinleo / aop-integration
This package is abandoned and no longer maintained.
No replacement package was suggested.
AopIntegration
v1.0.1
2020-12-19 07:48 UTC
Requires
- php: >=7.3
- hyperf/di: ^2.0
- hyperf/pimple: ^2.0
- hyperf/utils: ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.14
- hyperf/testing: ^2.0
- phpstan/phpstan: ^0.12
- swoole/ide-helper: dev-master
This package is auto-updated.
Last update: 2021-01-20 05:25:45 UTC
README
本组件不再维护,请使用 hyperf/aop-integration
安装
composer require limingxinleo/aop-integration
配置 AOP 到 ThinkPHP 框架
- 添加配置到
config/config.php
中
<?php declare(strict_types=1); ! defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__, 1)); return [ 'annotations' => [ 'scan' => [ 'paths' => [ BASE_PATH . '/app', ], 'ignore_annotations' => [ 'mixin', ], 'class_map' => [ ], ], ], 'aspects' => [ // 在此配置可用的 Aspect ], ];
- 修改入口文件
<?php declare(strict_types=1); namespace think; use Hyperf\AopIntegration\ClassLoader; require __DIR__ . '/../vendor/autoload.php'; // 初始化 AOP ! defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__, 1)); ClassLoader::init(); // 省略其他代码