好!欢迎访问迷津渡口 现在时间是: 天气 °C ~ °C

迷津渡口

越感到迷惑 越接近真理

emlog MVC解构4--前台访问过程

emlog安装完成后,由于.htaccess的作用,网站的访问都将通过入口文件index.php进行处理。


index.php利用init.php获取配置参数。

init.php开启输出缓冲:

ob_start();

利用config.php和function.base.php分别获取数据库常量和一些常用的函数。


注意:在function.base.php中有

function __autoload($class)

将include中model,controller,lib相关的类自动添加。

在这里可以看出命名规则,类文件的命名规则为`全小写的类名.php`。


同时建立网站数据缓存全局对象$CACHE:


$CACHE = Cache::getInstance();

同时,在init.php还定义了有关的用户常量,模板常量等,并将激活的插件引入。


简单总结一下几个常用的常量:

BLOG_URL:站点固定地址,'http://'开头,'/'结尾,如'http://www.qingzz.cn/'
EMLOG_ROOT:站点根目录路径,为系统实际路径如'/home/qingzzcn',结尾没有'/'
TPLS_URL:模板库地址,如'http://www.qingzz.cn/content/templates/'
TPLS_PATH:模板库路径,如'/home/qingzzcn/content/templates/'
TEMPLATE_URL:前台模板URL,如'http://www.qingzz.cn/content/templates/default/'
TEMPLATE_PATH:前台模板路径,如'/home/qingzzcn/content/templates/default/'


下面是实现MVC结构的关键:

$emDispatcher = Dispatcher::getInstance();
$emDispatcher->dispatch();
View::output();


下一篇将详细解释emlog MVC实现的关键:路由分发器--Dispacher对象。

点赞0
 标签: emlog mvc 前台启动
   支持一下
挤眼 亲亲 咆哮 开心 想想 可怜 糗大了 委屈 哈哈 小声点 右哼哼 左哼哼 疑问 坏笑 赚钱啦 悲伤 耍酷 勾引 厉害 握手 耶 嘻嘻 害羞 鼓掌 馋嘴 抓狂 抱抱 围观 威武 给力
 点赞
 签到
 表情
 图片
 代码
提交评论

清空信息
关闭评论
industrialegy
 industrialegy 约 12 小时前回复
#56
<a href="http://www.laketreepress.com/hommes-nike-zoom-pegasus-31-bleu-gris-chaussuresj">hommes nike zoom pegasus 31 bleu gris</a> <a href="http://www.prohaarklinik.com/nike-free-tr-dam%C3%A4nner-schwarz-orangen-schuhej">nike free tr dam盲nner schwarz orangen</a> <a href="http://www.bonfanticare.com/adidas-springblade-solyce-hvid-gr%C3%B8n-skok">adidas springblade solyce hvid gr酶n</a> <a href="http://www.antoniopagni.com/adidas-zx-900-verde-gituttio-scarpeh">adidas zx 900 verde gituttio</a> <a href="http://www.wcshosting.com/adidas-springblade-solyce-oro-arancia-scarpei">adidas springblade solyce oro arancia</a> <a href="http://www.biddingstream.com/dallas-cowboys-dak-prescott-color-rush-jersey-nflh">dallas cowboys dak prescott color rush jersey</a>
industrialegy http://www.industrialegy.com/
tkbelazig
 tkbelazig 约 21 小时前回复
#55
<a href="http://www.atrapaniapp.com/femmes-nike-kyrie-2-blanc-jaune-chaussuresh">femmes nike kyrie 2 blanc jaune</a> <a href="http://www.maplebeyond.com/nike-kd-8-femminile-viola-rosso-scarpeq">nike kd 8 femminile viola rosso</a> <a href="http://www.collisionsix.com/mens-nike-air-max-87-sb-green-grey-shoesj">mens nike air max 87 sb green grey</a> <a href="http://www.todololitas.com/nike-kobe-vii-wolf-gr%C3%A5-skoi">nike kobe vii wolf gr氓</a> <a href="http://www.jcwjrlaw.com/nike-flyknit-lunar-3-femminile-oro-grigio-scarpel">nike flyknit lunar 3 femminile oro grigio</a> <a href="http://www.vstsblog.com/mens-asics-gel-noosa-tri-7-silver-blue-shoesj">mens asics gel noosa tri 7 silver blue</a>
tkbelazig http://www.tkbelazig.com/
purchasetulsa
 purchasetulsa 2019-02-15 17:41回复
