diff --git a/core/classes/actions/class.action.quickPick.php b/core/classes/actions/class.action.quickPick.php index d5023ad0..316bf5c2 100644 --- a/core/classes/actions/class.action.quickPick.php +++ b/core/classes/actions/class.action.quickPick.php @@ -17,13 +17,6 @@ */ class QuickPick { - // Membership Pro api key & url - const API_KEY = '4abe15e5-95f2-4663-ad12-eadb245b28b4'; - const API_URL = 'https://bearsampp.com/index.php?option=com_osmembership&task=api.get_active_plan_ids&api_key='; - - // URL where quickpick-releases.json lives. - const JSON_URL = 'https://raw.githubusercontent.com/Bearsampp/Bearsampp/main/core/resources/quickpick-releases.json'; - /** * @var array $modules * @@ -136,7 +129,7 @@ public function checkQuickpickJson() } // Get the creation time of the remote file - $headers = get_headers( self::JSON_URL, 1 ); + $headers = get_headers( QUICKPICK_JSON_URL, 1 ); if ( $headers === false || !isset( $headers['Last-Modified'] ) ) { // If we cannot get the headers or Last-Modified is not set, assume no update is needed return false; @@ -186,11 +179,8 @@ public function rebuildQuickpickJson(): array { Util::logDebug( 'Fetching JSON file: ' . $this->jsonFilePath ); - // Define the URL of the remote JSON file - $url = self::JSON_URL; - // Fetch the JSON content from the URL - $jsonContent = file_get_contents( $url ); + $jsonContent = file_get_contents( QUICKPICK_JSON_URL ); if ( $jsonContent === false ) { // Handle error if the file could not be fetched @@ -317,7 +307,7 @@ public function checkDownloadId(): bool return false; } - $url = self::API_URL . self::API_KEY . '&download_id=' . $DownloadId; + $url = QUICKPICK_API_URL . QUICKPICK_API_KEY . '&download_id=' . $DownloadId; Util::logDebug( 'API URL: ' . $url ); $response = @file_get_contents( $url ); diff --git a/core/root.php b/core/root.php index 92053cf4..eba00265 100644 --- a/core/root.php +++ b/core/root.php @@ -5,18 +5,26 @@ * Website: https://bearsampp.com * Github: https://github.com/Bearsampp */ + /** * Defines constants used throughout the Bearsampp application. */ -define('APP_AUTHOR_NAME', 'N6REJ'); -define('APP_TITLE', 'Bearsampp'); -define('APP_WEBSITE', 'https://bearsampp.com'); -define('APP_LICENSE', 'GPL3 License'); -define('APP_GITHUB_USER', 'Bearsampp'); -define('APP_GITHUB_REPO', 'Bearsampp'); -define('APP_GITHUB_USERAGENT', 'Bearsampp'); -define('APP_GITHUB_LATEST_URL', 'https://api.github.com/repos/' . APP_GITHUB_USER . '/' . APP_GITHUB_REPO . '/releases/latest'); -define('RETURN_TAB', ' '); +const APP_AUTHOR_NAME = 'N6REJ'; +const APP_TITLE = 'Bearsampp'; +const APP_WEBSITE = 'https://bearsampp.com'; +const APP_LICENSE = 'GPL3 License'; +const APP_GITHUB_USER = 'Bearsampp'; +const APP_GITHUB_REPO = 'Bearsampp'; +const APP_GITHUB_USERAGENT = 'Bearsampp'; +const APP_GITHUB_LATEST_URL = 'https://api.github.com/repos/' . APP_GITHUB_USER . '/' . APP_GITHUB_REPO . '/releases/latest'; +const RETURN_TAB = ' '; + +// Membership Pro API key & URL +const QUICKPICK_API_KEY = '4abe15e5-95f2-4663-ad12-eadb245b28b4'; +const QUICKPICK_API_URL = 'https://bearsampp.com/index.php?option=com_osmembership&task=api.get_active_plan_ids&api_key='; + +// URL where quickpick-releases.json lives +const QUICKPICK_JSON_URL = 'https://raw.githubusercontent.com/Bearsampp/Bearsampp/main/core/resources/quickpick-releases.json'; /** * Includes the Root class file and creates an instance of Root.