有人能告诉我处理初始请求并将请求属性转换为php数组的蛋糕中的默认函数是什么?我认为它可能是libs / http_socket.php中的一个函数,但似乎并非如此。
脚注:我知道可以构建自定义请求处理程序,但这不是我现在想要做的。我首先要分析蛋糕用于解析http请求的当前逻辑。
答案 0 :(得分:3)
request_handler.php
:
https://github.com/cakephp/cakephp/blob/master/cake/libs/controller/components/request_handler.php
在cakephp安装目录中......
cakephp/cakephp/blob/master/cake/libs/controller/components/request_handler.php
dispatcher.php
(正如康纳斯指出的那样......):
https://github.com/cakephp/cakephp/blob/master/cake/dispatcher.php
cakephp/cake/dispatcher.php
Dispatcher :: dispatch() - https://github.com/cakephp/cakephp/blob/master/cake/dispatcher.php#L97
Dispatcher :: __ extractParams() - https://github.com/cakephp/cakephp/blob/master/cake/dispatcher.php#L228
Dispatcher :: parseParams() - https://github.com/cakephp/cakephp/blob/master/cake/dispatcher.php#L244
router.php
:
https://github.com/cakephp/cakephp/blob/master/cake/libs/router.php
cakephp/cake/libs/router.php
路由器::连接() - https://github.com/cakephp/cakephp/blob/master/cake/libs/router.php#L263
路由器:: connectNamed() - https://github.com/cakephp/cakephp/blob/master/cake/libs/router.php#L339
Router :: mapResources() - https://github.com/cakephp/cakephp/blob/master/cake/libs/router.php#L404
路由器::解析() - https://github.com/cakephp/cakephp/blob/master/cake/libs/router.php#L446
路由器:: __ connectDefaultRoutes() - https://github.com/cakephp/cakephp/blob/master/cake/libs/router.php#L577
路由器:: setRequestInfo() - https://github.com/cakephp/cakephp/blob/master/cake/libs/router.php#L623
答案 1 :(得分:3)
您应该查看Dispatcher类和Router类。从app / webroot / index.php
调用Dispatcher