DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:overview

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
devel:overview [2016-10-28 07:00] – [Table] 195.12.115.225devel:overview [2016-11-03 02:20] – old revision restored (2016-04-28 15:47) ach
Line 3: Line 3:
 This is a walk through the source code during a request for ''/doku.php?id=start&do=show'' to explain the basics of DokuWiki. You should have the full source available when reading this to fully enjoy this journey. Use the [[http://xref.dokuwiki.org/reference/dokuwiki/nav.html?index.html|XRef]] links to obtain a browsable version of the source. There is also a more detailed [[callgraph]] page available including the rendering process. A lot of detail is left out of this description to make it simpler. This is a walk through the source code during a request for ''/doku.php?id=start&do=show'' to explain the basics of DokuWiki. You should have the full source available when reading this to fully enjoy this journey. Use the [[http://xref.dokuwiki.org/reference/dokuwiki/nav.html?index.html|XRef]] links to obtain a browsable version of the source. There is also a more detailed [[callgraph]] page available including the rendering process. A lot of detail is left out of this description to make it simpler.
  
-^ Filename                                ^ Code snippet                                       ^ Description                                                                                                                                                                                                                            ^ +^ Filename                           ^ Code snippet                                       ^ Description                                                                                                                                                                                                                            ^ 
-| [[xref>doku.php]]                       | '' if(!defined('DOKU_INC'))       ''               | Everything starts here by defining the base code directory                                                                                                                                                                             | +| [[xref>doku.php]]                  | '' if(!defined('DOKU_INC'))       ''               | Everything starts here by defining the base code directory                                                                                                                                                                             | 
-| :::                                     | '' $ACT = $_REQUEST['do'        ''               | next we determine which action is requested a.k.a. [[devel:action_modes|do modes]]                                                                                                                                                     | +| :::                                | '' $ACT = $_REQUEST['do'        ''               | next we determine which action is requested a.k.a. [[devel:action_modes|do modes]]                                                                                                                                                     | 
-| :::                                     | '' require_once('init.php'      ''               | over to init.php, initialize core                                                                                                                                                                                                      | +| :::                                | '' require_once('init.php'      ''               | over to init.php, initialize core                                                                                                                                                                                                      | 
-| [[xref>inc/init.php]]                   | '' include('preload.php'        ''               | [[preload]] make it possible to override directories and configuration cascade                                                                                                                                                         | +| [[xref>inc/init.php]]              | '' include('preload.php'        ''               | [[preload]] make it possible to override directories and configuration cascade                                                                                                                                                         | 
-| :::                                     | '' if(!defined('DOKU_CONF'      ''               | create [[devel:environment]] defines for code location                                                                                                                                                                                 | +| :::                                | '' if(!defined('DOKU_CONF'      ''               | create [[devel:environment]] defines for code location                                                                                                                                                                                 | 
-| :::                                     | '' include(DOKU_INC. 'inc/config_cascade.php') ''  | prepare and load the global [[configuration]] file(s)                                                                                                                                                                                  | +| :::                                | '' include(DOKU_INC. 'inc/config_cascade.php') ''  | prepare and load the global [[configuration]] file(s)                                                                                                                                                                                  | 
-| :::                                     | '' global $lang;                  ''               | load and prepare the [[devel:localization|language]] files using English for all missing entries                                                                                                                                       | +| :::                                | '' global $lang;                  ''               | load and prepare the [[devel:localization|language]] files using English for all missing entries                                                                                                                                       | 
-| :::                                     | '' if(!defined('DOKU_REL'       ''               | create all [[devel:environment]] defines not already defined, which might be dependent of the [[:config]] settings                                                                                                                     | +| :::                                | '' if(!defined('DOKU_REL'       ''               | create all [[devel:environment]] defines not already defined, which might be dependent of the [[:config]] settings                                                                                                                     | 
-| :::                                     | '' if(!headers_sent() && ..       ''               | init session and set cookie                                                                                                                                                                                                            | +| :::                                | '' if(!headers_sent() && ..       ''               | init session and set cookie                                                                                                                                                                                                            | 
-| :::                                     | '' require_once (DOKU_INC.'inc/load.php') ''       | [[autoloader|autoload]] all libraries                                                                                                                                                                                                  | +| :::                                | '' require_once (DOKU_INC.'inc/load.php') ''       | [[autoloader|autoload]] all libraries                                                                                                                                                                                                  | 
-| :::                                     | '' ... \\ auth_setup() \\ ...     ''               | initialize plugin controller, [[events|event handling]] system, authentication and exit after setting up mail                                                                                                                          | +| :::                                | '' ... \\ auth_setup() \\ ...     ''               | initialize plugin controller, [[events|event handling]] system, authentication and exit after setting up mail                                                                                                                          | 
-| [[xref>doku.php]]                       | '' $ID    = getID()               ''               | back from init.php, sanitize and turn request into [[devel:environment|global variables]]                                                                                                                                              | +| [[xref>doku.php]]                  | '' $ID    = getID()               ''               | back from init.php, sanitize and turn request into [[devel:environment|global variables]]                                                                                                                                              | 
-| :::                                     | '' $INFO = pageinfo()             ''               | add page [[devel:metadata]] into a [[devel:environment|global variable]], this includes calling [[xref>auth_quickaclcheck()]] and [[xref>p_get_metadata()]]. The later causing a rendering of page metadata if it isn't cached.        | +| :::                                | '' $INFO = pageinfo()             ''               | add page [[devel:metadata]] into a [[devel:environment|global variable]], this includes calling [[xref>auth_quickaclcheck()]] and [[xref>p_get_metadata()]]. The later causing a rendering of page metadata if it isn't cached.        | 
-| :::                                     | '' if(!$INFO['exists'] ...        ''               | send 404 for missing pages                                                                                                                                                                                                             | +| :::                                | '' if(!$INFO['exists'] ...        ''               | send 404 for missing pages                                                                                                                                                                                                             | 
-| :::                                     | '' trigger_event(DOKUWIKI_STARTED)''               | call [[action plugins]] subscribing the [[devel:event:dokuwiki_started|DOKUWIKI_STARTED]] event                                                                                                                                        | +| :::                                | '' trigger_event(DOKUWIKI_STARTED)''               | call [[action plugins]] subscribing the [[devel:event:dokuwiki_started|DOKUWIKI_STARTED]] event                                                                                                                                        | 
-| [[xref>inc/actions.php]]                | '' act_dispatch($ACT)             ''               | do the work depending on [[devel:action_modes|action]]                                                                                                                                                                                 | +| [[xref>inc/actions.php]]           | '' act_dispatch($ACT)             ''               | do the work depending on [[devel:action_modes|action]]                                                                                                                                                                                 | 
-| :::                                     | ''%%if ($evt->advise_before()) ...%%''             | allow plugins to override default behavior using [[devel:event:action_act_preprocess|ACTION_ACT_PREPROCESS]] event                                                                                                                     | +| :::                                | ''%%if ($evt->advise_before()) ...%%''             | allow plugins to override default behavior using [[devel:event:action_act_preprocess|ACTION_ACT_PREPROCESS]] event                                                                                                                     | 
-| :::                                     | '' $ACT = act_clean($ACT)         ''               | sanitize and redirect [[config:disableactions|disabled actions]] into ''do=show''                                                                                                                                                      | +| :::                                | '' $ACT = act_clean($ACT)         ''               | sanitize and redirect [[config:disableactions|disabled actions]] into ''do=show''                                                                                                                                                      | 
-| :::                                     | '' ... \\ $ACT = act_permcheck($ACT) \\ ...  ''    | call processing code for requested action(s) while checking needed ACL permissions. The $ACT might change during [[xref>act_dispatch()]].                                                                                              | +| :::                                | '' ... \\ $ACT = act_permcheck($ACT) \\ ...  ''    | call processing code for requested action(s) while checking needed ACL permissions. The $ACT might change during [[xref>act_dispatch()]].                                                                                              | 
-| :::                                     | '' global $INFO \\ global $conf              ''    | make global variables accessible to template code                                                                                                                                                                                      | +| :::                                | '' global $INFO \\ global $conf              ''    | make global variables accessible to template code                                                                                                                                                                                      | 
-| :::                                     | '' trigger_event(ACTION_HEADERS_SEND)        ''    | call [[action plugins]] subscribing the [[devel:event:action_headers_send|ACTION_HEADERS_SEND]] event                                                                                                                                  | +| :::                                | '' trigger_event(ACTION_HEADERS_SEND)        ''    | call [[action plugins]] subscribing the [[devel:event:action_headers_send|ACTION_HEADERS_SEND]] event                                                                                                                                  | 
-| :::                                     | '' include(template('main.php'))             ''    | over to the selected template main script                                                                                                                                                                                              | +| :::                                | '' include(template('main.php'))             ''    | over to the selected template main script                                                                                                                                                                                              | 
-| [[xref>lib/tpl/default/main.php]]KORY   | '' ... \\ tpl_metaheaders() \\ ...    ''           | the [[template]] main script consist of HTML design elements calling on php methods for content like metaheaders, buttons, breadcrumb navigation elements etc. all available in the [[xref>inc/template.php]] file                     | +| [[xref>lib/tpl/default/main.php]]  | '' ... \\ tpl_metaheaders() \\ ...    ''           | the [[template]] main script consist of HTML design elements calling on php methods for content like metaheaders, buttons, breadcrumb navigation elements etc. all available in the [[xref>inc/template.php]] file                     | 
-| :::                                     | '' tpl_content()                      ''           | here the actual wiki page is created                                                                                                                                                                                                   | +| :::                                | '' tpl_content()                      ''           | here the actual wiki page is created                                                                                                                                                                                                   | 
-| [[xref>inc/template.php]] Vi seryozno?  | :::                                                | :::                                                                                                                                                                                                                                    | +| [[xref>inc/template.php]]          | :::                                                | :::                                                                                                                                                                                                                                    | 
-| :::                                     | '' trigger_event(TPL_ACT_RENDER)      ''           | call to [[xref>tpl_content_core()]] using [[devel:event:tpl_act_render|TPL_ACT_RENDER]] event                                                                                                                                          | +| :::                                | '' trigger_event(TPL_ACT_RENDER)      ''           | call to [[xref>tpl_content_core()]] using [[devel:event:tpl_act_render|TPL_ACT_RENDER]] event                                                                                                                                          | 
-| :::                                     | '' switch($ACT)                       ''           | select content based on action, the basic ''do=show'' calls [[xref>html_show()]]                                                                                                                                                       | +| :::                                | '' switch($ACT)                       ''           | select content based on action, the basic ''do=show'' calls [[xref>html_show()]]                                                                                                                                                       | 
-| [[xref>inc/html.php]]                   | '' $html = p_wiki_xhtml(...)          ''           | which uses a [[devel:caching#two-stage-caching|cached XHTML]] version of the page __OR__ triggers the [[parser|renderer]] to render cached instructions as XHTML __OR__ use the [[parser]] to turn wiki text into instructions first. +| [[xref>inc/html.php]]              | '' $html = p_wiki_xhtml(...)          ''           | which uses a [[devel:caching#two-stage-caching|cached XHTML]] version of the page __OR__ triggers the [[parser|renderer]] to render cached instructions as XHTML __OR__ use the [[parser]] to turn wiki text into instructions first. 
-| [[xref>inc/template.php]]               | '' trigger_event(TPL_CONTENT_DISPLAY) ''           | back in [[xref>tpl_content()]] [[action plugins|action plugin's]] have a last chance to edit raw HTML before output by using [[devel:event:tpl_content_display|TPL_CONTENT_DISPLAY]] event                                             | +| [[xref>inc/template.php]]          | '' trigger_event(TPL_CONTENT_DISPLAY) ''           | back in [[xref>tpl_content()]] [[action plugins|action plugin's]] have a last chance to edit raw HTML before output by using [[devel:event:tpl_content_display|TPL_CONTENT_DISPLAY]] event                                             | 
-| [[xref>doku.php]]                       | '' trigger_event(DOKUWIKI_DONE)   ''               | finish by calling [[action plugins]] subscribing the [[devel:event:dokuwiki_done|DOKUWIKI_DONE]] event when the template main script has ended                                                                                         |+| [[xref>doku.php]]                  | '' trigger_event(DOKUWIKI_DONE)   ''               | finish by calling [[action plugins]] subscribing the [[devel:event:dokuwiki_done|DOKUWIKI_DONE]] event when the template main script has ended                                                                                         |
  
  
devel/overview.txt · Last modified: 2023-08-13 14:54 by Klap-in

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki