Subversion Repositories php-qbpwcf

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php

/*

        QBPWCF, Quick Build PHP website Component base on Fedora Linux.
    Copyright (C) 2014~2026 MIN ZHI, CHEN

    This file is part of QBPWCF.

    QBPWCF is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    QBPWCF is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.

*/

#使用命名空間qbpwcf
namespace qbpwcf;

#assets dir
$assetsDir="assets_of_zerossl::updateDnsRecordFile_20260126";

#要新增的一筆RR
$paramsOfAdd=array();
$paramsOfAdd["query"]="_3FE7CA1D6DA057FB40FDD333B4C105F9";
$paramsOfAdd["type"]="CNAME";
$paramsOfAdd["value"]="7B29341B7148276F5025CE90FC113803.7871040E5B7FBDB8E7EEF7CC8DAA4A56.2e85598b7f1b864.comodoca.com";
$paramsOfAdd["comment"]="for zerossl valid doma in qbpwcf.org";

#函式說明:
#新增DNS記錄到檔案裡面.
#回傳結果:
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
#$reuslt["error"],執行不正常結束的錯訊息陣列.
#$result["function"],當前執行的函式名稱.
#$result["argu"],所使用的參數.
#$result["content"],字串陣列,更新後的檔案RR(DNS記錄).
#$result["content"]["domain"],字串,RR所屬domain.
#$result["content"]["defaultTTL"],字串,預設的RR更新時間.
#必填參數:
#$conf["add"],多維陣列,每個元素有為有三個元素的陣列,key有"query"跟"update"跟"type"跟"value"以及"comment",分別代表要查詢的數值、更新周期、類型、答案、註解.
$conf["zerossl::updateDnsRecordFile"]["add"][]=$paramsOfAdd;
#$conf["dnsRecordFile"],字串,該ZONE檔案位置與名稱.
$conf["zerossl::updateDnsRecordFile"]["dnsRecordFile"]="../../../../etc/named/db.qbpwcf.org";
#可省略參數:
#$conf["writeNow"],字串,是否要直接寫入既有ZONE檔案,預設為"false",不寫入;"true"為直接覆寫內容.
#$conf["writeNow"]="false";
#參考資料:
#無.
#備註:
#目前支援的DNS記錄檔案是給bind(Berkeley Internet Name Domain)套件使用的.
#通常qbpwcf使用者沒有權限存取RR(dns記錄檔案),本套件是透過sshfs掛載來繞過該問題.
#php-pear上的Net_DNS2也可以解析RR.
$updateDnsRecordFile=zerossl::updateDnsRecordFile($conf["zerossl::updateDnsRecordFile"]);
unset($conf["zerossl::updateDnsRecordFile"]);

#debug
var_dump($updateDnsRecordFile);