diff --git a/nagios.php b/nagios.php index 5f44b7f..9add12d 100644 --- a/nagios.php +++ b/nagios.php @@ -35,7 +35,12 @@ */ // @codingStandardsIgnoreStart // Ignore required to skip codechecker error for no config.php load in class. -require_once(__DIR__ . '/../../../config.php'); +$dirroot = __DIR__ . '/../../../'; +if (substr($_SERVER['SCRIPT_FILENAME'], -42) == '/public/admin/tool/heartbeat/croncheck.php') { + // We are in Moodle 5.2 under the public/ sub path. + $dirroot = __DIR__ . '/../../../../'; +} +require_once($dirroot . 'config.php'); // @codingStandardsIgnoreEnd $format = '%b %d %H:%M:%S'; $now = userdate(time(), $format); diff --git a/version.php b/version.php index e34fc10..3f22024 100644 --- a/version.php +++ b/version.php @@ -24,8 +24,8 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2025121609; -$plugin->release = 2025121609; // Match release exactly to version. +$plugin->version = 2025121610; +$plugin->release = 2025121610; // Match release exactly to version. $plugin->requires = 2020061500; // Support for 3.9 and above, due to the Check API. $plugin->supported = [39, 405]; $plugin->component = 'tool_heartbeat';