Subversion Repositories php-qbpwcf

Rev

Rev 66 | Rev 179 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 66 Rev 170
Line 1584... Line 1584...
1584
	#$result["error"],錯誤訊息陣列.
1584
	#$result["error"],錯誤訊息陣列.
1585
	#$result["argu"],使用的參數.
1585
	#$result["argu"],使用的參數.
1586
	#必填參數:
1586
	#必填參數:
1587
	#$conf["enCodeStr"],any,要加密的字串,陣列,物件.
1587
	#$conf["enCodeStr"],any,要加密的字串,陣列,物件.
1588
	$conf["enCodeStr"]="";
1588
	$conf["enCodeStr"]="";
1589
	#$conf["enCodeType"],"字串",加密或編碼的類型,有"sha1"與"md5"與"p_hash"與"aes256"與"qbpwcf"與"bin2hex"與"hex2bin"與"gpg"與"hex2bin&gpg",9種,"sha1"較耗時;"md5"較快;"p_hash"適用於密碼加密;"aes256"是對稱式加解密;"qbpwcf"是透過urlencode、json_encode、base64_encode的結果;"bin2hex"是依照每個byte的整數數值轉成"00"~"FF"後的結果,反之為"hex2bin";"gpg"是應用gpg進行加解密,需要先有ID對應的key;"hex2bin&gpg"為先hex2bin在進行gpg加解密.
1589
	#$conf["enCodeType"],"字串",加密或編碼的類型,有"sha1"與"md5"與"p_hash"與"aes256"與"qbpwcf"與"bin2hex"與"hex2bin"與"gpg"與"hex2bin&gpg",9種,"sha1"較耗時;"md5"較快;"p_hash"適用於密碼加密;"aes256"是對稱式加解密;"qbpwcf"是透過json_encode、urlencode、base64_encode的結果;"bin2hex"是依照每個byte的整數數值轉成"00"~"FF"後的結果,反之為"hex2bin";"gpg"是應用gpg進行加解密,需要先有ID對應的key;"hex2bin&gpg"為先hex2bin在進行gpg加解密.
1590
	$conf["enCodeType"]="sha1";
1590
	$conf["enCodeType"]="sha1";
1591
	#可省略參數:
1591
	#可省略參數:
1592
	#$conf["sha1Raw"],字串,sha1加密的結果要用20個0與1組合還是要用40位數的16進位數值,"true"代表前者,"false"代表後者,預設為"false".
1592
	#$conf["sha1Raw"],字串,sha1加密的結果要用20個0與1組合還是要用40位數的16進位數值,"true"代表前者,"false"代表後者,預設為"false".
1593
	#$conf["sha1Raw"]="false";
1593
	#$conf["sha1Raw"]="false";
1594
	#$conf["p_hash"],字串,p_hash加密過後的字串,該參數若存在且$conf["enCodeType"]為"p_hash",則代表是要檢查$conf["enCodeStr"]是否為符合$conf["p_hash"]的密碼.
1594
	#$conf["p_hash"],字串,p_hash加密過後的字串,該參數若存在且$conf["enCodeType"]為"p_hash",則代表是要檢查$conf["enCodeStr"]是否為符合$conf["p_hash"]的密碼.
Line 1599... Line 1599...
1599
	#$conf["aes256Encode"]="";
1599
	#$conf["aes256Encode"]="";
1600
	#$conf["qbpwcfDecode"],字串,若"enCodeType"為"qbpwcf",則預設為"false",代表加密;反之為"true",代表解密.
1600
	#$conf["qbpwcfDecode"],字串,若"enCodeType"為"qbpwcf",則預設為"false",代表加密;反之為"true",代表解密.
1601
	#$conf["qbpwcfDecode"]="false";
1601
	#$conf["qbpwcfDecode"]="false";
1602
	#$conf["gpgDecrypt"],字串,若"enCodeType"為"gpg",則預設為"false",代表加密;反之為"true",代表解密.
1602
	#$conf["gpgDecrypt"],字串,若"enCodeType"為"gpg",則預設為"false",代表加密;反之為"true",代表解密.
1603
	#$conf["gpgDecrypt"]="false";
1603
	#$conf["gpgDecrypt"]="false";
1604
	#$conf["gpgId"],字串,若"enCodeType"為"gpg"時,該參數必填.
1604
	#$conf["gpgId"],字串,若"enCodeType"為"gpg"時,要使用的gpg id,預設為gnupgId.
1605
	#$conf["gpgId"]="";
1605
	#$conf["gpgId"]="";
1606
	#參考資料:
1606
	#參考資料:
1607
	#sha1=>http://php.net/manual/en/function.sha1.php
1607
	#sha1=>http://php.net/manual/en/function.sha1.php
1608
	#md5=>http://php.net/manual/en/function.md5.php
1608
	#md5=>http://php.net/manual/en/function.md5.php
1609
	#password_hash=>http://php.net/manual/en/function.password-hash.php
1609
	#password_hash=>http://php.net/manual/en/function.password-hash.php
Line 1670... Line 1670...
1670
		#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
1670
		#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
1671
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("sha1Raw","p_hash","keyForAes256","aes256Encode","qbpwcfDecode","gpgDecrypt","gpgId");
1671
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("sha1Raw","p_hash","keyForAes256","aes256Encode","qbpwcfDecode","gpgDecrypt","gpgId");
1672
		#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double"); 
1672
		#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double"); 
1673
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("string","string","string","string","string","string","string");
1673
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("string","string","string","string","string","string","string");
1674
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
1674
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
1675
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array("false",null,null,null,"false","false",null);
1675
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array("false",null,null,null,"false","false",gnupgId);
1676
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
1676
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
1677
		#$conf["arrayCountEqualCheck"][]=array();
1677
		#$conf["arrayCountEqualCheck"][]=array();
1678
		$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
1678
		$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
1679
		unset($conf["variableCheck::checkArguments"]);
1679
		unset($conf["variableCheck::checkArguments"]);
1680
		
1680