YII2 源码阅读 综述

如何阅读源码呢?

我的方法是,打开xdebug的auto_trace

[XDebug]
;xdebug.profiler_append = 0
;xdebug.profiler_enable = 1
;xdebug.profiler_enable_trigger = 0
xdebug.auto_trace = On
xdebug.collect_vars = On
xdebug.collect_return = On
xdebug.collect_params = 4
xdebug.show_local_vars = On
xdebug.profiler_output_dir ="D:\phpStudy\tmp\xdebug"
xdebug.trace_output_dir ="D:\phpStudy\tmp\xdebug"
xdebug.profiler_output_name = "cache.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
zend_extension="D:\phpStudy\php54n\ext\xdebug.dll"

这样访问一下首页就记录下了YII的执行过程(好像只记录了函数的调用,同时能显示传入函数的参数值,函数的返回值)

然后配合源码,就能比较轻松的读懂了。这样不需要为了看传入一个函数的参数值是什么而用var_dump,省去很多麻烦

posted @ 2016-03-01 12:58  捕蛇者说  阅读(312)  评论(0编辑  收藏  举报