Misleading error when sqlite extension is not installed
foxycode opened this issue · 10 comments
On PHP 5.5.9 (maybe on others too, I did not tested), when sqlite extension is missing, nette throws misleading error:
Nette\InvalidStateException
CacheJournal has not been provided
I had v2.4.4 of nette/caching installed.
Maybe caching should test if sqlite extension is installed and throw proper exception if not.
I don't know how to do it. Can you try to resolve it?
@dg I can try if you give me right direction. Problem is in extension, where testing for sqlite extension is present:
https://github.com/nette/caching/blob/master/src/Bridges/CacheDI/CacheExtension.php#L32
But no error triggered, cache works without journal until you need tags (Doctrine extension needs them). Then journal is simply missing and misleading error is raised:
caching/src/Caching/Storages/FileStorage.php
Line 205 in 217e6c1
Yes, I know, but I have no idea how to produce better exception message.
What about make sqlite required?
Unless you use tags, journal is not required.
Ok, so we can start with explaining why "CacheJournal has not been provided" error happened. What about change error to: "CacheJournal is needed for using tags, none has been provided".
But if you don't like making sqlite required, then I don't know what else. I think that it's nette/caching work to handle this, other extensions using caching shouldn't deal with this. But I am really not sure how to solve this without making sqlite required.
Me neither.
Would it be hard to split journal service to another package extending nette/caching with sqlite requirement?
yes
For me, solution was quite weird but functional ...
In composer.json, I have now "nette/caching": "2.3" exactly, no marks before and it is working.
(Nette 2.4 with Doctrine2)