面向切面是一种设置模式
把一个大块的功能给分解为小块的功能,小块功能利于开发、维护、升级、部署
tp框架的行为 Behavior如何执行:
1、框架执行流程分析:index.php ThinkPHP.php Think.class.php App.class.php
2、Think::start();
3、ThinkPHP/Conf/Mode/common.php tags标签内容是行为的内容
4、自定义shop/Common/conf/tags.php文件
5、自定义tags.php 内容会覆盖指定 的common.php的配置内容
App.class.php
1、function run();
2、Hook::listen('ap_begin');
3、ThinkPHP/Library/Think/Hook.class.php
4、function listen()
5、tags标签的内容解析为:CheckLang
6、self::exec('CheckLang');
7、function exec()
8、CheckLangBehavior
9、new CheckLangBehavior;
10、obj->run();、、运行具体行为