Skip to content

Commit

Permalink
do not lowercase driver names that are FQNs of PHP classes
Browse files Browse the repository at this point in the history
Without this change, SessionHandler storage drivers could only be added by adding new classes to the horde/sessionhandler package. There are situations when this is undesirable, e.g. if an app package wants to use its own custom SessionHandler storage driver that would not be useful on its own without the app. With this small change in the driver loading code, a driver class can now be part of any package, given that it is configured in Horde's config with its FQN, e.g.: "conf['sessionhandler']['type'] = '\Horde\Acme\SessionHandler\Storage\Acme';".
  • Loading branch information
ikselven authored and midahp committed Jul 30, 2024
1 parent ac6d15f commit 2345d20
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Horde/Core/Factory/SessionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ public function create(Horde_Injector $injector)
}
$params = Horde::getDriverConfig('sessionhandler', $driver);

$driver = basename(Horde_String::lower($driver));
if (strpos($driver, "\\") === false) {
$driver = Horde_String::lower($driver);
}
$driver = basename($driver);
$noset = false;

switch ($driver) {
Expand Down

0 comments on commit 2345d20

Please sign in to comment.