コード例 #1
0
 /**
  * @return SessionMiddleware[][]
  */
 public function validMiddlewaresProvider()
 {
     return [[new SessionMiddleware(new Sha256(), 'foo', 'foo', SetCookie::create(SessionMiddleware::DEFAULT_COOKIE), new Parser(), 100)], [SessionMiddleware::fromSymmetricKeyDefaults('not relevant', 100)], [SessionMiddleware::fromAsymmetricKeyDefaults(file_get_contents(__DIR__ . '/../../keys/private_key.pem'), file_get_contents(__DIR__ . '/../../keys/public_key.pem'), 200)]];
 }
コード例 #2
0
 public function __invoke(ContainerInterface $container, $requestedName, array $options = null) : SessionMiddleware
 {
     $config = $container->has('config') ? $container->get('config') : [];
     $options = $config['session']['psr7'];
     return SessionMiddleware::fromSymmetricKeyDefaults($options['signature_key'], $options['expiration_time']);
 }