src/Cache/Driver/FileCacheDriver.php
function set($key, $value)
    {
        $cacheFile = $this->cache_path . $key;
        if (!file_exists($cacheFile)) {
            $filePath = dirname($cacheFile);
            if (!is_dir($filePath)) {
                $createDir = mkdir($filePath, 0755, true);
                if (!$createDir) {
                    throw new CoreException('创建缓存目录失败');
                }
            }
        }

        file_put_contents($cacheFile, $value, LOCK_EX);
    }
function set($key, $value)
    {
        $cacheFile = $this->cache_path . $key;
        if (!file_exists($cacheFile)) {
            $filePath = dirname($cacheFile);
            if (!is_dir($filePath)) {
                $createDir = mkdir($filePath, 0755, true);
                if (!$createDir) {
                    throw new CoreException('创建缓存目录失败');
                }
            }
        }

        file_put_contents($cacheFile, $value, LOCK_EX);
    }
保存缓存

@param string $key
@param string $value
@return mixed|void
@throws CoreException