From e1a5c14bff8d760a154c53a74e90e5b0e4dcf403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 1 Jan 2025 09:43:18 +0100 Subject: [PATCH] fix phpstan --- htdocs/admin/tools/export_files.php | 4 ++-- htdocs/admin/tools/purge.php | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index 2d6a212bbab..604f4d5d9c7 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -3,7 +3,7 @@ * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2021 Regis Houssin - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * * 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 @@ -100,7 +100,7 @@ if ($action == 'delete') { */ // Increase limit of time. Works only if we are not in safe mode -$ExecTimeLimit = 1800; // 30mn +$ExecTimeLimit = getDolGlobalInt('MAIN_ADMIN_TOOLS_EXPORT_FILES_EXEC_TIME_LIMIT', 1800);; // 30mn if (!empty($ExecTimeLimit)) { $err = error_reporting(); error_reporting(0); // Disable all errors diff --git a/htdocs/admin/tools/purge.php b/htdocs/admin/tools/purge.php index 04498c05132..2fc10104aab 100644 --- a/htdocs/admin/tools/purge.php +++ b/htdocs/admin/tools/purge.php @@ -1,7 +1,7 @@ - * Copyright (C) 2006-2012 Regis Houssin - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2006-2017 Laurent Destailleur + * Copyright (C) 2006-2012 Regis Houssin + * Copyright (C) 2024-2025 Frédéric France * * 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 @@ -36,6 +36,8 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; * @var HookManager $hookmanager * @var Translate $langs * @var User $user + * + * @var string $dolibarr_main_data_root */ $langs->load("admin"); @@ -64,7 +66,7 @@ if (!$user->admin) { if ($action == 'purge' && !preg_match('/^confirm/i', $choice) && ($choice != 'allfiles' || $confirm == 'yes')) { // Increase limit of time. Works only if we are not in safe mode - $ExecTimeLimit = 600; + $ExecTimeLimit = getDolGlobalInt('MAIN_ADMIN_TOOLS_PURGE_EXEC_TIME_LIMIT', 600); if (!empty($ExecTimeLimit)) { $err = error_reporting(); error_reporting(0); // Disable all errors