engine() публичный метод

If a string is passed for the first argument, it will be treated as the class name and the second argument will be passed as the first argument in the constructor. If an instance of a SessionHandlerInterface is provided as the first argument, the handler will be set to it. If no arguments are passed it will return the currently configured handler instance or null if none exists.
public engine ( string | SessionHandlerInterface | null $class = null, array $options = [] ) : SessionHandlerInterface | null
$class string | SessionHandlerInterface | null The session handler to use
$options array the options to pass to the SessionHandler constructor
Результат SessionHandlerInterface | null
Пример #1
0
 /**
  * Tests instantiating a missing engine
  *
  * @expectedException \InvalidArgumentException
  * @expectedExceptionMessage The class "Derp" does not exist and cannot be used as a session engine
  * @return void
  */
 public function testBadEngine()
 {
     $session = new Session();
     $session->engine('Derp');
 }