warnMissingLicenseKey(); } private function warnMissingLicenseKey(): void { try { $db = Factory::getDbo(); $app = Factory::getApplication(); $query = $db->getQuery(true) ->select([$db->quoteName('update_site_id'), $db->quoteName('extra_query')]) ->from($db->quoteName('#__update_sites')) ->where('(' . $db->quoteName('name') . ' LIKE ' . $db->quote('%MokoSuiteField%') . ' OR ' . $db->quoteName('location') . ' LIKE ' . $db->quote('%MokoSuiteField%') . ')') ->setLimit(1); $db->setQuery($query); $site = $db->loadObject(); if ($site) { $extraQuery = (string) ($site->extra_query ?? ''); if (!empty($extraQuery) && strpos($extraQuery, 'dlid=') !== false) { parse_str($extraQuery, $parsed); if (!empty($parsed['dlid'])) { return; } } $editUrl = 'index.php?option=com_installer&task=updatesite.edit&update_site_id=' . (int) $site->update_site_id; } else { $editUrl = 'index.php?option=com_installer&view=updatesites'; } $app->enqueueMessage( 'Moko Consulting License Key Required — ' . 'No download key is configured. Updates will not be available until a valid license key is entered. ' . 'Enter License Key', 'warning' ); } catch (\Throwable $e) { // Silent — avoid breaking install if update_sites query fails } } }