Open nbsoftware opened 8 years ago
Ok, so after some further trials I have a working version, which I think is clean.
Basically it involves using a Illuminate\Container\Container
throughout all Session configuration and setup, and setting this container as a parameter in Slim's default container.
And finally, slightly modifying the PimpleSessionServiceProvider
to create the SessionManager
from the Illuminate Container extracted from Slim's container rather than directly from it.
I guess this better separates the usage of the two containers and I bet this is still working with the FileSystem driver.
I will verify this latter assertion, clean out things to show both usage (file & database) and then commit the changes on my repo.
When done you could then review those.
There you go. I've committed the changes in a new "database" branch.
I will need to look into this, I have not worked with the session library for a while now and not that familiar with Laravel 5+ version of the library, not sure why this change would have broken it. I looked at your branch and it looks good, just don't like the idea of two containers, but if it works, it works.
I agree. Not fond of two containers either but didn't find a prettier way to make it work. Should Laravel's container have implemented the container-interop interface, it would have been easier I suppose.
Hello, So I'm trying to use this package and configure it so that the session lives in the database as this was my original intent selecting it. Seems like this is harder than I thought it would be - and/or should be. I'm puzzled with an error in
Illuminate/Session/DatabaseSessionHandler
's_construct
where the last parameter is receiving aSlim\Container
rather than aIlluminate\Container\Container
and this because theIlluminate\Session\SessionManager->createDatabaseDriver
would pass$this->app
as the third parameter.As I'm pretty new to all these "container" enabled frameworks, I am not sure if this is easily fixable nor how. I've made many attempts but none of them are working. Those two containers (Pimple and Illuminate) don't seem to be interoperable. Would you be kind enough to put me on the correct path on how to do that? Thanks