Fix: Remove Application class references, use string literals for app ID and version

This commit is contained in:
WLTBAgent
2026-02-16 16:31:10 +00:00
parent 54b45c2727
commit 8b5c8826e2
5 changed files with 21 additions and 25 deletions

View File

@@ -8,7 +8,6 @@ use OCP\IRequest;
use OCP\IConfig;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Http\JSONResponse;
use OCA\AnalyticsHub\AppInfo\Application;
/**
* Admin Settings Controller
@@ -32,9 +31,9 @@ class AdminController {
* Load configuration
*/
public function load(): JSONResponse {
$clientId = $this->config->getAppValue('google_client_id', Application::APP_NAME, '');
$apiKey = $this->config->getAppValue('anthropic_api_key', Application::APP_NAME, '');
$refreshToken = $this->config->getAppValue('google_refresh_token', Application::APP_NAME, '');
$clientId = $this->config->getAppValue('google_client_id', 'analyticshub', '');
$apiKey = $this->config->getAppValue('anthropic_api_key', 'analyticshub', '');
$refreshToken = $this->config->getAppValue('google_refresh_token', 'analyticshub', '');
// Check if configured
$isConfigured = !empty($clientId) && !empty($apiKey) && !empty($refreshToken);
@@ -87,14 +86,14 @@ class AdminController {
}
// Save configuration
$this->config->setAppValue('google_client_id', Application::APP_NAME, $clientId);
$this->config->setAppValue('google_client_secret', Application::APP_NAME, $clientSecret);
$this->config->setAppValue('google_client_id', 'analyticshub', $clientId);
$this->config->setAppValue('google_client_secret', 'analyticshub', $clientSecret);
if (!empty($refreshToken)) {
$this->config->setAppValue('google_refresh_token', Application::APP_NAME, $refreshToken);
$this->config->setAppValue('google_refresh_token', 'analyticshub', $refreshToken);
}
$this->config->setAppValue('anthropic_api_key', Application::APP_NAME, $apiKey);
$this->config->setAppValue('anthropic_api_key', 'analyticshub', $apiKey);
// Check if fully configured
$isConfigured = !empty($clientId) && !empty($clientSecret) && !empty($apiKey) && !empty($refreshToken);