Fix: Add proper Application.php and fix DI

- Created appinfo/Application.php (Nextcloud app bootstrap)
  - Extends OCP\AppFramework\App
  - Registers proper app ID: analyticshub
  - Loads CSS and JS files
- Removed obsolete lib/App.php file
- Updated all AppInfo::APP_NAME references to Application::APP_NAME
  - AdminController, ApiV1Controller
  - GoogleAnalyticsService, LLMService
- Fixed dependency injection in AdminController
  - Injected IConfig service properly
- Added missing use statements

This is the core fix for the app not appearing in Nextcloud.
Nextcloud requires appinfo/Application.php to initialize the app.
This commit is contained in:
WLTBAgent
2026-02-13 18:38:35 +00:00
parent 64bc88d6de
commit 13c313352c
6 changed files with 47 additions and 65 deletions

View File

@@ -9,6 +9,7 @@ use OCP\IResponse;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Http\JSONResponse;
use OCA\AnalyticsHub\AppInfo\Application;
use OCA\AnalyticsHub\Service\GoogleAnalyticsService;
use OCA\AnalyticsHub\Service\LLMService;
@@ -146,7 +147,7 @@ class ApiV1Controller {
$this->validateAgentAccess();
$status = [
'app_name' => AppInfo::APP_NAME,
'app_name' => Application::APP_NAME,
'version' => AppInfo::getVersion(),
'status' => 'operational',
'google_analytics' => $this->gaService->isConfigured() ? 'configured' : 'not_configured',