#54
<a href="http://www.dianaandwill.com/discount-ray-ban-glasses-half-frame-sunglassesc">discount ray ban glasses half frame</a> <a href="http://www.newagecharger.com/womens-elite-black-nike-jersey-nfl-philadelphia-eagles-customized-alternate-vapor-untouchable-nflr">womens elite black nike jersey nfl philadelphia eagles customized alternate vapor untouchable</a> <a href="http://www.foliekopen.com/blue-white-womens-nike-free-trainer-shoes-skoa">blue white womens nike free trainer shoes</a> <a href="http://www.milapioffret.com/nike-free-woman-purple-5.0-womens-sneakere">nike free woman purple 5.0 womens</a> <a href="http://www.kalraslan.com/adidas-zx-700-gr%C3%BCn-gelb-orange-kurpesa">adidas zx 700 gr眉n gelb orange</a> <a href="http://www.umuttekelbayi.com/mens-asics-gel-sendai-2-black-grey-sneakerb">mens asics gel sendai 2 black grey</a>
purchasetulsa http://www.purchasetulsa.com/
mrforgps
 mrforgps 2019-02-15 17:11回复
#53
<a href="http://www.myoastudies.com/nike-hyperdunk-wei%C3%9F-gelb-scarped">nike hyperdunk wei脽 gelb</a> <a href="http://www.reganwhimpey.com/adidas-mi-zx-flux-bianca-butya">adidas mi zx flux bianca</a> <a href="http://www.segurotiendas.com/nike-free-5.0-hombres-weight-chaussuresf">nike free 5.0 hombres weight</a> <a href="http://www.specpilot.com/nike-air-force-1-flyknit-low-brun-gr%C3%A5-butya">nike air force 1 flyknit low brun gr氓</a> <a href="http://www.texaschambers.com/adidas-zx-flux-femmes-noir-knight-schuheg">adidas zx flux femmes noir knight</a> <a href="http://www.waughjiujitsu.com/ralph-lauren-pony-polo-orange-lilla-polou">ralph lauren pony polo orange lilla</a>
mrforgps http://www.mrforgps.com/
dfarrie
 dfarrie 2019-02-13 17:23回复
#52
<a href="http://www.bhcsboosters.com/puma-red-hat-hate">puma red hat</a> <a href="http://www.denisgoulart.com/billig-nike-performance-free-kvinners-svart-runninge">billig nike performance free kvinners svart</a> <a href="http://www.donggeomdo.com/nike-free-5.0-flash-corriendo-zapatos-ho14-schuhea">nike free 5.0 flash corriendo zapatos ho14</a> <a href="http://www.ozoessaouira.com/air-jordan-melo-m8-for-venta-bc-scarpeb">air jordan melo m8 for venta bc</a> <a href="http://www.annomaplexel.com/nike-air-max-2019-green-uk-shoeso">nike air max 2019 green uk</a> <a href="http://www.bringribben.com/kobe-7-wei%C3%9F-lila-kurpesb">kobe 7 wei脽 lila</a>
dfarrie http://www.dfarrie.com/
xmrujo
 xmrujo 2019-02-12 13:37回复
#51
<a href="http://www.unefinemouche.com/chicago-bears-throwback-hat-hatl">chicago bears throwback hat</a> <a href="http://www.ayuinc.com/nike-free-inneva-photo-bleu-chaussuresh">nike free inneva photo bleu</a> <a href="http://www.unirlisboa.com/nike-kobe-8-naranja-negro-zapatosk">nike kobe 8 naranja negro</a> <a href="http://www.escortfeeds.com/adidas-rose-black-silver-shoesi">adidas rose black silver</a> <a href="http://www.rdjanitorial.com/dam%C3%A4nner-nike-flyknit-lunar-3-rot-gold-schuhei">dam盲nner nike flyknit lunar 3 rot gold</a> <a href="http://www.bookoobeats.com/hombres-nike-roshe-yeezy-boost-verde-negro-zapatosp">hombres nike roshe yeezy boost verde negro</a>
xmrujo http://www.xmrujo.com/
oldhalliwell
 oldhalliwell 2019-02-12 03:03回复
