From 882a4935d16e6a04107d2fd3de5834722134251d Mon Sep 17 00:00:00 2001 From: gthomas2 Date: Wed, 11 Mar 2026 00:03:20 +0000 Subject: [PATCH 1/2] Issue #116: fix php versions api rate limit. Issue #117: allow theme to be configured via config prop --- src/Model/MoodleConfig.php | 1 + src/Service/PHPVersions.php | 8 +++++++- templates/moodle/config.php.twig | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Model/MoodleConfig.php b/src/Model/MoodleConfig.php index f78ed46..c68e774 100644 --- a/src/Model/MoodleConfig.php +++ b/src/Model/MoodleConfig.php @@ -10,6 +10,7 @@ public function __construct( public string $lang = self::UNSET, public string $timezone = self::UNSET, public string $defaultblocks = self::UNSET, + public string $theme = self::UNSET, public bool $sslproxy = false ) { } } diff --git a/src/Service/PHPVersions.php b/src/Service/PHPVersions.php index 6d1cf27..cfa406a 100644 --- a/src/Service/PHPVersions.php +++ b/src/Service/PHPVersions.php @@ -35,7 +35,8 @@ public function listVersions(): array { '8.1', '8.2', '8.3', - '8.4' + '8.4', + '8.5' ]; try { @@ -50,6 +51,11 @@ public function listVersions(): array { return $hardCodedVersions; } + // Handle api rate limit issue. + if (!empty($branches['message']) && strpos($branches['message'], 'API rate limit exceeded') !== false) { + return $hardCodedVersions; + } + // Loop through the branches and extract the PHP version from the branch name try { $phpVersions = []; diff --git a/templates/moodle/config.php.twig b/templates/moodle/config.php.twig index 0cf927c..66c5b00 100644 --- a/templates/moodle/config.php.twig +++ b/templates/moodle/config.php.twig @@ -80,6 +80,10 @@ $CFG->behat_profiles['host-chrome'] = [ $CFG->lang = '{{config.lang}}'; {% endif %} +{% if (config.theme != UNSET) %} + $CFG->theme = '{{config.theme}}'; +{% endif %} + {% if (config.timezone != UNSET) %} date_default_timezone_set('{{config.timezone}}'); {% endif %} From df1075cb93f7c6c900a04b63d497d0b2cb935822 Mon Sep 17 00:00:00 2001 From: gthomas2 Date: Thu, 12 Mar 2026 12:02:31 +0000 Subject: [PATCH 2/2] Update templates/moodle/config.php.twig Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- templates/moodle/config.php.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/moodle/config.php.twig b/templates/moodle/config.php.twig index 66c5b00..c4982b7 100644 --- a/templates/moodle/config.php.twig +++ b/templates/moodle/config.php.twig @@ -81,7 +81,7 @@ $CFG->lang = '{{config.lang}}'; {% endif %} {% if (config.theme != UNSET) %} - $CFG->theme = '{{config.theme}}'; +$CFG->theme = '{{config.theme}}'; {% endif %} {% if (config.timezone != UNSET) %}