swayok / alternative-laravel-cache

Replacements for Laravel's redis and file cache stores that properly implement tagging idea
MIT License
169 stars 26 forks source link

Class 'Cache\Adapter\Filesystem\FilesystemCachePool' not found error #20

Closed tanero closed 3 years ago

tanero commented 4 years ago

Today after composer update, the laravel frmework upgraded from 7.27 to 7.28. After that, the application started to give me an error exception like below,

"Class 'Cache\Adapter\Filesystem\FilesystemCachePool' not found" error.

when I change the driver type from file to redis this time gives me "Class 'Cache\Adapter\Redis\RedisCachePool' not found".

Deeply inspection shows some adapters (file and redis ) removed by composer,

` - Removing cache/redis-adapter (1.0.0)

swayok commented 4 years ago

Hi. In last update I moved all specific drivers to "suggest" section of composer.json so that everyone picks only drivers they will use. Review Readme for installation updates.

MicVital commented 3 years ago

I think I found the actual solution to this problem: The filesystem cache driver isn't available with laravel installation. To solve this, you will to first install the driver using composer composer require cache/filesystem-adapter Afterwards, you can then install the alternative-laravel-cache

oureco123 commented 3 years ago

I'm having the same issue.. Am not able to publish vendor

swayok commented 3 years ago

@oureco123, you need to manually add specific cache driver to your composer json. Refer docs: https://github.com/swayok/alternative-laravel-cache#filesystem-support. By default there are no specific drivers required by package to avoid unnecessary drivers being installed (requested in https://github.com/swayok/alternative-laravel-cache/issues/13).

oureco123 commented 3 years ago

Yes sir i have done this. I tried all types of lines and tried many packages (cache/cache ; cache/filesystem-adapter etc.). I can't seem to wrap my head around this :/

Maybe this is related: I'm not sure why but when i run "composer require cache/cache or composer require cache/filesystem-adapter, they install normally and get added to composer.json. But the only problem is that i can't seem to find them in vendor/cache folder.

swayok commented 3 years ago

That is very strange. In my project I have next folders inside vendor/cache: adapter-common, hierarchical-cache, tag-interop and redis-adapter. 3 installed as requirements from swayok/alternative-laravel-cache package and redis-adapter istalled as requirement from project's composer.json. You shoud have similar setup but with filesystem driver package. Try to remove composer.lock and then run composer update (not install). Your composer.json should contain cache/filesystem-adapter and swayok/alternative-laravel-cache requirements. This will recreate composer.lock with latest versions of all packages and hopefully install missing packages. Also it might be helpful to remove vendor folder entirely to be sure all packages are reinstalled.

oureco123 commented 3 years ago

I followed your instructions. But now i'm having an unrelated issue (i actually did the same instructions before and had the same issue, upon attemtping to fix it i had another issue and it's just a nightmare).

`In Application.php line 690:

Class 'Maatwebsite\Sidebar\SidebarServiceProvi
der' not found`

swayok commented 3 years ago

It looks like something wrong with your composer. Have you tried to update/reinstall it? It is quite strange that some packages are not installed and then it cannot find classes (autoloader incorrect).

oureco123 commented 3 years ago

Okay, so for whoever is having the same issue, maybe i was the only one but here is what I did: Whenever i tried to run composer require xxx it would say that a class of something was not found, and whenever i tried to run composer require packagethatwasntfound, i'd find yet another package that wasn't found. What i did is i kept going on and at the end i required them ALL at once. Like this: composer require astrotomic/laravel-translatable maatwebsite/laravel-sidebar mcamara/laravel-localization cache/filesystem-adapter laravel/scout

And it worked!

Reinstalling or down/upgrading composer did not work. But thank you for your help still @swayok