mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
配置修改 缓存驱动增加目录多级创建
This commit is contained in:
4
library/think/cache/driver/file.php
vendored
4
library/think/cache/driver/file.php
vendored
@@ -40,7 +40,6 @@ class File
|
||||
if (substr($this->options['path'], -1) != '/') {
|
||||
$this->options['path'] .= '/';
|
||||
}
|
||||
|
||||
$this->init();
|
||||
}
|
||||
|
||||
@@ -53,10 +52,9 @@ class File
|
||||
{
|
||||
// 创建项目缓存目录
|
||||
if (!is_dir($this->options['path'])) {
|
||||
if (!mkdir($this->options['path'], 0755)) {
|
||||
if (!mkdir($this->options['path'], 0755, true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,10 +39,13 @@ class File
|
||||
$now = date($this->config['time_format']);
|
||||
$destination = $this->config['path'] . date('y_m_d') . '.log';
|
||||
|
||||
!is_dir($this->config['path']) && mkdir($this->config['path'], 0755, true);
|
||||
|
||||
//检测日志文件大小,超过配置大小则备份日志文件重新生成
|
||||
if (is_file($destination) && floor($this->config['file_size']) <= filesize($destination)) {
|
||||
rename($destination, dirname($destination) . DS . time() . '-' . basename($destination));
|
||||
}
|
||||
|
||||
// 获取基本信息
|
||||
if (isset($_SERVER['HTTP_HOST'])) {
|
||||
$current_uri = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||
|
||||
Reference in New Issue
Block a user