Subversion Repositories php-qbpwcf

Rev

Rev 246 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
246 liveuser 1
<?php
2
 
3
/*
4
 
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
6
    Copyright (C) 2014~2026 MIN ZHI, CHEN
7
 
8
    This file is part of QBPWCF.
9
 
10
    QBPWCF is free software: you can redistribute it and/or modify
11
    it under the terms of the GNU General Public License as published by
12
    the Free Software Foundation, either version 3 of the License, or
13
    (at your option) any later version.
14
 
15
    QBPWCF is distributed in the hope that it will be useful,
16
    but WITHOUT ANY WARRANTY; without even the implied warranty of
17
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
    GNU General Public License for more details.
19
 
20
    You should have received a copy of the GNU General Public License
21
    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.
22
 
23
*/
24
 
25
#使用命名空間qbpwcf
26
namespace qbpwcf;
27
 
28
#assets dir
29
$assetsDir="assets_of_zerossl::updateDnsRecordFile_20260126";
30
 
31
#要新增的一筆RR
32
$paramsOfAdd=array();
33
$paramsOfAdd["query"]="_3FE7CA1D6DA057FB40FDD333B4C105F9";
34
$paramsOfAdd["type"]="CNAME";
35
$paramsOfAdd["value"]="7B29341B7148276F5025CE90FC113803.7871040E5B7FBDB8E7EEF7CC8DAA4A56.2e85598b7f1b864.comodoca.com";
36
$paramsOfAdd["comment"]="for zerossl valid doma in qbpwcf.org";
37
 
38
#函式說明:
39
#新增DNS記錄到檔案裡面.
40
#回傳結果:
41
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
42
#$reuslt["error"],執行不正常結束的錯訊息陣列.
43
#$result["function"],當前執行的函式名稱.
44
#$result["argu"],所使用的參數.
45
#$result["content"],字串陣列,更新後的檔案RR(DNS記錄).
46
#$result["content"]["domain"],字串,RR所屬domain.
47
#$result["content"]["defaultTTL"],字串,預設的RR更新時間.
48
#必填參數:
49
#$conf["add"],多維陣列,每個元素有為有三個元素的陣列,key有"query"跟"update"跟"type"跟"value"以及"comment",分別代表要查詢的數值、更新周期、類型、答案、註解.
50
$conf["zerossl::updateDnsRecordFile"]["add"][]=$paramsOfAdd;
51
#$conf["dnsRecordFile"],字串,該ZONE檔案位置與名稱.
253 liveuser 52
$conf["zerossl::updateDnsRecordFile"]["dnsRecordFile"]=$assetsDir."/db.qbpwcf.org";
246 liveuser 53
#可省略參數:
54
#$conf["writeNow"],字串,是否要直接寫入既有ZONE檔案,預設為"false",不寫入;"true"為直接覆寫內容.
55
#$conf["writeNow"]="false";
56
#參考資料:
57
#無.
58
#備註:
59
#目前支援的DNS記錄檔案是給bind(Berkeley Internet Name Domain)套件使用的.
60
#通常qbpwcf使用者沒有權限存取RR(dns記錄檔案),本套件是透過sshfs掛載來繞過該問題.
61
#php-pear上的Net_DNS2也可以解析RR.
62
$updateDnsRecordFile=zerossl::updateDnsRecordFile($conf["zerossl::updateDnsRecordFile"]);
63
unset($conf["zerossl::updateDnsRecordFile"]);
64
 
65
#debug
66
var_dump($updateDnsRecordFile);