1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-01-16 21:58:21 +01:00

[Config] Don't check PATH_CACHE for memcached (#1489)

This commit is contained in:
Jakub Valenta 2022-03-24 20:29:16 +00:00 committed by GitHub
parent 0d20e9a05c
commit 8e2b65556f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 4 deletions

1
.gitignore vendored
View File

@ -213,6 +213,7 @@ pip-log.txt
# Unit test / coverage reports
.coverage
.phpunit.result.cache
.tox
#Translations

View File

@ -6,6 +6,15 @@ class FileCache implements CacheInterface {
protected $path;
protected $key;
public function __construct() {
if (!is_writable(PATH_CACHE)) {
returnServerError(
'RSS-Bridge does not have write permissions for '
. PATH_CACHE . '!'
);
}
}
public function loadData(){
if(file_exists($this->getCacheFile())) {
return unserialize(file_get_contents($this->getCacheFile()));

View File

@ -13,6 +13,13 @@ class SQLiteCache implements CacheInterface {
die('"sqlite3" extension not loaded. Please check "php.ini"');
}
if (!is_writable(PATH_CACHE)) {
returnServerError(
'RSS-Bridge does not have write permissions for '
. PATH_CACHE . '!'
);
}
$file = Configuration::getConfig(get_called_class(), 'file');
if (empty($file)) {
die('Configuration for ' . get_called_class() . ' missing. Please check your ' . FILE_CONFIG);

View File

@ -102,10 +102,6 @@ final class Configuration {
if(!extension_loaded('json'))
self::reportError('"json" extension not loaded. Please check "php.ini"');
// Check cache folder permissions (write permissions required)
if(!is_writable(PATH_CACHE))
self::reportError('RSS-Bridge does not have write permissions for ' . PATH_CACHE . '!');
}
/**