Do not initialize session in CLI and unit tests

This commit is contained in:
Matias Griese
2018-03-09 21:07:44 +02:00
parent d008376169
commit 7e1c6b6137

View File

@@ -15,6 +15,19 @@ class Session extends BaseSession
/** @var bool */
protected $autoStart = false;
/**
* @param int $lifetime Defaults to 1800 seconds.
* @param string $path Cookie path.
* @param string $domain Optional, domain for the session
* @throws \RuntimeException
*/
public function __construct($lifetime, $path, $domain = null)
{
if (php_sapi_name() !== 'cli') {
parent::__construct($lifetime, $path, $domain);
}
}
/**
* Initialize session.
*