Subversion Repositories php-qbpwcf

Rev

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

Rev Author Line No. Line
39 liveuser 1
#!/bin/php
2
<?php
3
 
4
/*
5
 
6
        QBPWCF, Quick Build PHP website Component base on Fedora Linux.
239 liveuser 7
    Copyright (C) 2014~2026 MIN ZHI, CHEN
39 liveuser 8
 
9
    This file is part of QBPWCF.
10
 
11
    QBPWCF is free software: you can redistribute it and/or modify
12
    it under the terms of the GNU General Public License as published by
13
    the Free Software Foundation, either version 3 of the License, or
14
    (at your option) any later version.
15
 
16
    QBPWCF is distributed in the hope that it will be useful,
17
    but WITHOUT ANY WARRANTY; without even the implied warranty of
18
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
    GNU General Public License for more details.
20
 
21
    You should have received a copy of the GNU General Public License
22
    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.
23
 
24
*/
25
 
26
#使用命名空間qbpwcf
27
namespace qbpwcf;
28
 
29
#assets dir
30
$assetsDir="assets of stringProcess::utf7_imap_to_itf8_20250528";
31
 
32
#函式說明:
33
#將mutf7的字串轉成uft8
34
#回傳結果:
35
#$result["status"],執行成功與否,若爲"true",代表執行成功,若爲"false"代表執失敗。
36
#$result["error"],錯誤訊息陣列.
37
#$result["function"],當前執行的函數名稱.
38
#$result["content"],轉好的字串.
39
#必填參數:
40
#$conf["stringIn"],字串,要處理的字串.
41
$conf["stringIn"]="&VZyZBQ-";
42
#可省略參數:
43
#無.
44
#參考資料:
45
#無.
46
#備註:
47
#無.
48
$utf7_imap_to_utf8=stringProcess::utf7_imap_to_utf8($conf);
49
unset($conf);
50
 
51
#如果執行失敗
52
if($utf7_imap_to_utf8["status"]==="false"){
53
 
54
	#函式說明:
55
	#撰寫log
56
	#回傳結果:
57
	#$result["status"],狀態,"true"或"false".
58
	#$result["error"],錯誤訊息陣列.
59
	#$result["function"],當前函式的名稱.
60
	#$result["argu"],使用的參數.
61
	#必填參數:
62
	#$conf["path"],字串,log檔案的路徑與名稱.
63
	$conf["path"]=$logFile;
64
	#$conf["content"],any,要寫的內容,若內容不為字串則會用var_dump的格式寫入.
65
	$conf["content"]=$utf7_imap_to_utf8;
66
	#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
67
	$conf["fileArgu"]=__FILE__;
68
	#可省略參數:
69
	#$conf["rewrite"],預設為"false",接續寫入;反之"true"代表重新寫入.
70
	#$conf["rewrite"]="false";
71
	#參考資料:
72
	#無.
73
	#備註:
74
	#無.
75
	$record=logs::record($conf);
76
	unset($conf);
224 liveuser 77
 
39 liveuser 78
	#如果寫log失敗
79
	if($record["status"]==="false"){
224 liveuser 80
 
39 liveuser 81
		#印出結果
82
		var_dump($record);
224 liveuser 83
 
39 liveuser 84
		}#if end
224 liveuser 85
 
39 liveuser 86
	#結束執行,回傳錯誤代碼1
87
	exit(1);
88
 
89
	}#if end
224 liveuser 90
 
39 liveuser 91
#debug
224 liveuser 92
var_dump($utf7_imap_to_utf8);