mirror of
https://gitee.com/zoujingli/WeChatDeveloper.git
synced 2025-08-29 18:29:44 +08:00
Update Tools.php
This commit is contained in:
parent
018918d342
commit
fbf73b5ca4
@ -267,8 +267,7 @@ class Tools
|
||||
private static function _buildHttpData($data, $build = true)
|
||||
{
|
||||
if (!is_array($data)) return $data;
|
||||
foreach ($data as $key => $value) {
|
||||
if (is_object($value) && $value instanceof \CURLFile) {
|
||||
foreach ($data as $key => $value) if (is_object($value) && $value instanceof \CURLFile) {
|
||||
$build = false;
|
||||
} elseif (is_object($value) && isset($value->datatype) && $value->datatype === 'MY_CURL_FILE') {
|
||||
$build = false;
|
||||
@ -280,7 +279,6 @@ class Tools
|
||||
$data[$key] = self::createCurlFile($filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $build ? http_build_query($data) : $data;
|
||||
}
|
||||
|
||||
@ -324,7 +322,8 @@ class Tools
|
||||
*/
|
||||
public static function getCache($name)
|
||||
{
|
||||
if (file_exists($file = self::_getCacheName($name)) && ($content = file_get_contents($file))) {
|
||||
$file = self::_getCacheName($name);
|
||||
if (file_exists($file) && ($content = file_get_contents($file))) {
|
||||
$data = unserialize($content);
|
||||
if (isset($data['expired']) && (intval($data['expired']) === 0 || intval($data['expired']) >= time())) {
|
||||
return $data['value'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user