thinkphp System Flow

Source: Internet
Author: User
Tags constant definition

Flow chart:

Reference URL: http://www.thinkphp.cn/topic/35803.html

1 User URL Request2Invokes the application portal file (usually the site's index.php)3Load the framework entry file (thinkphp.php)4 record initial run time and memory overhead5 system constant judgment and definition6Load the Framework Boot class (Think\think) and execute Think::Start method for application initialization7 setting error handling mechanisms and automatic loading mechanisms8 Call the Think\storage class for storage initialization (the storage type is defined by the Storage_type constant)9 the deployment mode is loaded directly if there is an application compilation cache file (jump directly to step)Ten read the definition file for the application mode (defined by the App_mode constant) (the following is an example of normal mode) OneLoads the core file defined by the current application pattern (normal mode is Thinkphp/mode/common.php) ALoad the custom configuration file (Normal mode is thinkphp/conf/convention.php) -Load the app configuration file (Normal mode is application/common/conf/config.php) - load system alias definition theJudge and read the app alias definition file (Normal mode is Application/common/conf/alias.php) - load system behavior definition -Judge and read the application behavior definition file (Normal mode is application/common/conf/tags.php) -Load the framework's underlying language pack (normal mode is THINKPHP/LANG/ZH-CN.php) + build Application Compilation cache file if it is a deployment mode -Load Debug Mode system configuration file (Thinkphp/conf/debug.php) +Determine and read the application's Debug configuration file (default is Application/common/conf/debug.php) A determine the application state and read the status profile (if the App_status constant definition is not empty) at detects the application directory structure and generates it automatically (if the Check_app_dir configuration is turned on and the Runtime_path directory does not exist) - call the Run method of the Think\app class to start the app - Apply initialization (APP_INIT) tag bit to listen and execute binding behavior - determine and load dynamic configuration and function files -Call Think\dispatcher::dispatch method for URL request scheduling -Automatically identify compatible URL patterns and command-line modes below the$_server[' Path_info '] Parameter in detects domain name deployment and completes binding operations for modules and controllers (App_sub_domain_deploy parameter on) - parse the path_info information in the URL address to get the requested module information + detects if a module exists and allows access - determine and Load module configuration files, alias definitions, behavior definitions, and function files the determine and load dynamic configuration and function files for a module * URL pattern Determination of the module $ Module Routing Detection (url_router_on on)Panax Notoginseng path_info Processing (path_info) the tag bit listens and performs binding behavior - URL suffix Detection (url_deny_suffix and url_html_suffix processing) the get current controller and actions, and URL other parameters + URL Request dispatch complete (Url_dispatch) tag bit listens and performs binding behavior A Apply Start (App_begin) tag bit to listen and execute binding behavior the call Session_options configuration parameters for session initialization (if not command line mode) + Execute Controller method on request - detects if the controller is present if it does not exist $ controller start (action_begin) tag bit listens and performs binding behavior $ Default Call system Readhtmlcache behavior read static cache (html_cache_on parameter on) - determine and invoke the _initialize initialization method of the controller - determines whether an action method exists, detects whether an empty action method is defined if it does not exist the determines whether the pre-operation method is defined, and some words execute - Action parameter binding detection, automatic matching of parameters of the operation methodWuyi If there is a template render (call the Controller display method) the View Start (view_begin) tag bit listens and performs binding behavior - call Think\view's Fetch method to parse and get template content Wu automatically identify current topics and locate template files - Visual Analysis (view_parse) tag bits listen and perform binding behavior About default call built-in Parsetemplate behavior parse template (below normal mode) $ Template engine generates template cache after parsing template content - Template Filter replace (template_filter) tag bit listens and performs binding behavior - default Calling system's Contentreplace behavior for template substitution - output content filtering (View_filter) tag bit listens and performs binding behavior A Default Call system Writehtmlcache behavior write static cache (html_cache_on parameter on) + call the Render method of the Think\view class to output the rendered content the View End (view_end) tag bit listens and performs binding behavior - determine if the post-operation method is defined, and some words are executed $ controller End (Action_end) tag bit listens and performs binding behavior the Apply End (App_end) tag bit to listen and execute binding behavior the performs the showpagetrace behavior of the system (the Show_page_trace parameter is on and is not an AJAX request) theLog Information Store writes

.

.

thinkphp System Flow

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.