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

Lumen 5.6 #4

Closed mudasserzahid closed 4 years ago

mudasserzahid commented 6 years ago

Can we use this package in Lumen 5.6? If yes then please let me know because the composer is unable to locate specified package on my side. image

swayok commented 6 years ago

Hi. There was an incorrect package name in readme (already fixed). Correct one is: swayok/alternative-laravel-cache (note dashes). I haven't tested this package in Lumen so it might not work as intended there. Please report here any issues you encounter and I will fix it asap. Or make pull request =)

mudasserzahid commented 6 years ago

okay, sure I'll continue developing my app using specified package. If there will be an issue, I'll let you know.

mudasserzahid commented 6 years ago

FYI Here how I fixed specified lib in Laravel Lumen 5.6. by using 5.4.* version. First issue was as; Class path.storage does not exist specified exception was resolved by creating instance in bootstrap/app.php $app->instance('path.config', app()->basePath() . DIRECTORY_SEPARATOR . 'config'); $app->instance('path.storage', app()->basePath() . DIRECTORY_SEPARATOR . 'storage'); 2nd issue was as; Target [Illuminate\Contracts\Routing\ResponseFactory] is not instantiable on calling Response and specified exception was resolved by creating a method in AppServiceProvider as; public function register() { $this->app->singleton('Illuminate\Contracts\Routing\ResponseFactory', function ($app) { return new \Illuminate\Routing\ResponseFactory( $app['Illuminate\Contracts\View\Factory'], $app['Illuminate\Routing\Redirector'] ); }); } and now it's working fine :)

swayok commented 6 years ago

Nice. I will dig into Lumen to understand differences in configurations. Currently I've found that configs should be loaded manually using $app->configure('path'); for example. Not sure there are such config already bundled in lumen though.

vpillinger commented 4 years ago

This is still relevant for Lumen 6, but the latest version has broken this for Lumen by adding \App::version to line 310 in AlternativeCacheStore in this commit https://github.com/swayok/alternative-laravel-cache/commit/5affc1ce792d4030e66d4bbc1d19cc62450b6007

This line needs to be changed to app()->version for the code to work in Lumen.