|
@@ -96,7 +96,7 @@ function putKeyValueToDictionary($temp, $isKey, $key, &$result, $needUrlDecode)
|
|
|
|
|
|
/**
|
|
|
* 取得备份文件名
|
|
|
- *
|
|
|
+ *
|
|
|
* Enter description here ...
|
|
|
* @param $path
|
|
|
*/
|
|
@@ -121,7 +121,7 @@ function convertStringToArray($str) {
|
|
|
/**
|
|
|
* 压缩文件 对应java deflate
|
|
|
*
|
|
|
- * @param unknown_type $params
|
|
|
+ * @param unknown_type $params
|
|
|
*/
|
|
|
function deflate_file(&$params) {
|
|
|
$logger = LogUtil::getLogger();
|
|
@@ -129,10 +129,10 @@ function deflate_file(&$params) {
|
|
|
$logger->LogInfo ( "---------处理文件---------" );
|
|
|
if (file_exists ( $file ['tmp_name'] )) {
|
|
|
$params ['fileName'] = $file ['name'];
|
|
|
-
|
|
|
+
|
|
|
$file_content = file_get_contents ( $file ['tmp_name'] );
|
|
|
$file_content_deflate = gzcompress ( $file_content );
|
|
|
-
|
|
|
+
|
|
|
$params ['fileContent'] = base64_encode ( $file_content_deflate );
|
|
|
$logger->LogInfo ( "压缩后文件内容为>" . base64_encode ( $file_content_deflate ) );
|
|
|
} else {
|
|
@@ -145,28 +145,28 @@ function deflate_file(&$params) {
|
|
|
/**
|
|
|
* 讲数组转换为string
|
|
|
*
|
|
|
- * @param $para 数组
|
|
|
- * @param $sort 是否需要排序
|
|
|
- * @param $encode 是否需要URL编码
|
|
|
+ * @param $para 数组
|
|
|
+ * @param $sort 是否需要排序
|
|
|
+ * @param $encode 是否需要URL编码
|
|
|
* @return string
|
|
|
*/
|
|
|
function createLinkString($para, $sort, $encode) {
|
|
|
if($para == NULL || !is_array($para))
|
|
|
return "";
|
|
|
-
|
|
|
+
|
|
|
$linkString = "";
|
|
|
if ($sort) {
|
|
|
$para = argSort ( $para );
|
|
|
}
|
|
|
- while ( list ( $key, $value ) = each ( $para ) ) {
|
|
|
- if ($encode) {
|
|
|
- $value = urlencode ( $value );
|
|
|
- }
|
|
|
- $linkString .= $key . "=" . $value . "&";
|
|
|
- }
|
|
|
+ foreach ($para as $key=>$value){
|
|
|
+ if ($encode) {
|
|
|
+ $value = urlencode ( $value );
|
|
|
+ }
|
|
|
+ $linkString .= $key . "=" . $value . "&";
|
|
|
+ }
|
|
|
// 去掉最后一个&字符
|
|
|
$linkString = substr ( $linkString, 0, -1 );
|
|
|
-
|
|
|
+
|
|
|
return $linkString;
|
|
|
}
|
|
|
|