- Renamed analytics-hub/ → analyticshub/ - App ID in info.xml is 'analyticshub' (no hyphen) - Nextcloud requires folder name to match app ID exactly - Fixes 'Could not download app analyticshub' error during installation Installation: - Upload analyticshub/ folder to /var/www/nextcloud/apps/ - Folder name must match app ID in info.xml
51 lines
1.4 KiB
PHP
51 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace OCA\AnalyticsHub;
|
|
|
|
use OCP\AppFramework\App;
|
|
use OCA\AnalyticsHub\Controller\ApiV1Controller;
|
|
use OCP\AnalyticsHub\Controller\ReportController;
|
|
use OCP\AnalyticsHub\Service\GoogleAnalyticsService;
|
|
use OCP\AnalyticsHub\Service\LLMService;
|
|
use OCP\AnalyticsHub\Service\DataProcessor;
|
|
|
|
class App extends App {
|
|
|
|
public const APP_NAME = 'analytics_hub';
|
|
|
|
public function __construct(array $urlParams = []) {
|
|
parent::__construct(self::APP_NAME, $urlParams);
|
|
|
|
// Register services
|
|
$this->registerService('GoogleAnalyticsService', function($c) {
|
|
return new GoogleAnalyticsService($c);
|
|
});
|
|
|
|
$this->registerService('LLMService', function($c) {
|
|
return new LLMService($c);
|
|
});
|
|
|
|
$this->registerService('DataProcessor', function($c) {
|
|
return new DataProcessor($c);
|
|
});
|
|
|
|
// Register controllers
|
|
$this->registerService('ApiV1Controller', function($c) {
|
|
return new ApiV1Controller($c);
|
|
});
|
|
|
|
$this->registerService('ReportController', function($c) {
|
|
return new ReportController($c);
|
|
});
|
|
|
|
$this->registerService('AdminController', function($c) {
|
|
return new AdminController($c);
|
|
});
|
|
}
|
|
|
|
public function getContainer() {
|
|
return $this->getContainer();
|
|
}
|