mirror of
https://github.com/friendica/friendica
synced 2024-12-23 03:20:15 +00:00
Remove unneeded configutation
This commit is contained in:
parent
d5a90f384d
commit
d755bbae8f
2 changed files with 5 additions and 12 deletions
|
@ -64,7 +64,6 @@ class Database
|
||||||
/** @var PDO|mysqli */
|
/** @var PDO|mysqli */
|
||||||
protected $connection;
|
protected $connection;
|
||||||
protected $driver;
|
protected $driver;
|
||||||
protected $emulate_prepares = false;
|
|
||||||
protected $pdo_emulate_prepares = false;
|
protected $pdo_emulate_prepares = false;
|
||||||
private $error = false;
|
private $error = false;
|
||||||
private $errorno = 0;
|
private $errorno = 0;
|
||||||
|
@ -122,7 +121,6 @@ class Database
|
||||||
|
|
||||||
$persistent = (bool)$this->configCache->get('database', 'persistent');
|
$persistent = (bool)$this->configCache->get('database', 'persistent');
|
||||||
|
|
||||||
$this->emulate_prepares = (bool)$this->configCache->get('database', 'emulate_prepares');
|
|
||||||
$this->pdo_emulate_prepares = (bool)$this->configCache->get('database', 'pdo_emulate_prepares');
|
$this->pdo_emulate_prepares = (bool)$this->configCache->get('database', 'pdo_emulate_prepares');
|
||||||
|
|
||||||
if (!$this->configCache->get('database', 'disable_pdo') && class_exists('\PDO') && in_array('mysql', PDO::getAvailableDrivers())) {
|
if (!$this->configCache->get('database', 'disable_pdo') && class_exists('\PDO') && in_array('mysql', PDO::getAvailableDrivers())) {
|
||||||
|
@ -527,7 +525,7 @@ class Database
|
||||||
switch ($this->driver) {
|
switch ($this->driver) {
|
||||||
case self::PDO:
|
case self::PDO:
|
||||||
// If there are no arguments we use "query"
|
// If there are no arguments we use "query"
|
||||||
if ($this->emulate_prepares || count($args) == 0) {
|
if (count($args) == 0) {
|
||||||
if (!$retval = $this->connection->query($this->replaceParameters($sql, $args))) {
|
if (!$retval = $this->connection->query($this->replaceParameters($sql, $args))) {
|
||||||
$errorInfo = $this->connection->errorInfo();
|
$errorInfo = $this->connection->errorInfo();
|
||||||
$this->error = $errorInfo[2];
|
$this->error = $errorInfo[2];
|
||||||
|
@ -577,7 +575,7 @@ class Database
|
||||||
$can_be_prepared = in_array($command, ['select', 'update', 'insert', 'delete']);
|
$can_be_prepared = in_array($command, ['select', 'update', 'insert', 'delete']);
|
||||||
|
|
||||||
// The fallback routine is called as well when there are no arguments
|
// The fallback routine is called as well when there are no arguments
|
||||||
if ($this->emulate_prepares || !$can_be_prepared || (count($args) == 0)) {
|
if (!$can_be_prepared || (count($args) == 0)) {
|
||||||
$retval = $this->connection->query($this->replaceParameters($sql, $args));
|
$retval = $this->connection->query($this->replaceParameters($sql, $args));
|
||||||
if ($this->connection->errno) {
|
if ($this->connection->errno) {
|
||||||
$this->error = $this->connection->error;
|
$this->error = $this->connection->error;
|
||||||
|
|
|
@ -53,15 +53,10 @@ return [
|
||||||
// Database connection charset. Changing this value will likely corrupt special characters.
|
// Database connection charset. Changing this value will likely corrupt special characters.
|
||||||
'charset' => 'utf8mb4',
|
'charset' => 'utf8mb4',
|
||||||
|
|
||||||
// emulate_prepares (Boolean) (Experimental)
|
// pdo_emulate_prepares (Boolean)
|
||||||
// If enabled, prepared statements will be emulated.
|
|
||||||
// In combination with MySQLi this will cast all return values to strings.
|
|
||||||
'emulate_prepares' => false,
|
|
||||||
|
|
||||||
// pdo_emulate_prepares (Boolean) (Experimental)
|
|
||||||
// If enabled, the builtin emulation for prepared statements is used.
|
// If enabled, the builtin emulation for prepared statements is used.
|
||||||
// Due to limitations of that emulation (all return values are casted as strings)
|
// When enabled, a workaround is used to ensure that the returned field types are correct,
|
||||||
// this will most likely cause issues and should not be used on production systems.
|
// since by standard all returned values are casted as strings.
|
||||||
'pdo_emulate_prepares' => false,
|
'pdo_emulate_prepares' => false,
|
||||||
|
|
||||||
// disable_pdo (Boolean)
|
// disable_pdo (Boolean)
|
||||||
|
|
Loading…
Reference in a new issue