mirror of
https://github.com/torrentpier/torrentpier-lts.git
synced 2025-02-28 15:10:54 +03:00
Fixed cache directory auto-creating with SQLite (#247)
* Fixed cache directory auto-creating with SQLite * Update CHANGELOG.md
This commit is contained in:
parent
f7de89aa98
commit
8c893b4a32
@ -6,6 +6,7 @@
|
||||
**Merged pull requests:**
|
||||
|
||||
- Release v2.1.5-2023.09 🎉
|
||||
- Fixed cache directory auto-creating with SQLite [\#247](https://github.com/torrentpier/torrentpier-lts/pull/247) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Minor improvements [\#245](https://github.com/torrentpier/torrentpier-lts/pull/245), [\#246](https://github.com/torrentpier/torrentpier-lts/pull/246) ([belomaxorka](https://github.com/belomaxorka))
|
||||
|
||||
## [v2.1.5-2023.08-HotFix](https://github.com/torrentpier/torrentpier-lts/tree/v2.1.5-2023.08-HotFix) (2023-09-17)
|
||||
|
20
library/includes/cache/sqlite.php
vendored
20
library/includes/cache/sqlite.php
vendored
@ -142,6 +142,24 @@ class sqlite_common extends cache_common
|
||||
{
|
||||
$this->cfg = array_merge($this->cfg, $cfg);
|
||||
$this->dbg_enabled = sql_dbg_enabled();
|
||||
|
||||
// Creates filecache dir
|
||||
$db_dir = dirname($this->cfg['db_file_path']);
|
||||
|
||||
if (!is_dir($db_dir))
|
||||
{
|
||||
if (!bb_mkdir($db_dir))
|
||||
{
|
||||
$create_error = "Cannot create {$this->engine} cache dir: $db_dir";
|
||||
|
||||
if (DBG_LOG)
|
||||
{
|
||||
dbg_log($create_error, "{$this->engine}-CACHE-mkdir-FAIL_" . time());
|
||||
}
|
||||
|
||||
die($create_error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function connect ()
|
||||
@ -300,4 +318,4 @@ class sqlite_common extends cache_common
|
||||
{
|
||||
if (error_reporting()) trigger_error($msg, E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user