-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
bugVerified issues on the current code behavior or pull requests that will fix themVerified issues on the current code behavior or pull requests that will fix them
Description
PHP Version
8.3, 8.2
CodeIgniter4 Version
4.6.0
CodeIgniter4 Installation Method
Composer (using codeigniter4/appstarter
)
Which operating systems have you tested for this bug?
Linux
Which server did you use?
fpm-fcgi
Database
PostgreSQL 15
What happened?
In system/Cache/Handlers/FileHandler.php, inside the getItem() method, the call to file_get_contents() can return false, which currently leads to a fatal error that crashes the application without any explanatory message. It would be preferable to:
Detect when file_get_contents() returns false.
In that case, ignore the cached file and regenerate the cache entry.
Emit a clear warning to the console indicating that reading the cache failed, so developers aren’t left with a silent crash.
Steps to Reproduce
- Make cache unreadable (for example, no permissions)
- Try to get it
Expected Output
Warning or error in console, no crash, recalculate of cache
Anything else?
No response
Metadata
Metadata
Assignees
Labels
bugVerified issues on the current code behavior or pull requests that will fix themVerified issues on the current code behavior or pull requests that will fix them