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

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

Closed RohitM-IN closed 3 years ago

RohitM-IN commented 3 years ago

Hi, I just installed the package for Laravel 8 - Laravel Framework 8.40.0 and composer dump is giving error :-

Error

  Class 'Cache\Adapter\Filesystem\FilesystemCachePool' not found

  at D:\dev\laravel\covid-data-analysis\vendor\swayok\alternative-laravel-cache\AlternativeLaravelCache\Store\AlternativeFileCacheStore.php:26   
     22▕      *
     23▕      * @return AbstractCachePool|TaggableCacheItemPoolInterface
     24▕      */
     25▕     public function wrapConnection() {
  ➜  26▕         return new FilesystemCachePool($this->getDb());
     27▕     }
     28▕
     29▕     public function setPrefix($prefix) {
     30▕         // allowed chars: "a-zA-Z0-9_.! "

  1   D:\dev\laravel\covid-data-analysis\vendor\swayok\alternative-laravel-cache\AlternativeLaravelCache\Core\AlternativeCacheStore.php:105      
      AlternativeLaravelCache\Store\AlternativeFileCacheStore::wrapConnection()

  2   D:\dev\laravel\covid-data-analysis\vendor\swayok\alternative-laravel-cache\AlternativeLaravelCache\Core\AlternativeCacheStore.php:115      
      AlternativeLaravelCache\Core\AlternativeCacheStore::getWrappedConnection()
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

i tried to redump the composer but its giving same error

i dont think there is need but i still added \AlternativeLaravelCache\Provider\AlternativeCacheStoresServiceProvider::class, to config\app.php

and cache.php looks like

    'stores' => [

        'apc' => [
            'driver' => 'apc',
        ],

        'array' => [
            'driver' => 'array',
            'serialize' => false,
        ],

        'database' => [
            'driver' => 'database',
            'table' => 'cache',
            'connection' => null,
            'lock_connection' => null,
        ],

        'file' => [
            'driver' => 'file',
            'path' => storage_path('framework/cache/data'),
            'permissions' => [
                'file' => [
                    'public' => 0644,
                ],
                'dir' => [
                    'public' => 0755,
                ],
            ]
        ],

        'memcached' => [
            'driver' => 'memcached',
            'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
            'sasl' => [
                env('MEMCACHED_USERNAME'),
                env('MEMCACHED_PASSWORD'),
            ],
            'options' => [
                // Memcached::OPT_CONNECT_TIMEOUT => 2000,
            ],
            'servers' => [
                [
                    'host' => env('MEMCACHED_HOST', '127.0.0.1'),
                    'port' => env('MEMCACHED_PORT', 11211),
                    'weight' => 100,
                ],
            ],
        ],

        'redis' => [
            'driver' => 'redis',
            'connection' => 'cache',
            'lock_connection' => 'default',
        ],

        'dynamodb' => [
            'driver' => 'dynamodb',
            'key' => env('AWS_ACCESS_KEY_ID'),
            'secret' => env('AWS_SECRET_ACCESS_KEY'),
            'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
            'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
            'endpoint' => env('DYNAMODB_ENDPOINT'),
        ],

    ],

in composer.json it seems i am using "swayok/alternative-laravel-cache": "^6.1",

am i missing something ?

RohitM-IN commented 3 years ago

o never mind https://github.com/swayok/alternative-laravel-cache/issues/20#issuecomment-751990723