discuz x2.5 Kangsheng ???? ??? ??? ??? discuz
Jul 29, 2016 am 08:45 AM?? ?? ??? ??? ????.
/*template.class.php
@ Kangsheng Weibo ??? ?? ??? ? ???? ????? ??? ?? ?? ?? ? ????.by ????
@ ctt ???? ??????. phpcms ???? ?????? ? ^_^ ??! ! !
@ Weibo http://weibo.com/lrjxgl
@ ?? ?? ?? ???? ??? ??????. ??? ??? ?????
@ ?? ??? ??? .htm???
$tpl = ? ???('skin',"default");
$tpl->objdir='tpp';
$tpl->rewrite=true;//?? ??? ?????? ?? ??? ?????.
$tpl-> ;rewrite_rule=array(array("/index.php/"),array("index.html")); //?? ?? ??
$tpl->ass("indexurl", "index.php") ;
$tpl->ass("str","?? ??? ??????")
$tpl->ass("ec","?? ???????. out");
$tpl->sign("subhtml","{subtpl ttt} ??? ??? ??? ???? ? ?????. ??? ttt.htm? ???? ????.");
$tpl-> ??("a ",array('dasdasd'.'bbbbbbbb','cccccccccccccc'))
$tpl->??("i",1);
$tpl->display(" index");
*/
if(!definated("CHARSET")) Define("CHARSET","gb2312");//?? ???
if(!defined("DIR_TPL")) Define("DIR_TPL ","tpl");//?? ??? ????
if(!definated("DIR_DATA")) Define("DIR_DATA","data");//?? ??? ????
if( !definated(" DEBUG")) Define("DEBUG",0);//?? ?? ??
class template {
//note var
public $rewrite=false;//?? ??? ?? -static rewrite
public $rewrite_rule=array(); //?? ?? ?? ??
public $defaulttpldir;//?? ???
public $tpldir;//??? ????
public $objdir; //??? ?? ????
public $tplfile;//??? ??
public $objfile;//??? ??
public $tplid=1;//??? ??
public $currdir='default' ;//?? ??? ????
public $vars=array();//?? ??? ??
public $removeblanks=false;//?? ??
public $stdout='display';//?? ??
?? __construct ($tplid, $currdir) {
$this->template($tplid, $currdir)
}
?? ???($tplid, $currdir) {
ob_start();
if(file_exists(DIR_TPL.'/'.$currdir)) {
$this->currdir = $currdir
$this->tplid
} else {
$this->currdir = 'default';
$this->tplid = 1
}
$this->defaulttpldir = DIR_TPL.'/default' ;
$ this->tpldir = DIR_TPL.'/'.$this->currdir
$this->objdir = DIR_DATA.'/cache/tpl'
if(version_compare( PHP_VERSION, '5' ) == -1) {
register_shutdown_function(array(&$this, '__destruct'))
}
}
//??
?? ??( $k, $v ) {
$this->vars[$k] = $v
}
//??
?? ??($file) {
extract( $this-> vars, EXTR_SKIP);
include $this->getObj($file)
}
function getObj($file, $tpldir = '') {
$subdir = ($pos = strpos($file, '/')) === false ? '' : substr($file, 0, $pos)
$file = $subdir($file, $pos) 1) : $file ;
$this->tplfile = ($tpldir ? $tpldir : $this->tpldir).'/'.($subdir ? $subdir.'/' : ''). $file.'.htm';
$this->objfile = $this->objdir.'/'.($tpldir ? '' : $this->tplid.'_') subdir ? $subdir.'_' : '').$file.'.php';
//?? ???? ??
if(@filemtime($this->tplfile) === FALSE)
$this ->tplfile = $this->defaulttpldir.'/'.($subdir ? $subdir.'/' : '').$file.'.htm';
}
//note ??? ?? ??
if(!file_exists($this->objfile) || DEBUG && @filemtime($this->objfile) < filemtime($this->tplfile)) {
$this ->compile();
}
return $this->objfile
}
function getTpl($file) {
$subdir = ($ pos = strpos($file , '/')) === false ? '' : substr($file, 0, $pos)
$file = $subdir($file, $pos 1): $file;
$tplfile = $this->tpldir.'/'.($subdir ? $subdir.'/' : '').$file.'.htm'
if(@filemtime ($tplfile) == = FALSE) {
$tplfile = $this->defaulttpldir.'/'.($subdir ? $subdir.'/' : '').$file.'.htm';
}
return $tplfile;
}
function compile() {
$var_regexp = "@?\$[a-zA-Z_]w*(?:[[w. "'[]$] ])*";
$vtag_regexp = "=(@?\$[a-zA-Z_]w*(?:[[w."'[]$] ] )*)?> ";
$const_regexp = "{([w] )}";
$template = file_get_contents($this->tplfile);
for($i = 1; $i <= 3 ; $i ) {
if(strpos($template, '{subtpl') !== FALSE) {
if(DEBUG == 2) {
$template = str_replace ('{subtpl', '{tpl', $template);
} else {
$template = preg_replace("/[nrt]*{subtpls ([a-z0-9_:/] )}[ nrt]*/ies" , "file_get_contents($this->getTpl('\1'))", $template);
}
}
}
$remove = array(
'/(^ |r|n)/*. ?(r|n)*/(r|n)/is',
'///??. ?(r|n)/i',
'// /debug.?(r|n)/i',
'/(^|r|n)(s|t) /',
'/(r|n)/ ',
) ;
$this->removeblanks && $template = preg_replace($remove, '', $template)
$template = preg_replace("/

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











ToversionAphp ??, forclarityandeasofrouting, ac

TOSECURELYHANDLEAUSTENCENDACTIONANDACTERIZINGINPHP, FORCUCTSESTEPS : 1. ALWAYSHASHPASSWORTHPASSWORD_HASH () ? VERVERIFYUSINGPANSWORD_VERIFY (), usePREPAREDSTATEMENTSTOPREVENTSQLINGERGED, andSTOREUSERSESSEATAIN $ _SESSIONSAFTERLOGIN.2.impleplempletrole ?? ACCESSC

ProceduralAndObject-OrientedProgramming (OOP) InphpDiffersiMINTIFINTIONTERINGLISTURE, ??? ? ? DATAHANDLING

phpdoesnothaveAbuilt-inweakMapButofferSweakReference.1.WeakReenceAllowsholdingReferences withoutpreventinggarbageCollection.2.ItusteForCaching, Eventlisteners, andMetAdataWithoutAftingObjectLifeCycles.3.youcoucococococococcinccing

PHP?? ?? ???? ???? ????? ??? ?? ??? ???? ?? ??? ??? ??? ???? ????. 1. finfo_file ()? ???? ?? ?? ??? ???? ???/jpeg? ?? ?? ?? ? ?????. 2. uniqid ()? ???? ??? ?? ??? ???? ? Web ?? ????? ??????. 3. php.ini ? html ??? ?? ?? ??? ???? ???? ??? 0755? ?????. 4. Clamav? ???? ???? ???? ??? ??????. ??? ??? ?? ???? ????? ???? ?? ??? ????? ???? ??? ? ??? ?????.

PHP?? ==? ==? ?? ???? ?? ??? ??????. == ?? ??? ?? ?? ?????. ?? ??, 5 == "5"? true? ????, ?? ??? ???? ?? ?? ??? ????? ????? (? : 5 === "5"? false? ?????. ?? ?????? ===? ? ???? ?? ?????? == ?? ??? ??? ???? ?????.

?, PHP? ?? ?? ?? ?????? ?? MongoDB ? Redis? ?? NOSQL ??????? ?? ??? ? ????. ?? MongoDBPHP ???? (PECL ?? Composer? ?? ??)? ???? ????? ????? ??? ?????? ? ???? ????? ??, ??, ?? ? ?? ??? ?????. ??, Predis ????? ?? Phpredis ??? ???? Redis? ???? ?? ? ?? ? ??? ???? ??? ????? Phpredis? ???? ?? Predis? ?? ??? ?????. ? ? ?? ??? ???? ? ????? ????.

PHP?? ?? ??? ??? ???? ??? ??? ????. 1. ?? ??? ?? ? ?? ??? ??? ???? ???? ??? ? ????. ??? ??? ???? ????? ????? ???? ????. 2. ?? ?? ?? - ??, ??? ???? ?? ??? ?????. 3. ?? ???? ??? ??? ???? ??? ??? ?????. 4. Division? / ??? ???? 0?? ??? ?? ????? ??? ?? ??? ?? ? ? ????. 5. ???? ??? ???? ?? ?? ? ?? ??? ???? ? ??? ? ???, ??? ?? ? ? ??? ??? ???? ?????. ? ???? ???? ???? ??? ??? ??? ???? ?? ??? ? ??????? ????.
