Nette\DI\ServiceCreationException Service ‘cache.storage’ not found in definitions. (used in Nette\Bridges\Ca
- mcmatak
- Member | 504
what could be the problem?
firstly why it needs to configure default cache.storage
and why it is not found if the definition is specified?
services.neon
services:
cache.storage: Nette\Caching\Storages\FileStorage("%tempDir%/cache")
composer info
nette/application v3.2.3 🏆 Nette Application: a full-stack component-based MVC kernel for PHP that helps you write powerful and modern web applications. Write les...
nette/bootstrap v3.2.3 🅱 Nette Bootstrap: the simple way to configure and bootstrap your Nette application.
nette/caching v3.3.0 ⏱ Nette Caching: library with easy-to-use API and many cache backends.
nette/component-model v3.1.0 ⚛ Nette Component Model
nette/database v3.2.0 💾 Nette Database: layer with a familiar PDO-like API but much more powerful. Building queries, advanced joins, drivers for MySQL, Postgre...
nette/di v3.2.1 💎 Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new...
nette/finder v3.0.0 🔍 Nette Finder: find files and directories with an intuitive API.
nette/forms v3.2.2 📝 Nette Forms: generating, validating and processing secure forms in PHP. Handy API, fully customizable, server & client side validation ...
nette/http v3.3.0 🌐 Nette Http: abstraction for HTTP request, response and session. Provides careful data sanitization and utility for URL and cookies mani...
nette/mail v4.0.2 📧 Nette Mail: handy email creation and transfer library for PHP with both text and MIME-compliant support.
nette/neon v3.4.1 🍸 Nette NEON: encodes and decodes NEON file format.
nette/nette v3.2.2 👪 Nette Framework - innovative framework for fast and easy development of secured web applications in PHP (metapackage)
nette/php-generator v4.1.4 🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 8.3 features.
nette/robot-loader v4.0.1 🍀 Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.
nette/routing v3.1.0 Nette Routing: two-ways URL conversion
nette/safe-stream v3.0.1 Nette SafeStream: provides isolation for thread safe manipulation with files via native PHP functions.
nette/schema v1.3.0 📐 Nette Schema: validating data structures against a given Schema.
nette/security v3.2.0 🔑 Nette Security: provides authentication, authorization and a role-based access control management via ACL (Access Control List)
nette/tokenizer v3.1.1 Nette Tokenizer
nette/utils v4.0.4 🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or s...
- mcmatak
- Member | 504
the problem is, that
kdyby/redis creates definition cache.storage as RedisStorage
but latte search for FileStorage
https://pasteboard.co/…0nsa4c5b.png
how to solve this?
where is the problem?
- mcmatak
- Member | 504
https://github.com/…xtension.php#L28
the colission is here, it is looking for Nette\Caching\Storage
but RedisStorage
implements
https://github.com/…xtension.php#L28
class RedisStorage implements \Kdyby\Redis\IMultiReadStorage
and the IMultiReadStorage extends what cachelatte looking for
interface IMultiReadStorage extends \Nette\Caching\Storage
- Marek Bartoš
- Nette Blogger | 1261
nette/caching has nothing to do with Latte.
RedisStorage implements \Nette\Caching\Storage, just not directly.
Why do you set your own cache storage and also enable storage in redis
extension? This is where it collides.
- mcmatak
- Member | 504
sorry for missinterpretation, i dont define cache.storage, that was only try how to solve it
RedisStorage is defined here
- mcmatak
- Member | 504
what i dont understand is why at this position
https://github.com/…Resolver.php#L359
the RedisStorage is not found?
- H0w4rd
- Member | 96
We are facing the same problem. Unfortunatelly I cannot downgrade nette/di because
- nette/di[v3.1.0, ..., v3.1.2] require php >=7.2 <8.3 -> your php version (8.3.6) does not satisfy that requirement.
It is happening in a branch with a new upcoming version running on PHP 8.3.
Is there any solution for this please?
- David Grudl
- Nette Core | 8218
Can you create a minimal sample demonstrating the problem based on webproject?
- kropacekt
- Member | 2
Repo with the minimal sample is available here: https://github.com/…ette32-php83
- David Grudl
- Nette Core | 8218
@kropacekt I've run it and it wants to connect to Redis, I haven't encountered any problem building the DI container.
- Marek Bartoš
- Nette Blogger | 1261
@mcmatak Likely not, it is a DIC compilation error.
@kropacekt Try to test it with xdebug disabled. It caused some weird errors in last few versions with PHP 8.3
Last edited by Marek Bartoš (2024-05-07 12:55)
- David Grudl
- Nette Core | 8218
It was really making a connection with Redis when it was compiled.
Anyway, I found the bug and it is fixed in nette/application v3.2.x-dev