Drupal 7 开发内部培训资料, 分头诗人

Drupal 页面请求的处理过程

猪跑啦独家原创专稿,欢迎您转载本文,转载请注明来源。

1. Someone fires a request to your webserver. They might get a cookie if they've already logged into the site.
2. The server gets the request. It goes to .htaccess which says everything should go to index.php
3. index.php loads the APIs and gets them ready to handle the request
4. The Menu API which was loaded looks up the paths that different modules have registered that they handle.
5. The module gets the request and fires hooks to see whether any module wants to help while it's building the page.
6. The module returns some info back to the menu system.
7. If the everything looks good, it figures out which theme is active and hands off the raw data to the theme layer.
8. That gets kicked back to Drupal.
9. That gets kicked back to the web server, which kicks it back to the user.