Revert "Changes to improve testing (#9608)" (#9937)

This reverts commit d1a0ccda46.
This commit is contained in:
Tony Murray
2019-03-12 00:49:14 -05:00
committed by GitHub
parent d1a0ccda46
commit eb648a1d6f
43 changed files with 266 additions and 459 deletions

View File

@@ -22,7 +22,6 @@ use LibreNMS\Exceptions\InvalidIpException;
use LibreNMS\Util\Git;
use LibreNMS\Util\Html;
use LibreNMS\Util\IP;
use LibreNMS\Util\Laravel;
function generate_priority_label($priority)
{
@@ -664,7 +663,7 @@ if (!function_exists('d_echo')) {
{
global $debug;
if (Laravel::isBooted()) {
if (class_exists('\Log')) {
\Log::debug(is_string($text) ? rtrim($text) : $text);
} elseif ($debug) {
print_r($text);

View File

@@ -21,7 +21,6 @@ use Illuminate\Database\QueryException;
use LibreNMS\Config;
use LibreNMS\Exceptions\DatabaseConnectException;
use LibreNMS\DB\Eloquent;
use LibreNMS\Util\Laravel;
function dbIsConnected()
{
@@ -464,9 +463,11 @@ function dbHandleException(QueryException $exception)
}
}
$message .= $exception->getTraceAsString();
foreach ($exception->getTrace() as $trace) {
$message .= "\n " . $trace['file'] . ':' . $trace['line'];
}
if (Laravel::isBooted()) {
if (class_exists('Log')) {
Log::error($message);
} else {
c_echo("%rSQL Error!%n ");

View File

@@ -998,7 +998,7 @@ function send_mail($emails, $subject, $message, $html = false)
}
$mail->send();
return true;
} catch (\PHPMailer\PHPMailer\Exception $e) {
} catch (phpmailerException $e) {
return $e->errorMessage();
} catch (Exception $e) {
return $e->getMessage();

View File

@@ -23,8 +23,6 @@
* @author Tony Murray <murraytony@gmail.com>
*/
use LibreNMS\Util\Laravel;
if (!function_exists('d_echo')) {
/**
* Legacy convenience function - please use this instead of 'if ($debug) { echo ...; }'
@@ -37,7 +35,7 @@ if (!function_exists('d_echo')) {
{
global $debug;
if (Laravel::isBooted()) {
if (class_exists('\Log')) {
\Log::debug(is_string($text) ? rtrim($text) : $text);
} elseif ($debug) {
print_r($text);

View File

@@ -1,6 +1,5 @@
<?php
use LibreNMS\Config;
use LibreNMS\RRD\RrdDefinition;
$ipmi_rows = dbFetchRows("SELECT * FROM sensors WHERE device_id = ? AND poller_type='ipmi'", array($device['device_id']));