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

@@ -32,7 +32,7 @@ class LLMService {
* Check if LLM service is configured
*/
public function isConfigured(): bool {
$apiKey = $this->config->getAppValue('anthropic_api_key', AppInfo::APP_NAME);
$apiKey = $this->config->getAppValue('anthropic_api_key', Application::APP_NAME);
return !empty($apiKey);
}
@@ -43,7 +43,7 @@ class LLMService {
$this->logger->info("Generating LLM report for: {$client->getName()}");
try {
$apiKey = $this->config->getAppValue('anthropic_api_key', AppInfo::APP_NAME);
$apiKey = $this->config->getAppValue('anthropic_api_key', Application::APP_NAME);
if (empty($apiKey)) {
throw new \Exception('Anthropic API key not configured');