小型版php框架

項目源碼地址

鏈接地址(https://github.com/cxp1539/mi...

Framework

簡單版php框架

Framework特點

  1. 單入口index.php
  2. 採用面向對象思想,基於MVC設計思想,使用觀察者,註冊器,工廠,代理,trait特性等模式開發。
  3. 使用namespace命名空間。
  4. autoLoader自動加載類。
  5. debug,Profiler(性能分析器)。
  6. 提供一些常用類(圖片,分頁,文件上傳,驗證碼等)。
  7. 提供grunt常用的插件(文件壓縮,合併,觀察等)。
  8. 基於ArrayAccess通過數組下標訪問配置文件。
  9. obcache緩存。

項目目錄結構

classes         公共的類文件存
    --image.class.php           圖片操作類
    --logobserver.class.php     觀察者log實現類
    --page.class.php            分頁類
    --upload.class.php          文件上傳類
    --vcode.class.php           驗證碼類
conf            配置文件
    --database.php              數據庫配置
    --memcache.php              memcached配置
controls        控制器
intef           基礎接口或者抽象類
    --db.class.php              數據庫接口規範
    --observer.class.php        異常觀察者接口規範
libs            默認加載庫文件
    --action.class.php          調用控制器和方法類
    --autoloader.class.php      自動加載類
    --config.class.php          讀取配置文件類
    --controller.class.php      控制器基類
    --debug.class.php           debug調試類
    --factory.class.php         工廠類
    --globalf.class.php         全局函數類
    --memcached.class.php       memcached實現類
    --mysqli.class.php          mysqli實現類
    --obcache.class.php         obcache緩存類
    --obexception.class.php     自定義異常處理類
    --profiler.class.php        性能分析類
    --proxy.class.php           代理類
    --register.class.php        註冊器類
    --singleton.class.php       單例trait
    --url.class.php             url請求處理類    
node_modules    node插件
    grunt-contrib-concat        grunt文件合併插件
    grunt-contrib-uglify        grunt文件壓縮插件
    grunt-contrib-watch         grunt文件觀察插件     
    grunt                       grunt插件
statics         靜態資源目錄
    js                          js
    release_js                  grunt處理後的js
    css                         css
    images                      images
    uploads                     圖片上傳目錄
vies            模版目錄
Gruntfile.js    grunt配置文件
README.md       README.md
common.inc.php  核心文件
    1.定義字符集
    2.設置時區
    3.開啓session
    4.定義主目錄和靜態資源目錄常量
    5.autoLoader
    6.url獲取調用控制器和方法
    7.debug,Profiler開啓(性能分析器)
    8.初始化接收的控制器和方法處理action請求(反射機制)
    9.debug,Profiler接口,輸出debug信息,執行時間,使用內存等。
index.php       主入口
package.json    package.json
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章