Introduction to the Hdwiki framework

Source: Internet
Author: User

Although Hdwiki is an open-source wiki system, and the code is simple and understandable, it requires a holistic understanding of the framework if you want to do further development on the system. Familiar with the Hdwiki framework can be completely independent of the development of other functions, as an open-source PHP framework to use.

Brief description
1. Based on the MVC system
2 support for PHP4 and PHP5
3. Ultra-Lightweight
4. Easy-to-use template system
5. Caching mechanisms
6. Support Plug-in development
7. Rich Lib Class library package

Program execution Flow

The system flowchart is as follows:


Introduction to the Hdwiki framework introduction to the Hdwiki framework

Hdwiki Framework Introduction-The program execution process, from the beginning of the index.php file through a few important file overview look at the process.
The index.php file implements the following functions
1. Setting the error level
2. Turn off Magic References (database, file over data)
3. $starttime started, set the program run time.
4. In_hdwiki and Hdwiki_root constants Definitions
5. Contains a file '/model/hdwiki.class.php '
6. Instantiate an object and run it. model/hdwiki.class.php
7. Get the value of MAGIC_QUOTES_GPC
Contains three files, config.php (basic information Database information, encoding, etc. of the system)
string.class.php (in class library, handling of strings)
Base.class.php (Basic class of system, emphasis)
Then the Hdwiki class, the constructor executes the init_request (), Load_control () Two methods, implements the following functions:

Init_request ():
1. Determine if the system has been installed url$_server[' query_string '
2. The URL you just got is parsed and processed to get the class name, method name and parameter, set the default class name, method name.
3. Put several global variables for PHP ($GLOBALS, $_env, $HTTP _get_vars, $HTTP _post_vars, $HTTP _cookie_vars, $HTTP _server_vars, $HTTP _env_ VARS) use unset to release the post, get into the properties of this class.

Load_control ():
1. Further analysis of the get and post from the previous method, including the corresponding file.
Run ()
Index.php uses the method that the instance contains just the class that runs the corresponding method.
According to the URL to run the control inside the class method, this method calls the corresponding model method to do the data processing.
After the control method completes the variable and the data processing, it compiles the template through the template class and displays it to the user uniformly.

base.class.php File Introduction
That comes up with a bunch of files.
Require Hdwiki_root. ' /version.php ';
Require Hdwiki_root. ' /lib/file.class.php ';
Require Hdwiki_root. ' /lib/util.class.php ';
Require Hdwiki_root. ' /lib/hddb.class.php ';
Require Hdwiki_root. ' /lib/template.class.php ';
Require Hdwiki_root. ' /lib/cache.class.php ';

This type of file is the focus of a file class system in which all the Cotrol classes are integrated, initializing all the systems used to get properties and methods. Includes, access IP, access time, initialize user, database operand, cache operand, plug-in list, template action object, etc.
It's not hard to understand.
Here are a few key documents on the framework that you can see. about how to initialize the database, how to initialize the template object, you can see the corresponding files are also easy to understand.
More reference to the Hdwiki operating mechanism and principles of the article.

Introduction to the Hdwiki framework

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.