A piece of php code. please help me explain it in detail

Source: Internet
Author: User
A piece of php code, please help me explain in detail // automatically generate the HTML version if (isset ($ _ GET ['cache']) {require_once (dirname (_ FILE __). & quot;/include/common. inc. php & quot;); require_onceDEDEINC
// Automatically generate the HTML version
If (isset ($ _ GET ['cache'])
{
Require_once (dirname (_ FILE _). "/include/common. inc. php ");
Require_once DEDEINC. "/partview. class. php ";
$ GLOBALS ['_ arclistenv'] = 'index ';
$ Row = $ dsql-> GetOne ("Select * From '#@__ homepage '");
$ Row ['templet'] = MfTemplet ($ row ['templet']);
$ Pv = new PartView ();
$ Pv-> SetTemplet ($ pai_basedir. $ pai_templets_dir. "/". $ row ['templet']);
$ Pv-> SaveToHtml (dirname (_ FILE _). '/index.html ');
Include (dirname (_ FILE _). '/index.html ');
Exit ();
}

------ Solution --------------------
Check the database, replace the template, store the results, including the results, and exit.
------ Solution --------------------
I don't know what the framework is written in dedecms. I guess what the code means.
PHP code
If (isset ($ _ GET ['cache']) // determines whether the GET variable cache is passed {require_once (dirname (_ FILE __). "/include/common. inc. php "); // contains the file common. inc. php require_once DEDEINC. "/partview. class. php "; // contains the file $ GLOBALS ['_ arclistenv'] = 'index '; // set the global variable $ row = $ dsql-> GetOne ("Select * From '#@__ homepage '"); // read a row of data from the database $ row ['templet'] = MfTemplet ($ row ['templet']); // assign the returned data to templet $ pv = new PartView (); // instantiate $ pv-> SetTemplet ($ pai_basedir. $ cmd_templets_dir. "/". $ row ['templet']); // sets the template FILE $ pv-> SaveToHtml (dirname (_ FILE __). '/index.html'); // Save the static FILE include (dirname (_ FILE __). '/index.html'); // contains the static file exit ();}
------ Solution --------------------
The upstairs are all very simple code
------ Solution --------------------
Discussion
I don't know what the framework is written in dedecms. I guess what the code means.

PHP code

If (isset ($ _ GET ['cache']) // determines whether the GET variable cache is passed.
{
Require_once (dirname (_ FILE _). "/include/common. inc. php"); // contains the FILE common. inc. php
Require_onc ......

------ Solution --------------------
Discussion

I don't know what the framework is written in dedecms. I guess what the code means.
PHP code

If (isset ($ _ GET ['cache']) // determines whether the GET variable cache is passed.
{
Require_once (dirname (_ FILE _). "/include/common. inc. php"); // contains the FILE common. inc. php
Require_once DED ......

------ Solution --------------------
This is the code used in dedecms background to preview the homepage. the cache parameter is also passed there.
The code in if has already been well explained.

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.