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

清空信息
关闭评论
investicrypto
 investicrypto 约 7 小时前回复
#156
<a href="http://www.soextfence.com/adidas-neo-canvas-azul-blanco-zapatosk">adidas neo canvas azul blanco</a> <a href="http://www.amemedgroup.com/north-face-girls-reversible-jacket-northfaceh">north face girls reversible jacket</a> <a href="http://www.shawkreizer.com/nike-lunarepic-low-flyknit-grau-schwarz-wei%C3%9F-schuhek">nike lunarepic low flyknit grau schwarz wei脽</a> <a href="http://www.powerwomanbc.com/nike-huarache-alle-bl%C3%A5-skoi">nike huarache alle bl氓</a> <a href="http://www.kilaswacana.com/acheter-adidas-prougeator-lz-trx-fg-chaussuresh">acheter adidas prougeator lz trx fg</a> <a href="http://www.hobartcomfest.com/buy-new-york-yankees-cap-hatl">buy new york yankees cap</a>
[url=http://www.investicrypto.com/]investicrypto[/url]
alcovozov
 alcovozov 约 8 小时前回复
#155
<a href="http://www.lagunawoodsre.com/nike-air-yeezy-2-plata-rojo-zapatosk">nike air yeezy 2 plata rojo</a> <a href="http://www.highbacklink.com/mujeres-nike-flyknit-racer-azul-rojo-zapatosp">mujeres nike flyknit racer azul rojo</a> <a href="http://www.vuurogen.com/north-face-steep-tech-sizing-northfaceh">north face steep tech sizing</a> <a href="http://www.rsvppersonnel.com/air-jordan-retro-14-dam%C3%A4nner-gelb-grau-schuhej">air jordan retro 14 dam盲nner gelb grau</a> <a href="http://www.shonema.com/kvinders-air-yeezy-ii-2-sp-max-90-alle-bl%C3%A5-skoh">kvinders air yeezy ii 2 sp max 90 alle bl氓</a> <a href="http://www.enventsurvey.com/hommes-nike-flyknit-lunar-3-jaune-violet-chaussuresh">hommes nike flyknit lunar 3 jaune violet</a>
alcovozov http://www.alcovozov.com/
leadercheetah
 leadercheetah 约 20 小时前回复
#154
<a href="http://www.diplomabroad.com/nike-air-max-2016-white-shoesk">nike air max 2016 white</a> <a href="http://www.trechadental.com/r%C3%B8d-nike-darwin-skol">r酶d nike darwin</a> <a href="http://www.akhbarsanaye.com/nike-dunk-high-svart-kvinners-obuvk">nike dunk high svart kvinners</a> <a href="http://www.timxes.com/full-bianca-adidas-superstar-scarpei">full bianca adidas superstar</a> <a href="http://www.leadercheetah.com/nike-air-max-tn-hombres-rojo-zapatosh">nike air max tn hombres rojo</a> <a href="http://www.arealleader.com/2018-nike-air-max-air-max-2018-orange-sort-skok">2018 nike air max air max 2018 orange sort</a>
leadercheetah http://www.leadercheetah.com/
flushnhunt
 flushnhunt 2019-04-25 03:37回复
#153
<a href="http://www.teamdalarna.com/nike-zoom-pegasus-31-r%C3%B8d-skoh">nike zoom pegasus 31 r酶d</a> <a href="http://www.syairshamyoun.com/femmes-nike-air-max-tailwind-5-rose-bleu-chaussuresh">femmes nike air max tailwind 5 rose bleu</a> <a href="http://www.fizalisfresh.com/under-armour-rock-threadborne-cap-hatl">under armour rock threadborne cap</a> <a href="http://www.fsscas.com/nike-lebron-witness-gris-rose-chaussuresh">nike lebron witness gris rose</a> <a href="http://www.imagimp.com/air-jordan-retro-4-mujeres-p%C3%BArpura-gris-zapatosk">air jordan retro 4 mujeres p煤rpura gris</a> <a href="http://www.burmamaritime.com/nike-kobe-12-pink-yellow-shoesi">nike kobe 12 pink yellow</a>
flushnhunt http://www.flushnhunt.com/
ultimumbaby
 ultimumbaby 2019-04-23 07:25回复
#152
<a href="http://www.avantajreyonu.com/black-nike-mercurial-football-boots-shoesi">black nike mercurial football boots</a> <a href="http://www.oranjeskishop.com/air-jordan-iv-bianca-cemaschiot-scarpej">air jordan iv bianca cemaschiot</a> <a href="http://www.johannafrost.com/nike-air-max-dam%C3%A4nner-blau-and-wei%C3%9F-schuhej">nike air max dam盲nner blau and wei脽</a> <a href="http://www.rolandviet.com/purdue-boilermakers-nike-ncaa-sideline-true-snapback-cap-hath">purdue boilermakers nike ncaa sideline true snapback cap</a> <a href="http://www.classmedya.com/nike-free-run-2-noir-and-gris-chaussuresh">nike free run 2 noir and gris</a> <a href="http://www.anteageserums.com/nike-lebron-soldier-10-lila-schuheh">nike lebron soldier 10 lila</a>
ultimumbaby http://www.ultimumbaby.com/
photodose
 photodose 2019-04-22 19:37回复
#151
<a href="http://www.vdart.net/nike-air-max-tn-guld-and-hvid-game-scarpee">nike air max tn guld and hvid game</a> <a href="http://www.ventarium.net/adidas-ultra-boost-triple-negro-ba8920-scarpeg">adidas ultra boost triple negro ba8920</a> <a href="http://www.villacafaggio.net/nike-zoom-clear-out-2-blu-argento-kurpesa">nike zoom clear out 2 blu argento</a> <a href="http://www.vipervaporcheck.net/nike-free-3.0-focfly-so-gr%C3%A5-oransje-schuhee">nike free 3.0 focfly so gr氓 oransje</a> <a href="http://www.visitojaica.net/nike-free-3.0-v6-damenn-rosa-kurpesb">nike free 3.0 v6 damenn rosa</a> <a href="http://www.vivaeuropa.net/nike-roshe-run-damaschio-rosa-schwarz-kurpesa">nike roshe run damaschio rosa schwarz</a>
photodose http://www.photodose.net/
dbievents
 dbievents 2019-04-22 19:03回复
#150
<a href="http://www.germanxtube.com/nike-mercurical-victory-vi-tf-arancia-cleats-scarpei">nike mercurical victory vi tf arancia cleats</a> <a href="http://www.eugenesklyar.com/adidas-springblade-drive-2.0-azul-zapatosh">adidas springblade drive 2.0 azul</a> <a href="http://www.bamadu.com/nike-air-max-1-ultra-flyknit-bl%C3%A5-skok">nike air max 1 ultra flyknit bl氓</a> <a href="http://www.gamekeyssale.com/kvinners-nike-air-force-1-all-rosa-obuvi">kvinners nike air force 1 all rosa</a> <a href="http://www.aktuelresim.com/nike-air-max-90-zapatilla-de-deporte-boot-ns-blanco-negro-zapatosl">nike air max 90 zapatilla de deporte boot ns blanco negro</a> <a href="http://www.myshoesonsale.com/ray-ban-round-gold-metal-sunglassesh">ray ban round gold metal</a>
dbievents http://www.dbievents.com/
escortfeeds
 escortfeeds 2019-04-21 11:42回复
#149
<a href="http://www.snifferwalk.com/nike-dunk-gull-gr%C3%A5-obuvl">nike dunk gull gr氓</a> <a href="http://www.fishmackerel.com/mens-nike-roshe-run-speckle-pink-green-shoesh">mens nike roshe run speckle pink green</a> <a href="http://www.lauraenergy.com/air-jordan-retro-9-royal-blu-gituttio-scarpei">air jordan retro 9 royal blu gituttio</a> <a href="http://www.magellantt.com/adidas-zx-700-gold-lila-schuhej">adidas zx 700 gold lila</a> <a href="http://www.sportablecrew.com/detroit-lions-new-era-nfl-core-shore-9twenty-cap-hath">detroit lions new era nfl core shore 9twenty cap</a> <a href="http://www.digisolnc.com/hommes-nike-air-max-tailwind-8-tout-rose-chaussuresh">hommes nike air max tailwind 8 tout rose</a>
escortfeeds http://www.escortfeeds.com/
vspeyedoctors
 vspeyedoctors 2019-04-21 04:23回复
#148
<a href="http://www.placedumusee.com/nike-flyknit-lunar-2-zwart-for-vendita-obuvd">nike flyknit lunar 2 zwart for vendita</a> <a href="http://www.prismbuffalo.com/nike-air-max-bw-cargo-khaki-wei%C3%9F-scarpea">nike air max bw cargo khaki wei脽</a> <a href="http://www.surlion.com/nike-free-5.0-uk-barato-scarpef">nike free 5.0 uk barato</a> <a href="http://www.tokodanaya.com/adidas-nmd-runner-alle-schwarz-ops-2-obuvd">adidas nmd runner alle schwarz ops 2</a> <a href="http://www.damimiyy.com/nike-free-run-5.0-hommes-noir-uk-scarpea">nike free run 5.0 hommes noir uk</a> <a href="http://www.dinerwareoc.com/air-jordan-retro-4-brun-gull-chaussuresg">air jordan retro 4 brun gull</a>
vspeyedoctors http://www.vspeyedoctors.com/
taiwanmeinet
 taiwanmeinet 2019-04-21 03:59回复
#147
<a href="http://www.rcrocs.com/menn-nike-kobe-9-lilla-gr%C3%B8nn-svart-obuvj">menn nike kobe 9 lilla gr酶nn svart</a> <a href="http://www.moreheaddotts.com/maschio-nike-free-run-5.0-rosa-scarpel">maschio nike free run 5.0 rosa</a> <a href="http://www.qgchsmrt.com/hommes-adidas-climachill-gazelle-boost-royal-bleu-gris-chaussuresh">hommes adidas climachill gazelle boost royal bleu gris</a> <a href="http://www.firagandia.com/air-jordan-retro-13-low-bianca-nero-scarpeh">air jordan retro 13 low bianca nero</a> <a href="http://www.lmladeco.com/boston-red-sox-blue-jersey-nfli">boston red sox blue jersey</a> <a href="http://www.brinkmanmdc.com/converse-gris-rojo-zapatosh">converse gris rojo</a>
taiwanmeinet http://www.taiwanmeinet.com/
顶部留言底部
 00:00/00:00
我想和你虚度时光 - 花房姑娘(9)
  1. 我想和你虚度时光
  2. 花房姑娘
  3. 恋恋风尘
  4. 我喜爱一切不彻底的事物
  5. 我的心里是满的
  6. Long Way
  7. 给少年的歌
  8. 晴日共剪窗
  9. 天上的月你的脸