phpcms程式二次開發記錄

來源:互聯網
上載者:User

標籤:http   get   使用   檔案   資料   類   

1. phpcms/base.php 中的 pc_base 類 靜態類,主要載入各個檔案使用。
2. pc_base 中 load_sys_func 等帶 sys的函數,基本都是載入 lib下檔案。 func載入functions下; class 載入 class下
3. pc_base 中 函數一般第一個參數為檔案名稱,第二個參數為路徑,第3個參數有一般為:載入類是否實體化
4. pc_base 中 load_app開頭則為載入modules下的 functions和class等
5. 網站開始入口控制器 phpcms/libs/classes/application.class.php . init()方法檢測參數的 函數名稱。 預設規則 /caches/configs/route.php 定義
6. 預設執行:/phpcms/modules/content/index.php ->init()
7. 預設執行模組資料庫調用: /phpcms/model/content_model.class.php 載入 系統 /phpcms/libs/classes/model.class.php
8. /phpcms/libs/classes/db_factory.class.php 資料庫連接工廠 ; 處理串連那個資料庫 預設參數配置 /cache/configs/database.php default
9. db_factory.class.php connect() 返回具體的資料庫操作類實體 預設為: phpcms/libs/classes/mysql.class.php
10. /phpcms/libs/classes/model.class.php 預設串連資料庫 $db_setting 參數設定 在【8】中調用
11.model.cass.php $db 獲得資料庫連接; 此類中也有資料庫的基本操作處理,具體資料庫操作使用 【9】 返回的實體類操作
12.系統核心函數檔案 /phpcms/libs/functions/global.func.php 主要操作為: getcache 和 template
13.getcache ,調用cache設定檔 /caches/configs/cache.php 預設為:file類型
14.getcache 調用cache系統控制類:cache_factory.class.php;預設為file類型cache file 參數調用cache具體系統處理類:cache_file.class.php get方法獲得具體cachename對應的檔案返回數組
15.getcache 具體參數說明: 第一個參數為cache檔案名稱 ,第二個參數為cache目錄參數 且cache預設調用路徑為caches_data 如: /caches/caches_第二參數/caches_data/第一參數檔案名稱.cache.php
16.setcache 幕後處理或安裝時系統產生 主要根據資料庫表cache中記錄是否存在來判斷操作,存在則更新,不存在則添加,檔案操作同資料庫表
17.template 模板模組名稱,調用檔案名稱,調用模板名稱(預設為default)模板系統處理類:/phpcms/libs/classes/template_cache.class.php 主要調用template_compile 解析模板並替換模板
18.template_cache.class.php 調用template_parse 來正則替換模板中的標籤
19.模板中,標籤主要是pc:類型名 template_cache.class.php 用 pc_tag來解析 pc:類型名 , 標籤中 action為函數名稱,類型名為調用的標籤處理類名稱,其餘標籤屬性為參數,一般載入的處理類為模組下classes下的標籤類如:/content/classe/content_tag.class.php ; 類型名為(‘json‘, ‘xml‘, ‘block‘, ‘get‘)時,特別解析

 

特別說明:
base.php中參數 或者到後台更改參數 設定-》基本設定中更改
//定義網站根路徑
define(‘WEB_PATH‘,pc_base::load_config(‘system‘,‘web_path‘));
//js 路徑
define(‘JS_PATH‘,pc_base::load_config(‘system‘,‘js_path‘));
//css 路徑
define(‘CSS_PATH‘,pc_base::load_config(‘system‘,‘css_path‘));
//img 路徑
define(‘IMG_PATH‘,pc_base::load_config(‘system‘,‘img_path‘));
//動態程式路徑
define(‘APP_PATH‘,pc_base::load_config(‘system‘,‘app_path‘));
定義的都是帶網域名稱的參數,故更改網域名稱後需要更改這些參數 /caches/configs/system.php
‘js_path‘ => ‘http://www.xxx.com/statics/js/‘, //CDN JS
‘css_path‘ => ‘http://www.xxx.com/statics/css/‘, //CDN CSS
‘img_path‘ => ‘http://www.xxx.com/statics/images/‘, //CDN img
‘app_path‘ => ‘http://www.xxx.com/‘,//動態網域名稱配置地址

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.