#50
<a href="http://www.mwartsdrama.com/nike-free-rn-grau-dam%C3%A4nner-schuhej">nike free rn grau dam盲nner</a> <a href="http://www.meshmotors.com/nike-free-run-sort-friday-deals-skoh">nike free run sort friday deals</a> <a href="http://www.aspenmedisys.com/air-jordan-phase-rose-bleu-ciel-chaussuresh">air jordan phase rose bleu ciel</a> <a href="http://www.smartiesland.com/milwaukee-brewers-47-mlb-axis-47-clean-up-cap-hatl">milwaukee brewers 47 mlb axis 47 clean up cap</a> <a href="http://www.emcetolerie.com/adidas-zx-850-violet-rose-chaussuresh">adidas zx 850 violet rose</a> <a href="http://www.lapaktoko.com/mujeres-nike-air-force-1-high-rojo-zapatosp">mujeres nike air force 1 high rojo</a>
oldhalliwell http://www.oldhalliwell.com/
belronctx
 belronctx 2019-02-11 22:40回复
#49
<a href="http://www.bcashed.com/jordan-13-retro-svart-tropical-teal-schuheb">jordan 13 retro svart tropical teal</a> <a href="http://www.floraanafcheh.com/manchester-city-3-sagna-home-long-sleeves-soccer-club-jersey-nflr">manchester city 3 sagna home long sleeves soccer club jersey</a> <a href="http://www.kinkfresno.com/maple-leafs-21-bobby-baun-blue-ccm-throwback-third-stitched-nhl-jersey-nflw">maple leafs 21 bobby baun blue ccm throwback third stitched nhl jersey</a> <a href="http://www.modconsol.com/jordan-future-bl%C3%A5-marinen-schuheg">jordan future bl氓 marinen</a> <a href="http://www.portlandsarl.com/air-jordan-11-frost-blanc-low-end-scarpeg">air jordan 11 frost blanc low end</a> <a href="http://www.sandyshands.com/nike-air-max-tailwind-7-mujeres-p%C3%BArpura-naranja-kurpesf">nike air max tailwind 7 mujeres p煤rpura naranja</a>
belronctx http://www.belronctx.com/
acrosstheory
 acrosstheory 2019-02-08 10:02回复
#48
<a href="http://www.artikhazirsin.com/mennns-nike-air-max-tailwind-8-r%C3%B8d-rosa-obuve">mennns nike air max tailwind 8 r酶d rosa</a> <a href="http://www.aterisrail.com/air-jordan-retro-12-obsidian-for-vente-ky-obuvd">air jordan retro 12 obsidian for vente ky</a> <a href="http://www.blockboymusic.com/adidas-samba-primeknit-gituttio-nero-kurpesf">adidas samba primeknit gituttio nero</a> <a href="http://www.dazzlle.com/nike-hyperdunk-brun-r%C3%B8d-obuvb">nike hyperdunk brun r酶d</a> <a href="http://www.haubenblick.com/kvinners-nike-air-force-1-gull-gr%C3%A5-butya">kvinners nike air force 1 gull gr氓</a> <a href="http://www.prorilpumpna.com/real-madrid-21-morata-marine-environmental-protection-home-long-sleeves-soccer-club-jersey-nflu">real madrid 21 morata marine environmental protection home long sleeves soccer club jersey</a>
acrosstheory http://www.acrosstheory.com/
annomaplexel
 annomaplexel 2019-02-07 15:11回复
#47
<a href="http://www.atolyekarinca.com/green-grey-womens-nike-roshe-two-shoes-sneakere">green grey womens nike roshe two shoes</a> <a href="http://www.dfarrie.com/nike-air-max-lunar-1-og-hvid-r%C3%B8d-sort-obuvc">nike air max lunar 1 og hvid r酶d sort</a> <a href="http://www.mwsuperstore.com/brazil-6-marcelo-away-soccer-country-jersey-nflw">brazil 6 marcelo away soccer country jersey</a> <a href="http://www.shanamorgan.com/2014-15-chelsea-fc-26-terry-home-soccer-shirt-kit-nflv">2014 15 chelsea fc 26 terry home soccer shirt kit</a> <a href="http://www.crisgarrett.com/orange-womens-nike-eastham-mid-txt-shoes-skog">orange womens nike eastham mid txt shoes</a> <a href="http://www.rejuvmedia.com/adidas-eqt-boost-hombres-naranja-skob">adidas eqt boost hombres naranja</a>
annomaplexel http://www.annomaplexel.com/
顶部留言底部
 00:00/00:00
我想和你虚度时光 - 花房姑娘(9)
  1. 我想和你虚度时光
  2. 花房姑娘
  3. 恋恋风尘
  4. 我喜爱一切不彻底的事物
  5. 我的心里是满的
  6. Long Way
  7. 给少年的歌
  8. 晴日共剪窗
  9. 天上的月你的脸