Summary of the use of PHPCMS

  • 2020-03-31 21:16:29
  • OfStack

Let me talk about the loading process for this system

Define the root directory and the include directory
Load core files
Config file 'config.inc. PHP '
Global function 'global.func.php'
Dir. Func.php '
Url-related function 'url.func.php'
Output.class.php '
Permissions class 'priv_group. Class. PHP'
Time handling class 'times.class.php'
Load language array 'phpcms.lang.php'
Load count inventory class 'db_mysql.class.php'
Define constants, most of the information we use like IP, HTTP_REFERER, SCRIPT_NAME... Always use constants
Get variables from $_POST,$_GET,$_COOKIE,-> extract
The CACHE, cache_read function is mostly an array of files that are read, and then extract (extract every array, don't forget unset)
Gets the current $mod, PHPCMS by default
Determine if the user is logged in
Read member group permissions
Read the template file through the template function
The first step is to read the generated cache template PHP file based on the parameters
Determines whether the file exists and whether the file tpl_root.tpl_name. '/'.$module.'/'.$template.'. HTML 'generation date is equal to tpl_cachepath. $module.'_'
Read the TPL file


The CMS template separation, and the advantage is that program will be common data through in the form of an array to access the file above, improve the high performance, not every time to read the database, and then the template, compiled by own syntax function access for TPL increase the flexibility of the template, artists don't know the PHP syntax, could write flexible layout; The built-in TAG function is also good.

The downside is that too many unwanted files are loaded in memory at once, especially in the form of variables and arrays, whether they are needed or not.

The highlight is that it can be very convenient to generate HTML, to make up for the shortcomings, generally speaking, the architecture and ideas are quite good, worth learning and secondary development!

Related articles: