[更新]还原缓存路径名称

This commit is contained in:
Anyon 2018-10-24 16:59:25 +08:00
parent 7c9867ad7a
commit 8cd19c0e19
3 changed files with 8 additions and 8 deletions

View File

@ -53,7 +53,7 @@ class BasicPay
throw new InvalidArgumentException("Missing Config -- [mch_key]");
}
if (!empty($options['cache_path'])) {
Tools::$CachePath = $options['cache_path'];
Tools::$cache_path = $options['cache_path'];
}
$this->config = new DataArray($options);
// 商户基础参数

View File

@ -70,7 +70,7 @@ class BasicWeChat
$this->GetAccessTokenCallback = $options['GetAccessTokenCallback'];
}
if (!empty($options['cache_path'])) {
Tools::$CachePath = $options['cache_path'];
Tools::$cache_path = $options['cache_path'];
}
$this->config = new DataArray($options);
}

View File

@ -29,7 +29,7 @@ class Tools
* 缓存路径
* @var null
*/
public static $CachePath = null;
public static $cache_path = null;
/**
@ -320,11 +320,11 @@ class Tools
*/
private static function getCacheName($name)
{
if (empty(self::$CachePath)) {
self::$CachePath = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Cache' . DIRECTORY_SEPARATOR;
if (empty(self::$cache_path)) {
self::$cache_path = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Cache' . DIRECTORY_SEPARATOR;
}
self::$CachePath = rtrim(self::$CachePath, '/\\') . DIRECTORY_SEPARATOR;
file_exists(self::$CachePath) || mkdir(self::$CachePath, 0755, true);
return self::$CachePath . $name;
self::$cache_path = rtrim(self::$cache_path, '/\\') . DIRECTORY_SEPARATOR;
file_exists(self::$cache_path) || mkdir(self::$cache_path, 0755, true);
return self::$cache_path . $name;
}
}