docs(cache): add comprehensive cache configuration and permission handling guides
- Introduce `cache-configuration.md` for detailed instructions on cache setup, permission troubleshooting, and best practices. - Add `cache-permissions-quick-fix.md` for concise resolutions to common permission errors. - Include a detailed `FILECACHE_PERMISSION_FIX_PLAN.md` outlining solutions for permission-related issues. - Enhance `docker-entrypoint.sh` with permission fixes for multi-user caches. - Update `Makefile` with cache clear commands for local and staging environments. - Improve `FileCache` for graceful degradation on permission errors, ensuring reliability under multi-user scenarios.
This commit is contained in:
@@ -213,15 +213,18 @@ final readonly class FileStorage implements Storage, AtomicStorage, AppendableSt
|
||||
}
|
||||
|
||||
// Prüfe Directory-Permissions
|
||||
// WICHTIG: Für unlink() braucht man nur Schreibrechte im Verzeichnis, nicht auf der Datei selbst!
|
||||
$dir = dirname($resolvedPath);
|
||||
if (! is_writable($dir)) {
|
||||
throw FilePermissionException::delete($path, 'Directory is not writable: ' . $dir);
|
||||
}
|
||||
|
||||
// Prüfe File-Permissions
|
||||
if (! is_writable($resolvedPath)) {
|
||||
throw FilePermissionException::delete($path, 'File is not writable');
|
||||
}
|
||||
// ENTFERNT: Prüfe File-Permissions
|
||||
// Für unlink() benötigt man nur Schreibrechte im Parent-Verzeichnis, nicht auf der Datei selbst.
|
||||
// Dies ist ein Unix-Standard-Verhalten: unlink() entfernt einen Directory-Eintrag, nicht die Datei selbst.
|
||||
// if (! is_writable($resolvedPath)) {
|
||||
// throw FilePermissionException::delete($path, 'File is not writable');
|
||||
// }
|
||||
|
||||
if (! @unlink($resolvedPath)) {
|
||||
$error = error_get_last();
|
||||
|
||||
Reference in New Issue
Block a user