summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Controllers/updateController.php6
-rw-r--r--app/Utils/feverUtil.php2
-rw-r--r--lib/lib_install.php8
-rw-r--r--lib/lib_rss.php10
4 files changed, 13 insertions, 13 deletions
diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php
index 675bd7def..f1588c7e1 100644
--- a/app/Controllers/updateController.php
+++ b/app/Controllers/updateController.php
@@ -14,7 +14,7 @@ class FreshRSS_update_Controller extends FreshRSS_ActionController {
public static function migrateToGitEdge() {
$errorMessage = 'Error during git checkout to edge branch. Please change branch manually!';
- if (!is_writable(FRESHRSS_PATH . '/.git/')) {
+ if (!is_writable(FRESHRSS_PATH . '/.git/config')) {
throw new Exception($errorMessage);
}
@@ -118,7 +118,7 @@ class FreshRSS_update_Controller extends FreshRSS_ActionController {
if ($version == '') {
$version = 'unknown';
}
- if (is_writable(FRESHRSS_PATH)) {
+ if (touch(FRESHRSS_PATH . '/index.html')) {
$this->view->update_to_apply = true;
$this->view->message = array(
'status' => 'good',
@@ -217,7 +217,7 @@ class FreshRSS_update_Controller extends FreshRSS_ActionController {
}
public function applyAction() {
- if (!file_exists(UPDATE_FILENAME) || !is_writable(FRESHRSS_PATH) || Minz_Configuration::get('system')->disable_update) {
+ if (Minz_Configuration::get('system')->disable_update || !file_exists(UPDATE_FILENAME) || !touch(FRESHRSS_PATH . '/index.html')) {
Minz_Request::forward(array('c' => 'update'), true);
}
diff --git a/app/Utils/feverUtil.php b/app/Utils/feverUtil.php
index a7d21dacb..277230ec2 100644
--- a/app/Utils/feverUtil.php
+++ b/app/Utils/feverUtil.php
@@ -13,7 +13,7 @@ class FreshRSS_fever_Util {
@mkdir(self::FEVER_PATH, 0770, true);
}
- $ok = is_writable(self::FEVER_PATH);
+ $ok = touch(self::FEVER_PATH . '/index.html'); // is_writable() is not reliable for a folder on NFS
if (!$ok) {
Minz_Log::error("Could not save Fever API credentials. The directory does not have write access.");
}
diff --git a/lib/lib_install.php b/lib/lib_install.php
index 494ddc6dd..0204c90c9 100644
--- a/lib/lib_install.php
+++ b/lib/lib_install.php
@@ -42,14 +42,14 @@ function checkRequirements($dbType = '') {
$json = function_exists('json_encode');
$mbstring = extension_loaded('mbstring');
// @phpstan-ignore-next-line
- $data = DATA_PATH && is_writable(DATA_PATH);
+ $data = DATA_PATH && touch(DATA_PATH . '/index.html'); // is_writable() is not reliable for a folder on NFS
// @phpstan-ignore-next-line
- $cache = CACHE_PATH && is_writable(CACHE_PATH);
+ $cache = CACHE_PATH && touch(CACHE_PATH . '/index.html');
// @phpstan-ignore-next-line
$tmp = TMP_PATH && is_writable(TMP_PATH);
// @phpstan-ignore-next-line
- $users = USERS_PATH && is_writable(USERS_PATH);
- $favicons = is_writable(join_path(DATA_PATH, 'favicons'));
+ $users = USERS_PATH && touch(USERS_PATH . '/index.html');
+ $favicons = touch(DATA_PATH . '/favicons/index.html');
return array(
'php' => $php ? 'ok' : 'ko',
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index 592ad8149..d0e819d98 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -696,13 +696,13 @@ function check_install_php() {
function check_install_files() {
return array(
// @phpstan-ignore-next-line
- 'data' => DATA_PATH && is_writable(DATA_PATH),
+ 'data' => DATA_PATH && touch(DATA_PATH . '/index.html'), // is_writable() is not reliable for a folder on NFS
// @phpstan-ignore-next-line
- 'cache' => CACHE_PATH && is_writable(CACHE_PATH),
+ 'cache' => CACHE_PATH && touch(CACHE_PATH . '/index.html'),
// @phpstan-ignore-next-line
- 'users' => USERS_PATH && is_writable(USERS_PATH),
- 'favicons' => is_writable(DATA_PATH . '/favicons'),
- 'tokens' => is_writable(DATA_PATH . '/tokens'),
+ 'users' => USERS_PATH && touch(USERS_PATH . '/index.html'),
+ 'favicons' => touch(DATA_PATH . '/favicons/index.html'),
+ 'tokens' => touch(DATA_PATH . '/tokens/index.html'),
);
}