Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the configuration index name #2

Open
1 task done
weierophinney opened this issue Dec 31, 2019 · 3 comments
Open
1 task done

Fix the configuration index name #2

weierophinney opened this issue Dec 31, 2019 · 3 comments
Labels
Bug Something isn't working Documentation

Comments

@weierophinney
Copy link
Member

Looks like the example code in bootstrapSession() expects to read a key sessionand not session_manager from the configuration.

Provide a narrative description of what you are trying to accomplish:

  • Documentation enhacement

Originally posted by @ekarakashi at zendframework/zend-session#124

@weierophinney weierophinney added Bug Something isn't working Documentation labels Dec 31, 2019
@weierophinney
Copy link
Member Author

We have ticket #71 to fix the whole documentation for Session Manager (I think we should at least mention default factory we have in the package).

Also I'd like to point zendframework/zend-session#61 where we made a change.

/cc @froschdesign


Originally posted by @michalbundyra at zendframework/zend-session#124 (comment)

@weierophinney
Copy link
Member Author

@webimpress

I think we should at least mention default factory we have in the package

We must document the factory because this is the way the user should go. These manual configuration must be removed from all packages.


Originally posted by @froschdesign at zendframework/zend-session#124 (comment)

@genby8
Copy link

genby8 commented Jan 15, 2020

'service_manager' => [
        'factories' => [
            SaveHandlerInterface::class => SaveHandlerDbFactory::class,
            SaveHandlerDbFactory::class => InvokableFactory::class,
        ]
]
namespace App\Session\SaveHandler;

use Interop\Container\ContainerInterface;
use Laminas\Db\Adapter\Adapter;
use Laminas\Db\TableGateway\TableGateway;
use Laminas\ServiceManager\Factory\FactoryInterface;
use Laminas\Session\SaveHandler\DbTableGateway;
use Laminas\Session\SaveHandler\DbTableGatewayOptions;

class SaveHandlerDbFactory implements FactoryInterface
{
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
    {
        return new DbTableGateway(
            new TableGateway( 'session', $container->get(Adapter::class)),
            new DbTableGatewayOptions()
        );
    }
}

This best way inject?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Documentation
Projects
2 participants