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.