You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add configurable cache directory option for session caching
- Added `cache_dir` option to allow custom cache directory configuration
- Updated SessionCache to accept and prioritize custom cache directory over platform defaults
- Added getCacheDir() method to Options class to retrieve custom cache directory
- Updated README with comprehensive documentation on cache directory configuration and examples for different hosting environments (shared hosting, cross-platform, project-specific)
- Documente
Copy file name to clipboardExpand all lines: README.md
+41Lines changed: 41 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,7 @@ Optionen sind **fakultativ** und werden in der Regel nicht benötigt:
69
69
| timeout |`15`| Timeout für Curl in Sekunden; Standard = 15 |
70
70
| follow_redirects |`true`| Weiterleitungen der API folgen; Standard = false |
71
71
| enable_session_caching |`true`| Session-Caching aktivieren; Standard = true |
72
+
| cache_dir |`/tmp/proffix-cache`| Eigenes Cache-Verzeichnis; Standard = plattformspezifisch |
72
73
73
74
### Session-Caching
74
75
@@ -83,22 +84,62 @@ Der Wrapper unterstützt automatisches Session-Caching, um die Performance zu ve
83
84
84
85
**Cache-Speicherort:**
85
86
87
+
Der Cache-Speicherort kann über die Option `cache_dir` angepasst werden. Dies ist besonders nützlich bei Hosting-Umgebungen mit `open_basedir`-Einschränkungen.
88
+
89
+
**Standard-Speicherorte** (wenn `cache_dir` nicht angegeben):
Die Session-Verwaltung erfolgt über die `SessionCache`-Klasse (`src/RestAPIWrapperProffix/HttpClient/SessionCache.php`), die folgende Funktionen bietet:
94
128
95
129
-`load()`: Lädt eine gespeicherte Session-ID aus dem Cache
96
130
-`save($sessionId)`: Speichert eine Session-ID im Cache
97
131
-`clear()`: Löscht die gespeicherte Session-ID
132
+
- Unterstützung für eigene Cache-Verzeichnisse (Option `cache_dir`)
98
133
- Automatische Erkennung des plattformspezifischen Cache-Verzeichnisses
99
134
- Thread-sichere Dateioperationen mit `LOCK_EX`
100
135
- Kollisionsvermeidung durch Base64-URL-kodierte Dateinamen
0 commit comments