mirror of
https://github.com/getgrav/grav.git
synced 2026-06-17 01:32:08 +02:00
Do not initialize session in CLI and unit tests
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user