aop-io / patchwork-interceptor
R&D:使用`antecedent/patchwork`包(流包装器)的AOP,为AOP.io(php-aop)提供的PHP代码拦截器。
v0.1
2014-08-14 14:52 UTC
Requires
- php: >=5.4
This package is auto-updated.
Last update: 2024-09-05 23:10:01 UTC
README
使用php-aop和流包装器,通过Patchwork包实现拦截器。
此拦截器仅用于研究与开发有关通过协议处理程序和PHP流(流包装器)的可能性,不支持拦截“环绕”类型,也不支持拦截属性。
仅用于自己的研究与开发(或娱乐)或作为创建拦截器的灵感来源。
由于lib Patchwork 不是为使用AOP而创建的,因此此拦截器没有未来。然而,使用PHP 流包装器 创建拦截器是一个可行的解决方案!
入门指南
安装pecl-aop-interceptor
下载patchwork-interceptor(并配置自动加载器)或使用composer require: "aop-io/patchwork-interceptor"
。
用法
use Aop\Aop; // Init $aop = new Aop([ 'php_interceptor' => '\PatchworkInterceptor\PatchworkInterceptor']);
PHP-AOP抽象层的用法在AOP.io上有文档说明。
许可证
MIT (c) 2014, Nicolas Tallefourtane.