Overwrite constructor of Memory session handling so no session ini-setting in backend/testing environments are possible
This commit is contained in:
parent
af1299c697
commit
02c40ad1cb
2 changed files with 9 additions and 1 deletions
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
namespace Friendica\Core\Session;
|
namespace Friendica\Core\Session;
|
||||||
|
|
||||||
|
use Friendica\Core\Config\Configuration;
|
||||||
|
use Friendica\Model\User\Cookie;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Usable for backend processes (daemon/worker) and testing
|
* Usable for backend processes (daemon/worker) and testing
|
||||||
*
|
*
|
||||||
|
@ -9,6 +12,11 @@ namespace Friendica\Core\Session;
|
||||||
*/
|
*/
|
||||||
final class Memory extends Native
|
final class Memory extends Native
|
||||||
{
|
{
|
||||||
|
public function __construct(Configuration $config, Cookie $cookie)
|
||||||
|
{
|
||||||
|
$this->cookie = $cookie;
|
||||||
|
}
|
||||||
|
|
||||||
public function start()
|
public function start()
|
||||||
{
|
{
|
||||||
// Backward compatibility until all Session variables are replaced
|
// Backward compatibility until all Session variables are replaced
|
||||||
|
|
|
@ -62,7 +62,7 @@ class ApiTest extends DatabaseTest
|
||||||
$this->dice = (new Dice())
|
$this->dice = (new Dice())
|
||||||
->addRules(include __DIR__ . '/../../static/dependencies.config.php')
|
->addRules(include __DIR__ . '/../../static/dependencies.config.php')
|
||||||
->addRule(Database::class, ['instanceOf' => StaticDatabase::class, 'shared' => true])
|
->addRule(Database::class, ['instanceOf' => StaticDatabase::class, 'shared' => true])
|
||||||
->addRule(ISession::class, ['instanceOf' => Session\Memory::class, 'shared' => true]);
|
->addRule(ISession::class, ['instanceOf' => Session\Memory::class, 'shared' => true, 'call' => null]);
|
||||||
BaseObject::setDependencyInjection($this->dice);
|
BaseObject::setDependencyInjection($this->dice);
|
||||||
|
|
||||||
/** @var Database $dba */
|
/** @var Database $dba */
|
||||||
|
|
Loading…
Reference in a new issue