Skip to content

Commit

Permalink
Merge pull request #14217 from jdalsem/activity-last-action
Browse files Browse the repository at this point in the history
chore(session): move database session handler to database folder
  • Loading branch information
jeabakker committed Nov 21, 2022
2 parents d42a67a + 8d1ddd3 commit a7c214a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
<?php

namespace Elgg\Http;
namespace Elgg\Database;

use Elgg\Database\Delete;
use Elgg\Database\Insert;
use Elgg\Database\Select;
use Elgg\Database\Update;
use Elgg\Traits\TimeUsing;

/**
* Database session handler
*
* @internal
*/
class DatabaseSessionHandler implements \SessionHandlerInterface {
class SessionHandler implements \SessionHandlerInterface {

use TimeUsing;

Expand Down
4 changes: 2 additions & 2 deletions engine/classes/ElggSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use Elgg\Database;
use Elgg\Exceptions\LoginException;
use Elgg\Exceptions\SecurityException;
use Elgg\Http\DatabaseSessionHandler;
use Elgg\Database\SessionHandler;
use Elgg\SystemMessagesService;
use Elgg\Traits\Debug\Profilable;
use Symfony\Component\HttpFoundation\Session\Session;
Expand Down Expand Up @@ -557,7 +557,7 @@ public static function fromDatabase(Config $config, Database $db) {
'cookie_lifetime' => $params['lifetime'],
];

$handler = new DatabaseSessionHandler($db);
$handler = new SessionHandler($db);
$storage = new NativeSessionStorage($options, $handler);
$session = new Session($storage);
return new self($session);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?php

namespace Elgg\Http;
namespace Elgg\Database;

use Elgg\IntegrationTestCase;

class DatabaseSessionHandlerIntegrationTest extends IntegrationTestCase {
class SessionHandlerIntegrationTest extends IntegrationTestCase {

/**
* @var DatabaseSessionHandler
* @var SessionHandler
*/
protected $handler;

public function up() {
$this->handler = new DatabaseSessionHandler(_elgg_services()->db);
$this->handler = new SessionHandler(_elgg_services()->db);
}

public function testReadWriteDestroy() {
Expand Down

0 comments on commit a7c214a

Please sign in to comment.