Merge branch 'ent-7842-error-al-actualizar-server-con-update-manager-offline' into 'develop'

Ent 7842 error al actualizar server con update manager offline

See merge request artica/pandorafms!4323
This commit is contained in:
Daniel Rodriguez 2021-07-22 12:14:53 +00:00
commit 9be1755650
3 changed files with 57 additions and 37 deletions

View File

@ -70,6 +70,10 @@ if (empty($license) === true) {
} }
$mode_str = ''; $mode_str = '';
if (isset($mode) === false) {
$mode = null;
}
if ($mode === Manager::MODE_ONLINE) { if ($mode === Manager::MODE_ONLINE) {
$mode_str = 'online'; $mode_str = 'online';
} else if ($mode === Manager::MODE_OFFLINE) { } else if ($mode === Manager::MODE_OFFLINE) {

View File

@ -1340,18 +1340,17 @@ class Client
error_reporting(E_ALL ^ E_NOTICE); error_reporting(E_ALL ^ E_NOTICE);
set_error_handler( set_error_handler(
function ($errno, $errstr) { function ($errno, $errstr) {
if (preg_match('/Undefined index/', $errstr) > 1) {
return;
}
throw new \Exception($errstr, $errno); throw new \Exception($errstr, $errno);
} },
E_ERROR
); );
register_shutdown_function( register_shutdown_function(
function () { function () {
$error = error_get_last(); $error = error_get_last();
if (null !== $error) { if (null !== $error
&& $error['type'] === E_ERROR
) {
echo __('Failed to analyze package: %s', $error['message']); echo __('Failed to analyze package: %s', $error['message']);
} }
} }
@ -1434,7 +1433,8 @@ class Client
set_error_handler( set_error_handler(
function ($errno, $errstr) { function ($errno, $errstr) {
throw new \Exception($errstr, $errno); throw new \Exception($errstr, $errno);
} },
E_ERROR
); );
if ($package === null) { if ($package === null) {

View File

@ -1,38 +1,54 @@
<?php <?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; version 2
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
/** /**
* @package Include * Configuraton sample file.
* @subpackage Config *
* @category Config
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/ */
// Default values /*
// $config["dbname"]="pandora"; * Default values
// $config["dbuser"]="pandora"; * $config["dbname"]="pandora";
// $config["dbpass"]="pandora"; * $config["dbuser"]="pandora";
// $config["dbhost"]="localhost"; * $config["dbpass"]="pandora";
// This is used for reporting, please add "/" character at the end * $config["dbhost"]="localhost";
// $config["homedir"]="/var/www/pandora_console/"; *
// $config["homeurl"]="/pandora_console/"; *
// $config["auth"]["scheme"] = "mysql"; * This is used for reporting, please add "/" character at the end
* $config["homedir"]="/var/www/pandora_console/";
/** * $config["homeurl"]="/pandora_console/";
* Do not display any ERROR * $config["auth"]["scheme"] = "mysql";
*/
// By default report any error but notices.
error_reporting(E_ALL ^ E_NOTICE);
/*
* Uncomment to display only critical errors.
* error_reporting(E_ERROR);
* Uncomment to display none errors.
* error_reporting(0);
*/ */
error_reporting(E_ALL);
// Display ALL errors
// error_reporting(E_ERROR);
$ownDir = dirname(__FILE__).DIRECTORY_SEPARATOR; $ownDir = dirname(__FILE__).DIRECTORY_SEPARATOR;
require $ownDir.'config_process.php'; require $ownDir.'config_process.php';