| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> other >> PEAR jiao cheng ( er )--Pear de Cache jie shao
 

PEAR jiao cheng ( er )--Pear de Cache jie shao

2008-12-28 07:39:31 编辑來源:互联网 评论
 
本文为【PEAR教程(二)--Pear的Cache介绍】的拼音翻译版
  qian mian jie shao le pear de an zhuang , jin tian kai shi jie shao pear de ji ge zhi ming de package zhi yi , ru guo you bu qing chu de di fang qing zhan nei sou suo “PEAR jiao cheng ” huo qu qian mian de jiao cheng !
  jin tian wo men yao jie shao de shi PEAR de Cache_Lite bao , zuo web de shuo dao ti su yan jing deng da de cheng du jue bu ya yu nan ren jian dao jue se mei nv shi yan jing suo deng da de cheng du , yin ci , wo zhe li di yi ge yao jie shao de jiu shi PEAR de Cache_lite bao , li yong zhe ge package ke yi gen ju ni de xu yao huan cun wang ye de ren he yi ge bu fen , cong er da da de ti gao le ye mian de sheng cheng he zai ru su du !
  shou xian qu Pear de List Packages xia zai Cache_Lite zhe ge an zhuang bao , xie zhe ge jiao cheng de shi hou , wen ding de ban ben shi 1.7.2, suo yi wo men jiu xia zai zhe ge ban ben , xia zai xia lai hou jie ya suo , ran hou jiang wen jian fang zhi zai PEAR de gen mu lu xia ( wen jian mu lu ru he zu zhi , hou mian you jie shao ), ran hou wo men qu manual dui ying de zhang jie kan kan ru he shi yong 。 na xie guan yu bao de jie shao ni ke yi xian kan kan , wo men zhe li mei you qian xi , zhi jie qie ru zhu ti , xia mian shi Cache_Lite::get() de li zi 。 wo men jiu cong zhe ge li zi ru shou , wo zai li zi zhong zeng jia le zhong wen de zhu shi
  require_once"Cache/Lite.php";// zhe li shi xiang dui PEAR de di zhi , zhao dao gang cai xia zai de bao zhong Lite.php zhe ge wen jian hou ni jiu ying gai zhi dao ru he bu shu zhe ge wen jian jia le !
  $options=array(
  'cacheDir'=>'/tmp/',// zhe li shi Cache de lu jing , zui hao yong jue dui lu jing , wo men de li zi zhong jiang hui you shuo ming
  'lifeTime'=>7200,// huan cun de shi xiao shi jian , miao wei dan wei
  'pearErrorMode'=>CACHE_LITE_ERROR_DIE// bao cuo mo shi
  );
  $cache=newCache_Lite($options);// shen shu she zhi wan zhi hou jian li huan cun
  if($data=$cache->get('id_of_the_page')){// ru guo id=id_of_the_page zhe ge huan cun cun zai de hua , ze zhi jie jiang huan cun shu ju echo chu lai
  // Cache hit !
  // Content is in $data
  // (...)
  }else{// huan cun bu cun zai , ze sheng cheng huan cun
  // No valid cache found (you have to make and save the page)
  // (...)
  }
  kan le shang mian de zhe ge li zi , shi bu shi fa xian hen jian dan ? qi shi huan cun de guan jian zhi chu bu zai yu ru he sheng cheng he shan chu huan cun , er zai yu ru he ping heng huan cun jing zhi he dong tai de guan xi , ru he zai shi dang de shi hou chong jian huan cun 。 xia mian wo kai shi ju li , rang da jia ti hui dao huan cun de hao chu !, qing zai tutor( wo men jiao cheng zhong de li zi dui ying de gen mu lu ) xia jian li wen jian cache,*nix cao zuo xi tong qing she zhi shu xing wei 0777, ran hou zai tutor wen jian jia xia jian li cache.php, shu ru xia mian de dai ma
  < ?php
  require_once"config.php";
  require_once"Cache/Lite.php";
  // xia mian de dai ma shi ji suan ye mian zhi xing shi jian , he cache wu guan
  functionget_microtime()
   {
   list($usec,$sec)=explode(' ',microtime());
   return((float)$usec+(float)$sec);
   }
  $s= get_microtime();
  // xia mian shi huan cun de she zhi
  $options=array(
   'cacheDir'=> WEB_DIR."/cache/",
   // qing zai tutor( wo men jiao cheng zhong de li zi dui ying de gen mu lu )
   // xia jian li wen jian cache,
   //*nix cao zuo xi tong qing she zhi shu xing wei 0777
   'lifeTime'=>10,//10 miao shi xiao shi jian
   'pearErrorMode'=> CACHE_LITE_ERROR_DIE
  );
  $cache=newCache_Lite($options);
  $cache_id='cache';//id yi ding yao wei yi
  // fou ze hui he bie ren de cache chu xian chong tu
  if($data=$cache->get($cache_id)){
  //data shi huo qu shu ju de jie guo , ru guo huan cun cun zai bing qie mei you guo qi ,
  // zhi jie qu chu shu ju
   echo$data;
  }else{
   // fou ze wo men jian li huan cun
   // xia mian wo men gu yi yong xun huan lai hao shi
   while($i<10000000)
   $i++ ;
   $data=' huan cun jian li de shi jian :'.date("Y-m-d H:i:s");
   $data.="<p> mei you huan cun zhi xing de shi jian shi :".(get_microtime()-$s)." miao ";
   echo$data;
   $cache->save($data);
  
  }
  echo"<p> dang qian ye mian hao shi :".(get_microtime()-$s)." miao </p>";
  ?>
  zai liu lan qi zhong yun xing http://127.0.0.1/tutor/cache.php, ran hou kan kan cache de mu lu xia shi bu shi sheng cheng le yi ge wen jian , hen you cheng jiu gan ba ?!
  zai web ye mian wo men fa xian di yi ci yun xing de shi jian yong shi da yue 1 miao , huan cun sheng cheng zhi hou yong shi ze zhi wei yuan lai de 1/1000, zhe yang de xiao lv jiu bu xu yao wo zai duo yu miao shu le ba !! qi shi shang mian zhe ge li zi de da ti liu cheng shi ,1. jian li huan cun shen shu , bao kuo huan cun de ID;2. gen ju shen shu he ID jian cha huan cun shi fou cun zai , ru guo cun zai , ze huan cun shu ju bei huo qu zai $data bian liang zhong , ran hou echo chu lai , fou ze chong xin sheng cheng huan cun , jiang ye mian de jie guo bao cun zai bian liang zhong , ran hou jiang bian liang de shu ju xie ru huan cun 。 bu guo zhe yang de fang shi hen bu fang bian , yin wei suo you de shu chu wo men bi xu jiang qi xie dao yi ge bian liang zhong , zhe yang qi shi shi bi jiao ma fan de , yao yong dao hen duo zi fu chuan lian jie , dai ma hen nan wei hu , dang ran jian dan de cache zui hao huan shi jian yi cai yong zhe yang de fang shi 。 bu guo ni bie dan xin , qiang da de PEAR bu hui zhe me ruo zhi de , suo yi ta ye ti gong le ling wai yi zhong fang shi , qi shi jiu shi huo qu huan chong qu qu chu bian liang de fang shi , xia mian kan kan zhe ge jian dan de li zi , dui ying de manual zhang jie zai zhe li 。
  < ?php
  require_once"config.php";
  require_once"Cache/Lite/Output.php";
  // zhu yi , zhe li require de wen jian bu yi yang le o
  $options=array(
   'cacheDir'=> WEB_DIR."/cache/",
   'lifeTime'=>10,//10 miao shi xiao shi jian
   'pearErrorMode'=> CACHE_LITE_ERROR_DIE
  );
  $cache=newCache_Lite_Output($options);
  $cache_id='obcache';
  if(!($cache->start($cache_id))){
   // ru guo bu cun zai , ze jian li huan cun , cun zai de hua , cheng xu zi dong jiu jiang huan cun shu chu le
  ?>
  zhe li ni xiang gan shen me jiu gan shen me ,
  bao kuo zhi xing php
  bao kuo shu ju ku cha xun
  zhi yao shi php yuan xu de dou ke yi zai zhe li wan cheng
  shi bu shi hen fang bian ne
  < ?php
   $cache->end();// zhe ge qian wan bie wang ji le ,
   // fou ze huan cun yong yuan jian li bu cheng gong ,
   // zhe ge han shu jiu shi zai chu lai output buffer
  }
  ?>
  zai qu kan kan cache de mu lu xia shi bu shi you duo le yi ge wen jian ?
  cache jiu jie shao dao zhe li , xia mian you ji ge xu yao zhu yi de di fang :
  1.cache de ID yi ding yao wei yi , ke yi jiang yi xie shen shu ji cheng jin lai
  2.cache de huan cun lu jing zui hao xie jue dui lu jing
  3. ben jie de chong dian zai yu zhu shi , qing zai xi yue du zhu shi
  ling wai , tong guo wo de jie shao , ru he shan chu huan cun da jia ke yi qu kan kan dui ying de shou ce le , shang mian de li zi zai yu pao zhuan yin yu , ru guo shang mian de li zi ni hui yong le , jie xia de huan cun cao zuo ying gai bu shi nan shi le 。【原文】【汉音对照
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
qian mian jie shao le pear de an zhuang , jin tian kai shi jie shao pear de ji ge zhi ming de package zhi yi , ru guo you bu qing chu de di fang qing zhan nei sou suo “PEAR jiao cheng ” huo qu qian mian de jiao cheng ! jin tian wo men yao jie shao de shi PEAR de Cache_Lite bao , zuo web de shuo dao ti su yan jing deng da de cheng du jue bu ya yu nan ren jian dao jue se mei nv shi yan jing suo deng da de cheng du , yin ci , wo zhe li di yi ge yao jie shao de jiu shi PEAR de Cache_lite bao , li yong zhe ge package ke yi gen ju ni de xu yao huan cun wang ye de ren he yi ge bu fen , cong er da da de ti gao le ye mian de sheng cheng he zai ru su du ! shou xian qu Pear de List Packages xia zai Cache_Lite zhe ge an zhuang bao , xie zhe ge jiao cheng de shi hou , wen ding de ban ben shi 1.7.2, suo yi wo men jiu xia zai zhe ge ban ben , xia zai xia lai hou jie ya suo , ran hou jiang wen jian fang zhi zai PEAR de gen mu lu xia ( wen jian mu lu ru he zu zhi , hou mian you jie shao ), ran hou wo men qu manual dui ying de zhang jie kan kan ru he shi yong 。 na xie guan yu bao de jie shao ni ke yi xian kan kan , wo men zhe li mei you qian xi , zhi jie qie ru zhu ti , xia mian shi Cache_Lite::get() de li zi 。 wo men jiu cong zhe ge li zi ru shou , wo zai li zi zhong zeng jia le zhong wen de zhu shi require_once"Cache/Lite.php";// zhe li shi xiang dui PEAR de di zhi , zhao dao gang cai xia zai de bao zhong Lite.php zhe ge wen jian hou ni jiu ying gai zhi dao ru he bu shu zhe ge wen jian jia le ! $options=array( 'cacheDir'=>'/tmp/',// zhe li shi Cache de lu jing , zui hao yong jue dui lu jing , wo men de li zi zhong jiang hui you shuo ming 'lifeTime'=>7200,// huan cun de shi xiao shi jian , miao wei dan wei 'pearErrorMode'=>CACHE_LITE_ERROR_DIE// bao cuo mo shi ); $cache=newCache_Lite($options);// shen shu she zhi wan zhi hou jian li huan cun if($data=$cache->get('id_of_the_page')){// ru guo id=id_of_the_page zhe ge huan cun cun zai de hua , ze zhi jie jiang huan cun shu ju echo chu lai // Cache hit ! // Content is in $data // (...) }else{// huan cun bu cun zai , ze sheng cheng huan cun // No valid cache found (you have to make and save the page) // (...) } kan le shang mian de zhe ge li zi , shi bu shi fa xian hen jian dan ? qi shi huan cun de guan jian zhi chu bu zai yu ru he sheng cheng he shan chu huan cun , er zai yu ru he ping heng huan cun jing zhi he dong tai de guan xi , ru he zai shi dang de shi hou chong jian huan cun 。 xia mian wo kai shi ju li , rang da jia ti hui dao huan cun de hao chu !, qing zai tutor( wo men jiao cheng zhong de li zi dui ying de gen mu lu ) xia jian li wen jian cache,*nix cao zuo xi tong qing she zhi shu xing wei 0777, ran hou zai tutor wen jian jia xia jian li cache.php, shu ru xia mian de dai ma < ?php require_once"config.php"; require_once"Cache/Lite.php"; // xia mian de dai ma shi ji suan ye mian zhi xing shi jian , he cache wu guan functionget_microtime() { list($usec,$sec)=explode(' ',microtime()); return((float)$usec+(float)$sec); } $s= get_microtime(); // xia mian shi huan cun de she zhi $options=array( 'cacheDir'=> WEB_DIR."/cache/", // qing zai tutor( wo men jiao cheng zhong de li zi dui ying de gen mu lu ) // xia jian li wen jian cache, //*nix cao zuo xi tong qing she zhi shu xing wei 0777 'lifeTime'=>10,//10 miao shi xiao shi jian 'pearErrorMode'=> CACHE_LITE_ERROR_DIE ); $cache=newCache_Lite($options); $cache_id='cache';//id yi ding yao wei yi // fou ze hui he bie ren de cache chu xian chong tu if($data=$cache->get($cache_id)){ //data shi huo qu shu ju de jie guo , ru guo huan cun cun zai bing qie mei you guo qi , // zhi jie qu chu shu ju echo$data; }else{ // fou ze wo men jian li huan cun // xia mian wo men gu yi yong xun huan lai hao shi while($i<10000000) $i++ ; $data=' huan cun jian li de shi jian :'.date("Y-m-d H:i:s"); $data.="<p> mei you huan cun zhi xing de shi jian shi :".(get_microtime()-$s)." miao "; echo$data; $cache->save($data); } echo"<p> dang qian ye mian hao shi :".(get_microtime()-$s)." miao </p>"; ?> zai liu lan qi zhong yun xing [url=http://127.0.0.1/tutor/cache.php]http://127.0.0.1/tutor/cache.php[/url], ran hou kan kan cache de mu lu xia shi bu shi sheng cheng le yi ge wen jian , hen you cheng jiu gan ba ?! zai web ye mian wo men fa xian di yi ci yun xing de shi jian yong shi da yue 1 miao , huan cun sheng cheng zhi hou yong shi ze zhi wei yuan lai de 1/1000, zhe yang de xiao lv jiu bu xu yao wo zai duo yu miao shu le ba !! qi shi shang mian zhe ge li zi de da ti liu cheng shi ,1. jian li huan cun shen shu , bao kuo huan cun de ID;2. gen ju shen shu he ID jian cha huan cun shi fou cun zai , ru guo cun zai , ze huan cun shu ju bei huo qu zai $data bian liang zhong , ran hou echo chu lai , fou ze chong xin sheng cheng huan cun , jiang ye mian de jie guo bao cun zai bian liang zhong , ran hou jiang bian liang de shu ju xie ru huan cun 。 bu guo zhe yang de fang shi hen bu fang bian , yin wei suo you de shu chu wo men bi xu jiang qi xie dao yi ge bian liang zhong , zhe yang qi shi shi bi jiao ma fan de , yao yong dao hen duo zi fu chuan lian jie , dai ma hen nan wei hu , dang ran jian dan de cache zui hao huan shi jian yi cai yong zhe yang de fang shi 。 bu guo ni bie dan xin , qiang da de PEAR bu hui zhe me ruo zhi de , suo yi ta ye ti gong le ling wai yi zhong fang shi , qi shi jiu shi huo qu huan chong qu qu chu bian liang de fang shi , xia mian kan kan zhe ge jian dan de li zi , dui ying de manual zhang jie zai zhe li 。 < ?php require_once"config.php"; require_once"Cache/Lite/Output.php"; // zhu yi , zhe li require de wen jian bu yi yang le o $options=array( 'cacheDir'=> WEB_DIR."/cache/", 'lifeTime'=>10,//10 miao shi xiao shi jian 'pearErrorMode'=> CACHE_LITE_ERROR_DIE ); $cache=newCache_Lite_Output($options); $cache_id='obcache'; if(!($cache->start($cache_id))){ // ru guo bu cun zai , ze jian li huan cun , cun zai de hua , cheng xu zi dong jiu jiang huan cun shu chu le ?> zhe li ni xiang gan shen me jiu gan shen me , bao kuo zhi xing php bao kuo shu ju ku cha xun zhi yao shi php yuan xu de dou ke yi zai zhe li wan cheng shi bu shi hen fang bian ne < ?php $cache->end();// zhe ge qian wan bie wang ji le , // fou ze huan cun yong yuan jian li bu cheng gong , // zhe ge han shu jiu shi zai chu lai output buffer } ?> zai qu kan kan cache de mu lu xia shi bu shi you duo le yi ge wen jian ? cache jiu jie shao dao zhe li , xia mian you ji ge xu yao zhu yi de di fang : 1.cache de ID yi ding yao wei yi , ke yi jiang yi xie shen shu ji cheng jin lai 2.cache de huan cun lu jing zui hao xie jue dui lu jing 3. ben jie de chong dian zai yu zhu shi , qing zai xi yue du zhu shi ling wai , tong guo wo de jie shao , ru he shan chu huan cun da jia ke yi qu kan kan dui ying de shou ce le , shang mian de li zi zai yu pao zhuan yin yu , ru guo shang mian de li zi ni hui yong le , jie xia de huan cun cao zuo ying gai bu shi nan shi le 。
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
越来越漂亮的楚楚(7)
越来越漂亮的楚楚(6)
越来越漂亮的楚楚(5)
越来越漂亮的楚楚(4)
共长一色
水中莲
峰林晚照
远离喧嚣——山村小景
 
>>返回首页<<
 为你推荐
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
©2005- 王朝网络 版权所有