好!欢迎访问迷津渡口 现在时间是: 天气 °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 前台启动
   支持一下
挤眼 亲亲 咆哮 开心 想想 可怜 糗大了 委屈 哈哈 小声点 右哼哼 左哼哼 疑问 坏笑 赚钱啦 悲伤 耍酷 勾引 厉害 握手 耶 嘻嘻 害羞 鼓掌 馋嘴 抓狂 抱抱 围观 威武 给力
 点赞
 签到
 表情
 图片
 代码
提交评论

清空信息
关闭评论
rollaname
 rollaname 2019-05-21 09:27回复
#202
<a href="http://www.champste.com/air-jordan-1-mid-sort-r%C3%B8d-skol">air jordan 1 mid sort r酶d</a> <a href="http://www.rollaname.com/converse-chuck-taylor-high-top-hvit-obuvk">converse chuck taylor high top hvit</a> <a href="http://www.sfcigar.com/nike-air-max-90-triple-grigio-scarpei">nike air max 90 triple grigio</a> <a href="http://www.slotoyunpro.com/nike-hyperdunk-2016-plata-rosado-zapatosh">nike hyperdunk 2016 plata rosado</a> <a href="http://www.eistyles.com/r%C3%B8d-adidas-ace-16-skok">r酶d adidas ace 16</a> <a href="http://www.filmoriental.com/nike-air-huarache-r%C3%B8d-hvit-obuvi">nike air huarache r酶d hvit</a>
rollaname http://www.rollaname.com/
vstsblog
 vstsblog 2019-05-21 07:25回复
#201
<a href="http://www.snifferwalk.com/adidas-superstar-appelsin-gr%C3%B8n-skoj">adidas superstar appelsin gr酶n</a> <a href="http://www.fishmackerel.com/adidas-zx-850-mennns-lilla-obuvi">adidas zx 850 mennns lilla</a> <a href="http://www.lauraenergy.com/nike-zoom-ascention-rosa-himmelen-bl%C3%A5-obuvk">nike zoom ascention rosa himmelen bl氓</a> <a href="http://www.magellantt.com/kvinners-nike-air-max-2017-oransje-gr%C3%B8nn-obuvi">kvinners nike air max 2017 oransje gr酶nn</a> <a href="http://www.sportablecrew.com/nike-air-force-1-rojo-p%C3%BArpura-zapatosk">nike air force 1 rojo p煤rpura</a> <a href="http://www.digisolnc.com/coach-travel-tote-bags-coachh">coach travel tote bags</a>
vstsblog http://www.vstsblog.com/
zululeads
 zululeads 2019-05-20 11:46回复
