Comments (11)
@Lokilein are you able to provide a failing test, perhaps? 🤔
from laminas-cache-storage-adapter-filesystem.
@Lokilein does this not affect 2.2.x
?
from laminas-cache-storage-adapter-filesystem.
However, since the new version, the FileSystemOptions always calls the setCacheDir with the parameter
null
:$this->setCacheDir(null);
(FileSystemOptions.php:115
)
After that, your configuration is passed down a few layers:
laminas-cache-storage-adapter-filesystem/src/FilesystemOptions.php
Lines 115 to 117 in f5bc8f5
And if something is wrong then the adapter will throw an exception:
laminas-cache-storage-adapter-filesystem/src/FilesystemOptions.php
Lines 437 to 454 in f5bc8f5
from laminas-cache-storage-adapter-filesystem.
@Lokilein does this not affect
2.2.x
?
Might be so, I just updated and it occured to me with this version. We've updated from 1.2 though.
from laminas-cache-storage-adapter-filesystem.
If you've updated from 1.x
, then BC breaks are expected anyway: re-labeling as bug
from laminas-cache-storage-adapter-filesystem.
@froschdesign Correctly. At the end, it works like it should, but as it checks the "null" aka sys_tmp_dir as well now, even though it will be overwritten soon after, it breaks where it should not break.
@Ocramius Agree!
from laminas-cache-storage-adapter-filesystem.
@Ocramius Hmm, not sure what you mean?
I think you just need to configure a valid Filesystem Cache with a valid cache_dir (like my example above). And if you now configure your php.ini to set your sys_tmp_dir=/does/not/exist or similar, the error should already occure.
I cannot provide my/our code as example, as we have a quite big monolith and an own Factory for the caches. That would be a overhead and not easy to extract...
from laminas-cache-storage-adapter-filesystem.
@Lokilein
Write a test that illustrates the problem and send it as a pull request. Compare with the existing tests:
from laminas-cache-storage-adapter-filesystem.
@froschdesign
hmm... I am currently working on Windows, which makes the tests difficult, but even though - I am not sure how to make sure that the sys_temp_dir is not writeable, as it is also not changable by ini_set or something and I will not change the rights of the default folder (and I hope that this would not work :D)
But, when I run the tests with an invalid php.ini setting (C:\doesnotexist), my tests are already failing with an error, while they all pass when the sys_tmp_dir is valid.
With the invalid setting, I receive:
[ErrorException] tempnam(): file created in the system's temporary directory
I think that this fails because createAdapterOptions
calls the constructor and this is enough to reproduce - depending on the configured path.
from laminas-cache-storage-adapter-filesystem.
docker run --rm -ti -v $(pwd):/app -w /app php:7 bash
and work from there? 🤔
from laminas-cache-storage-adapter-filesystem.
Pull request to fix this issue #73
from laminas-cache-storage-adapter-filesystem.
Related Issues (18)
- Psalm integration HOT 1
- PHP 8.1: Adapter is incompatible with `IteratorAggregate::getIterator`
- Migrate benchmark from laminas-cache
- PHP 8.0 support HOT 1
- Not working with laminas/laminas-eventmanager:3.4 HOT 1
- Filesystem adapter does not require `laminas-cache` in v3 HOT 1
- Investigation of total space "cache" clearance when `cache_dir` option changes
- Dependency Dashboard
- Problem with `unlink()` and `chmod()` on nonexistent files HOT 2
- Compatibility with PSR-16/PSR-6 HOT 3
- Hash cache filenames to avoid conflicts with filesystem directory structures
- Metadata is missing `filesize`
- PHP 8.3 support HOT 1
- Documenting adapter options HOT 2
- PHP 8.3 Support required... HOT 2
- Add a file_user and file_group option to Filesystem Adapter HOT 6
- Link in README goes 404 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laminas-cache-storage-adapter-filesystem.