Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use OCA\FullTextSearch\Capabilities;
use OCA\FullTextSearch\ConfigLexicon;
use OCA\FullTextSearch\Search\UnifiedSearchProvider;
use OCA\FullTextSearch\Service\ConfigService;
use OCA\FullTextSearch\Service\IndexService;
use OCA\FullTextSearch\Service\ProviderService;
use OCA\FullTextSearch\Service\SearchService;
Expand All @@ -32,28 +31,12 @@
use Psr\Container\ContainerInterface;
use Throwable;

if (file_exists($autoLoad = __DIR__ . '/../../vendor/autoload.php')) {
include_once $autoLoad;
}

class Application extends App implements IBootstrap {
const APP_ID = 'fulltextsearch';
const APP_NAME = 'FullTextSearch';


/**
* Application constructor.
*
* @param array $params
*/
public const APP_ID = 'fulltextsearch';
public function __construct(array $params = []) {
parent::__construct(self::APP_ID, $params);
}


/**
* @param IRegistrationContext $context
*/
public function register(IRegistrationContext $context): void {
$context->registerCapability(Capabilities::class);
$context->registerSearchProvider(UnifiedSearchProvider::class);
Expand Down
5 changes: 5 additions & 0 deletions lib/ConfigLexicon.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class ConfigLexicon implements ILexicon {
public const COLLECTION_INDEXING_LIST = 'collection_indexing_list';
public const COLLECTION_INTERNAL = 'collection_internal';
public const COLLECTION_LINKS = 'collection_links';
public const LOCK_ID = 'lock_id';
public const LOCK_PING = 'lock_ping';

public function getStrictness(): Strictness {
return Strictness::NOTICE;
Expand All @@ -40,6 +42,9 @@ public function getAppConfigs(): array {
new Entry(key: self::COLLECTION_INDEXING_LIST, type: ValueType::INT, defaultRaw: 50, definition: 'size of chunks of async documents on collection queue request'),
new Entry(key: self::COLLECTION_INTERNAL, type: ValueType::STRING, defaultRaw: 'local', definition: 'name of the local collection'),
new Entry(key: self::COLLECTION_LINKS, type: ValueType::ARRAY, defaultRaw: [], definition: '(internal) data relative to collections'),
// IAppConfig::FLAG_INTERNAL)
new Entry(key: self::LOCK_ID, type: ValueType::STRING, defaultRaw: '', definition: 'internal lock id', lazy: true),
new Entry(key: self::LOCK_PING, type: ValueType::INT, defaultRaw: 0, definition: 'internal lock time', lazy: true),
];
}

Expand Down
149 changes: 0 additions & 149 deletions lib/Db/TickRequest.php

This file was deleted.

103 changes: 0 additions & 103 deletions lib/Db/TickRequestBuilder.php

This file was deleted.

14 changes: 14 additions & 0 deletions lib/Exceptions/LockException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\FullTextSearch\Exceptions;

use \Exception;

class LockException extends Exception {
}
30 changes: 30 additions & 0 deletions lib/Migration/Version33001Date202511242012.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\FullTextSearch\Migration;

use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\Attributes\DropTable;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

#[DropTable('fulltextsearch_ticks', description: 'table is useless since index lock is managed using IAppConfig')]
class Version33001Date202511242012 extends SimpleMigrationStep {
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
if (!$schema->hasTable('fulltextsearch_ticks')) {
return null;
}

$schema->dropTable('fulltextsearch_ticks');
return $schema;
}
}
7 changes: 0 additions & 7 deletions lib/Service/ConfigService.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
class ConfigService {
public function __construct(
private readonly IAppConfig $appConfig,
private readonly IConfig $config,
) {
}

Expand Down Expand Up @@ -57,12 +56,6 @@ public function setConfig(array $save): void {
}
}

public function getAppValue(string $key): string {
return $this->config->getSystemValueString(Application::APP_ID . '.' . $key,
(string)$this->appConfig->getAppValueString($key)
);
}

public function getInternalCollection(): string {
return $this->appConfig->getAppValueString(ConfigLexicon::COLLECTION_INTERNAL);
}
Expand Down
Loading