Subversion Repositories qbpwcf-lib(archive)

Rev

Blame | Last modification | View Log | RSS feed

<?php

/*

        QBPWCF, Quick Build PHP website Component base on Fedora Linux.
    Copyright (C) 2015~2024 Min-Jhin,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;

#匯入套件
require_once("qbpwcf/allInOne.php");

#建議的log位置
$logFile=$_SERVER["DOCUMENT_ROOT"].$_SERVER["PHP_SELF"].".log";

#函式說明:
#在某段時間之前、後、之內、之外,轉址到某處,若沒有符合條件則回傳"passed"
#回傳結果:
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
#$reuslt["error"],執行不正常結束的錯訊息陣列.
#$result["function"],當前執行的函式名稱.
#$result["content"],若沒有符合條件則回傳"passed".
#必填參數:
#$conf["deadline"],字串,爲條件的截止參考時間點,格式須爲 2011-05-27 23:59:59
$conf["deadline"]=gmdate("Y-m-d H:i:s",time()-86400);
#$conf["deadline"]=gmdate("Y-m-d H:i:s",time()+86400);
#$conf["toWhere"],字串,爲要轉址到的地方.
$conf["toWhere"]="https://www.qbpwcf.org";
#$conf["condition"],字串,爲轉址條件,可以用的值有:"before",代表在某段時間之前;"after",代表在某段時間之後;"betweenStartToDeadline",代表在某段時間之內;"besideStartToDeadline",代表在某段時間之外.
$conf["condition"]="after";
#可省略參數:       
#$conf["startTime"],字串,爲條件的開始的參考時間點,格式須爲 2011-05-27 23:59:59 ,適用於 $conf["condtion"] 爲 "betweenStartToDeadline" 或 "besideStartToDeadline".
#$conf["startTime"]="";
#$conf["timeZone"],字串,當前時區為何?預設為"Asia/Taipei",可以設定的時區列表:http://www.php.net/manual/en/timezones.php
#$conf["timeZone"]="Asia/Taipei";
#參考資料:
#無.
#備註:
#無.
$deadlineAction=time::deadlineAction($conf);
unset($conf);

#debug
var_dump($deadlineAction);

?>