2026-04-16 14:01:13 +02:00
|
|
|
<?php
|
2026-04-16 16:23:54 +02:00
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2026-04-16 14:01:13 +02:00
|
|
|
namespace OCA\MinimalProfile\AppInfo;
|
|
|
|
|
|
|
|
|
|
use OCP\AppFramework\App;
|
|
|
|
|
use OCP\AppFramework\Bootstrap\IBootContext;
|
|
|
|
|
use OCP\AppFramework\Bootstrap\IBootstrap;
|
|
|
|
|
use OCP\AppFramework\Bootstrap\IRegistrationContext;
|
2026-04-16 16:23:54 +02:00
|
|
|
use OCP\IConfig;
|
2026-04-16 16:03:37 +02:00
|
|
|
use OCP\Util;
|
2026-04-16 14:01:13 +02:00
|
|
|
|
|
|
|
|
class Application extends App implements IBootstrap {
|
2026-04-16 16:23:54 +02:00
|
|
|
|
|
|
|
|
public function __construct(array $urlParams = []) {
|
2026-04-16 16:29:04 +02:00
|
|
|
parent::__construct('minimalprofile', $urlParams);
|
2026-04-16 16:23:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function register(IRegistrationContext $context): void {
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-16 14:01:13 +02:00
|
|
|
public function boot(IBootContext $context): void {
|
2026-04-16 16:29:04 +02:00
|
|
|
// Write to Nextcloud data directory
|
|
|
|
|
$dataDir = \OCP\Server::get(\OCP\IConfig::class)->getSystemValue('datadirectory');
|
|
|
|
|
$testFile = $dataDir . '/minimalprofile_test.log';
|
|
|
|
|
$result = @file_put_contents($testFile, date('Y-m-d H:i:s') . ' boot ran, config: ' . \OCP\Server::get(IConfig::class)->getAppValue('minimalprofile', 'hidden_fields', 'none') . "\n");
|
2026-04-16 16:23:54 +02:00
|
|
|
|
2026-04-16 16:29:04 +02:00
|
|
|
// Load CSS
|
|
|
|
|
Util::addStyle('minimalprofile', 'minimalprofile');
|
2026-04-16 16:26:50 +02:00
|
|
|
|
2026-04-16 16:29:04 +02:00
|
|
|
// Store result
|
|
|
|
|
@file_put_contents($dataDir . '/mp_result.log', date('Y-m-d H:i:s') . ' result: ' . ($result ?: 'failed') . "\n", FILE_APPEND);
|
2026-04-16 14:50:02 +02:00
|
|
|
}
|
2026-04-16 14:01:13 +02:00
|
|
|
}
|