mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
DbConnection: deprecate/replace quoteBinary()
Proxies to newer code as a fix, related calls should be substituded in the long run fixes #2630
This commit is contained in:
parent
deb5b97ea0
commit
bfda96f569
@ -14,6 +14,9 @@ v1.10.2 (unreleased)
|
|||||||
### Import and Sync
|
### Import and Sync
|
||||||
* FIX: triggering Sync manually produced an error on PostgreSQL (#2636)
|
* FIX: triggering Sync manually produced an error on PostgreSQL (#2636)
|
||||||
|
|
||||||
|
### Internals
|
||||||
|
* FIX: issue with empty activity log, deprecate outdated method (#2630)
|
||||||
|
|
||||||
v1.10.1
|
v1.10.1
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
namespace Icinga\Module\Director\Data\Db;
|
namespace Icinga\Module\Director\Data\Db;
|
||||||
|
|
||||||
use Icinga\Data\Db\DbConnection as IcingaDbConnection;
|
use Icinga\Data\Db\DbConnection as IcingaDbConnection;
|
||||||
|
use Icinga\Module\Director\Db\DbUtil;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Zend_Db_Expr;
|
use Zend_Db_Expr;
|
||||||
|
|
||||||
@ -18,21 +19,14 @@ class DbConnection extends IcingaDbConnection
|
|||||||
return $this->getDbType() === 'pgsql';
|
return $this->getDbType() === 'pgsql';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated
|
||||||
|
* @param ?string $binary
|
||||||
|
* @return Zend_Db_Expr|Zend_Db_Expr[]|null
|
||||||
|
*/
|
||||||
public function quoteBinary($binary)
|
public function quoteBinary($binary)
|
||||||
{
|
{
|
||||||
if ($binary === '') {
|
return DbUtil::quoteBinaryLegacy($binary, $this->getDbAdapter());
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_array($binary)) {
|
|
||||||
return array_map([$this, 'quoteBinary'], $binary);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->isPgsql()) {
|
|
||||||
return new Zend_Db_Expr("'\\x" . bin2hex($binary) . "'");
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Zend_Db_Expr('0x' . bin2hex($binary));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function binaryDbResult($value)
|
public function binaryDbResult($value)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user