diff --git a/source/packages/com_mokosuitebackup/src/Engine/BackupEngine.php b/source/packages/com_mokosuitebackup/src/Engine/BackupEngine.php index bf6544d..fa4a143 100644 --- a/source/packages/com_mokosuitebackup/src/Engine/BackupEngine.php +++ b/source/packages/com_mokosuitebackup/src/Engine/BackupEngine.php @@ -381,14 +381,19 @@ class BackupEngine */ private function checkRequiredExtensions(): true|string { + $required = [ + 'zip' => 'ext-zip (required for archive creation)', + 'pdo' => 'ext-pdo (required for database operations)', + 'pdo_mysql' => 'ext-pdo_mysql (required for MySQL database dumps)', + 'mbstring' => 'ext-mbstring (required for binary-safe operations)', + ]; + $missing = []; - if (!extension_loaded('zip')) { - $missing[] = 'ext-zip (required for archive creation)'; - } - - if (!extension_loaded('mbstring') && !function_exists('mb_strlen')) { - $missing[] = 'ext-mbstring (required for binary-safe operations)'; + foreach ($required as $ext => $label) { + if (!extension_loaded($ext)) { + $missing[] = $label; + } } if (!empty($missing)) { diff --git a/source/script.php b/source/script.php index f194511..4964a31 100644 --- a/source/script.php +++ b/source/script.php @@ -58,6 +58,19 @@ class Pkg_MokoSuiteBackupInstallerScript return false; } + // Check required PHP extensions (warn but don't block install) + $requiredExts = ['zip', 'pdo', 'pdo_mysql', 'mbstring', 'curl']; + $missingExts = array_filter($requiredExts, fn($ext) => !extension_loaded($ext)); + + if (!empty($missingExts)) { + Factory::getApplication()->enqueueMessage( + 'MokoSuiteBackup — Missing PHP Extensions: ' + . implode(', ', array_map(fn($e) => 'ext-' . $e, $missingExts)) + . '. Some features (backup, restore, remote upload, notifications) may not work until these are enabled.', + 'warning' + ); + } + // Save download key before Joomla re-registers the update site if ($type === 'update') { $this->preflight_saveKey();