Subversion Repositories qbpwcf-lib(archive)

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
820 liveuser 1
#!/bin/php
2
<?php
3
 
4
#使用命名空間qbpwcf
5
namespace qbpwcf;
6
 
7
#assets dir
8
$assetsDir="assets of zerossl::createPrivateKey_20241129";
9
 
10
#函式說明:
11
#產生ssl private key.
12
#回傳結果:
13
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
14
#$reuslt["error"],執行不正常結束的錯訊息陣列.
15
#$result["function"],當前執行的函式名稱.
16
#$result["argu"],所使用的參數.
17
#$result["curl_verbose_info"],curl執行的詳細資訊.
18
#必填參數:
19
#$conf["fileArgu"],字串,變數__FILE__的內容.
20
$conf["fileArgu"]=__FILE__;
21
#可省略參數:
22
#$conf["length"],整數,金鑰的長度,預設為 4096(bit).
23
#$conf["length"]=4096';
24
#參考資料:
25
#無.
26
#備註:
27
#key generated by openssl with RSA.
28
$createPrivateKey=zerossl::createPrivateKey($conf);
29
unset($conf);
30
 
31
#如果執行失敗
32
if($createPrivateKey["status"]==="false"){
33
 
34
	#函式說明:
35
	#撰寫log
36
	#回傳結果:
37
	#$result["status"],狀態,"true"或"false".
38
	#$result["error"],錯誤訊息陣列.
39
	#$result["function"],當前函式的名稱.
40
	#$result["argu"],使用的參數.
41
	#必填參數:
42
	#$conf["path"],字串,log檔案的路徑與名稱.
43
	$conf["path"]=$logFile;
44
	#$conf["content"],any,要寫的內容,若內容不為字串則會用var_dump的格式寫入.
45
	$conf["content"]=$createPrivateKey;
46
	#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
47
	$conf["fileArgu"]=__FILE__;
48
	#可省略參數:
49
	#$conf["rewrite"],預設為"false",接續寫入;反之"true"代表重新寫入.
50
	#$conf["rewrite"]="false";
51
	#參考資料:
52
	#無.
53
	#備註:
54
	#無.
55
	$record=logs::record($conf);
56
	unset($conf);
57
 
58
	#如果寫log失敗
59
	if($record["status"]==="false"){
60
 
61
		#印出結果
62
		var_dump($record);
63
 
64
		}#if end
65
 
66
	#結束執行,回傳錯誤代碼1
67
	exit(1);
68
 
69
	}#if end
70
 
71
#debug
72
var_dump($createPrivateKey);