mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-13 07:18:39 +00:00
test fixes
This commit is contained in:
parent
5de349ba68
commit
f83e60a592
|
|
@ -14,6 +14,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace phpOMS\DataStorage\Database;
|
namespace phpOMS\DataStorage\Database;
|
||||||
|
|
||||||
|
use Mpdf\Tag\P;
|
||||||
use phpOMS\DataStorage\Database\Connection\ConnectionAbstract;
|
use phpOMS\DataStorage\Database\Connection\ConnectionAbstract;
|
||||||
use phpOMS\DataStorage\Database\Connection\ConnectionFactory;
|
use phpOMS\DataStorage\Database\Connection\ConnectionFactory;
|
||||||
use phpOMS\DataStorage\Database\Connection\NullConnection;
|
use phpOMS\DataStorage\Database\Connection\NullConnection;
|
||||||
|
|
@ -74,11 +75,12 @@ final class DatabasePool implements DataStoragePoolInterface
|
||||||
return new NullConnection();
|
return new NullConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($key)) {
|
$con = empty($key) ? \reset($this->pool) : $this->pool[$key];
|
||||||
return \reset($this->pool);
|
if ($con->status !== DatabaseStatus::OK) {
|
||||||
|
$con->connect();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->pool[$key];
|
return $con;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
*/
|
*/
|
||||||
public function getBrowserName() : string
|
public function getBrowserName() : string
|
||||||
{
|
{
|
||||||
$userAgent = $_SERVER['HTTP_USER_AGENT'];
|
$userAgent = $_SERVER['HTTP_USER_AGENT'] ?? '';
|
||||||
|
|
||||||
if (\strpos($userAgent, 'Opera') !== false || \strpos($userAgent, 'OPR/') !== false) {
|
if (\strpos($userAgent, 'Opera') !== false || \strpos($userAgent, 'OPR/') !== false) {
|
||||||
return 'Opera';
|
return 'Opera';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user