checkPhpExtensions('mysqli'); $this->checkMysqliReconnectSetting(); return $this->getMessageQueue(); } /** * Verify that mysqli.reconnect is set to 0 in order to avoid improper reconnects */ public function checkMysqliReconnectSetting() { $currentMysqliReconnectSetting = ini_get('mysqli.reconnect'); if ($currentMysqliReconnectSetting === '1') { $this->getMessageQueue()->enqueue(new FlashMessage( 'mysqli.reconnect=1' . LF . 'PHP is configured to automatically reconnect the database connection on disconnection.' . LF . ' Warning: If (e.g. during a long-running task) the connection is dropped and automatically reconnected, ' . ' it may not be reinitialized properly (e.g. charset) and write mangled data to the database!', 'PHP mysqli.reconnect is enabled', ContextualFeedbackSeverity::ERROR )); } else { $this->getMessageQueue()->enqueue(new FlashMessage( '', 'PHP mysqli.reconnect is fine' )); } } }