#200
<a href="http://www.mumbaikichut.com/herre-nike-blazer-gr%C3%A5-guld-skoi">herre nike blazer gr氓 guld</a> <a href="http://www.ikmsdkravmaga.com/nike-flyknit-trainer-oro-rosa-scarpeq">nike flyknit trainer oro rosa</a> <a href="http://www.themusinglens.com/adidas-nmd-runner-purple-blue-shoesj">adidas nmd runner purple blue</a> <a href="http://www.startagencia.com/mk-hand-purse-mkh">mk hand purse</a> <a href="http://www.drjennieward.com/nike-kd-7-kvinners-bl%C3%A5-hvit-obuvi">nike kd 7 kvinners bl氓 hvit</a> <a href="http://www.genievres.com/femminile-nike-lunarglide-7-tutti-gituttio-scarpej">femminile nike lunarglide 7 tutti gituttio</a>
[url=http://www.zululeads.com/]zululeads[/url]
tickbits
 tickbits 2019-05-20 09:06回复
#199
<a href="http://www.pepinmystep.com/new-era-cap-jordan-blue-bull-hatg">new era cap jordan blue bull</a> <a href="http://www.burayagidin.com/nike-air-max-90-neon-pink-skox">nike air max 90 neon pink</a> <a href="http://www.wearechicanos.com/barato-adidas-tubular-runner-mujeres-p%C3%BArpura-shoesb">barato adidas tubular runner mujeres p煤rpura</a> <a href="http://www.oceantent.com/nike-blazer-low-mujeres-verde-runningb">nike blazer low mujeres verde</a> <a href="http://www.mymascensores.com/ugg-pink-bailey-bow-womens-uggsr">ugg pink bailey bow womens</a> <a href="http://www.mbejobs.com/ray-ban-gold-black-aviator-sunglasses-sunglassesr">ray ban gold black aviator sunglasses</a>
tickbits http://www.tickbits.com/
emcetolerie
 emcetolerie 2019-05-20 08:46回复
#198
<a href="http://www.thebiarritz.com/kvinders-nike-kd-8-lyser%C3%B8d-gr%C3%B8n-skoi">kvinders nike kd 8 lyser酶d gr酶n</a> <a href="http://www.voydnet.com/air-jordan-retro-7-royal-blu-grigio-scarpeq">air jordan retro 7 royal blu grigio</a> <a href="http://www.foneandlone.com/nike-free-flyknit-yellow-shoesj">nike free flyknit yellow</a> <a href="http://www.roomwhiz.com/michael-kors-fulton-large-shoulder-tote-bag-mkh">michael kors fulton large shoulder tote bag</a> <a href="http://www.riffsurfers.com/nike-kobe-10-bl%C3%A5-gull-obuvi">nike kobe 10 bl氓 gull</a> <a href="http://www.davidmgaines.com/nike-zoom-pegasus-32-femminile-viola-rosso-scarpej">nike zoom pegasus 32 femminile viola rosso</a>
emcetolerie http://www.emcetolerie.com/
bagsbeat
 bagsbeat 2019-05-19 12:47回复
#197
<a href="http://www.mistopup.com/nike-air-max-98-maschio-marina-militare-blu-bianca-scarpeh">nike air max 98 maschio marina militare blu bianca</a> <a href="http://www.sporbahispro.com/chris-paul-throwback-jersey-nfli">chris paul throwback jersey</a> <a href="http://www.kalrakis.com/nike-flynit-max-mujer-releases-broen-mago-negro-verde-zapatosh">nike flynit max mujer releases broen mago negro verde</a> <a href="http://www.xinyudaili.com/nike-air-pegasus-83-oro-rosado-zapatosk">nike air pegasus 83 oro rosado</a> <a href="http://www.marieluwasche.com/north-face-denali-temperature-range-northfaceh">north face denali temperature range</a> <a href="http://www.ferrepress.com/nike-air-max-1-wei%C3%9F-kinder-schuhek">nike air max 1 wei脽 kinder</a>
bagsbeat http://www.bagsbeat.com/
jkjuiceplus
 jkjuiceplus 2019-05-19 07:26回复
#196
<a href="http://www.awassessment.com/converse-classic-green-shoesi">converse classic green</a> <a href="http://www.websiteopmaat.com/hombres-nike-lebron-12-ps-elite-negro-naranja-p%C3%BArpura-zapatosi">hombres nike lebron 12 ps elite negro naranja p煤rpura</a> <a href="http://www.lopifitfl.com/kvinders-nike-air-more-uptempo-lyser%C3%B8d-skoh">kvinders nike air more uptempo lyser酶d</a> <a href="http://www.aurorefleurs.com/nike-internationalist-nero-rosso-scarpei">nike internationalist nero rosso</a> <a href="http://www.ezedcal.com/air-jordan-eclipse-blu-nero-scarpej">air jordan eclipse blu nero</a> <a href="http://www.calsportswear.com/kansas-city-royals-throwback-jersey-nflh">kansas city royals throwback jersey</a>
jkjuiceplus http://www.jkjuiceplus.com/
xgaajgeg
 xgaajgeg 2019-05-18 08:46回复
#195
<a href="http://www.htpmimoza.com/cleveland-indians-gray-jersey-nfli">cleveland indians gray jersey</a> <a href="http://www.ayakkabiyeri.com/nike-magista-opus-tpu-fg-dark-citron-verde-zapatosh">nike magista opus tpu fg dark citron verde</a> <a href="http://www.sozoteki.com/nike-free-5.0-hombres-gris-fluorescent-amarillo-zapatosk">nike free 5.0 hombres gris fluorescent amarillo</a> <a href="http://www.njforward.com/the-north-face-womens-venture-jacket-sale-northfaceh">the north face womens venture jacket sale</a> <a href="http://www.crimediainc.com/converse-turnschuhe-gr%C3%BCn-schuhek">converse turnschuhe gr眉n</a> <a href="http://www.claybrookpenn.com/nike-air-max-2017-m%C3%A6nd-sort-hvid-skoi">nike air max 2017 m忙nd sort hvid</a>
xgaajgeg http://www.xgaajgeg.com/
digisolnc
 digisolnc 2019-05-18 07:49回复
#194
<a href="http://www.ortzproducts.com/nike-roshe-sort-with-blomsts-skol">nike roshe sort with blomsts</a> <a href="http://www.cooterscamera.com/hommes-nike-air-max-bw-jaune-bleu-chaussuresq">hommes nike air max bw jaune bleu</a> <a href="http://www.marjalfun.com/nike-kaishi-noir-femmes-chaussuresl">nike kaishi noir femmes</a> <a href="http://www.alecsblog.com/herren-nike-air-max-1-blau-wei%C3%9F-schuhei">herren nike air max 1 blau wei脽</a> <a href="http://www.troudumonde.com/dam%C3%A4nner-nike-air-max-90-gelb-schwarz-schuheh">dam盲nner nike air max 90 gelb schwarz</a> <a href="http://www.smilesdrdavid.com/nike-lunar-one-shot-svart-volt-obuvj">nike lunar one shot svart volt</a>
digisolnc http://www.digisolnc.com/
radiationism
 radiationism 2019-05-17 14:24回复
#193
<a href="http://www.lakeshorelax.com/air-jordan-super-fly-v-lila-gold-foota">air jordan super fly v lila gold</a> <a href="http://www.ndrsracing.com/air-max-90-sneakerboot-gr%C3%B8nn-bl%C3%A5-runninga">air max 90 sneakerboot gr酶nn bl氓</a> <a href="http://www.stumptowninfo.com/hommes-asics-gel-noosa-tri-8-blanc-gris-scarpef">hommes asics gel noosa tri 8 blanc gris</a> <a href="http://www.theriverumc.com/jordan-flight-23-oro-azul-runningf">jordan flight 23 oro azul</a> <a href="http://www.tryicevest.com/mizuno-schuhe-wei%C3%9F-schuhei">mizuno schuhe wei脽</a> <a href="http://www.lindadent.com/new-era-red-cap-hath">new era red cap</a>
radiationism http://www.radiationism.com/
顶部留言底部
 00:00/00:00
我想和你虚度时光 - 花房姑娘(9)
  1. 我想和你虚度时光
  2. 花房姑娘
  3. 恋恋风尘
  4. 我喜爱一切不彻底的事物
  5. 我的心里是满的
  6. Long Way
  7. 给少年的歌
  8. 晴日共剪窗
  9. 天上的月你的脸