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
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,8 @@ clean:
rm -rf $(build_dir)
rm -rf node_modules

# composer packages
composer:
composer install --prefer-dist
composer upgrade --prefer-dist

appstore: clean composer
appstore: clean
mkdir -p $(sign_dir)
rsync -a \
--exclude=/build \
Expand Down
25 changes: 0 additions & 25 deletions composer.json

This file was deleted.

59 changes: 0 additions & 59 deletions composer.lock

This file was deleted.

12 changes: 5 additions & 7 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@
use OCP\INavigationManager;
use OCP\IServerContainer;
use OCP\IURLGenerator;
use Symfony\Component\Routing\Exception\RouteNotFoundException;
use Psr\Container\ContainerInterface;
use Symfony\Component\Routing\Exception\RouteNotFoundException;
use Throwable;

require_once __DIR__ . '/../../vendor/autoload.php';


class Application extends App implements IBootstrap {

Expand Down Expand Up @@ -137,11 +135,11 @@ private function fullTextSearchNavigation(): array {
$urlGen = OC::$server->get(IURLGenerator::class);

return [
'id' => self::APP_ID,
'id' => self::APP_ID,
'order' => 5,
'href' => $urlGen->linkToRoute(self::APP_ID . '.Navigation.navigate'),
'icon' => $urlGen->imagePath(self::APP_ID, 'fulltextsearch.svg'),
'name' => 'Search'
'href' => $urlGen->linkToRoute(self::APP_ID . '.Navigation.navigate'),
'icon' => $urlGen->imagePath(self::APP_ID, 'fulltextsearch.svg'),
'name' => 'Search'
];
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Command/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
namespace OCA\FullTextSearch\Command;


use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools;
use OCA\FullTextSearch\Tools\Traits\TArrayTools;
use Exception;
use OC\Core\Command\InterruptedException;
use OCA\FullTextSearch\ACommandBase;
Expand Down
2 changes: 1 addition & 1 deletion lib/Command/Live.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
namespace OCA\FullTextSearch\Command;


use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools;
use OCA\FullTextSearch\Tools\Traits\TArrayTools;
use Exception;
use OC\Core\Command\InterruptedException;
use OCA\FullTextSearch\ACommandBase;
Expand Down
26 changes: 13 additions & 13 deletions lib/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@
namespace OCA\FullTextSearch\Controller;


use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\TNCDataResponse;
use Exception;
use OC\AppFramework\Http;
use OCA\FullTextSearch\AppInfo\Application;
use OCA\FullTextSearch\Model\SearchRequest;
use OCA\FullTextSearch\Service\ConfigService;
use OCA\FullTextSearch\Service\MiscService;
use OCA\FullTextSearch\Service\SearchService;
use OCA\FullTextSearch\Tools\Traits\TDeserialize;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;
Expand All @@ -50,10 +51,7 @@
* @package OCA\FullTextSearch\Controller
*/
class ApiController extends Controller {


use TNCDataResponse;

use TDeserialize;

/** @var IUserSession */
private $userSession;
Expand Down Expand Up @@ -128,23 +126,25 @@ private function searchDocuments(SearchRequest $request): DataResponse {
$user = $this->userSession->getUser();
$result = $this->searchService->search($user->getUID(), $request);

return $this->success(
$result,
return new DataResponse(
[
'request' => $request,
'version' => $this->configService->getAppValue('installed_version')
'version' => $this->configService->getAppValue('installed_version'),
'result' => $result,
'status' => 1
]
);
} catch (Exception $e) {
return $this->fail(
$e,
return new DataResponse(
[
'request' => $request,
'version' => $this->configService->getAppValue('installed_version')
]
'version' => $this->configService->getAppValue('installed_version'),
'status' => -1,
'exception' => get_class($e),
'message' => $e->getMessage()
], Http::STATUS_INTERNAL_SERVER_ERROR
);
}
}

}

48 changes: 48 additions & 0 deletions lib/Db/CoreQueryBuilder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

declare(strict_types=1);


/**
* FullTextSearch - Full text search framework for Nextcloud
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2018
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/


namespace OCA\FullTextSearch\Db;



use OCA\FullTextSearch\Tools\Db\ExtendedQueryBuilder;

/**
* Class CoreQueryBuilder
*
* @package OCA\Files_FullTextSearch\Db
*/
class CoreQueryBuilder extends ExtendedQueryBuilder {



}

5 changes: 5 additions & 0 deletions lib/Db/CoreRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ public function __construct(
}


public function getQueryBuilder(): CoreQueryBuilder {
return new CoreQueryBuilder();
}


/**
* Limit the request to the Id
*
Expand Down
5 changes: 2 additions & 3 deletions lib/Db/IndexesRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
namespace OCA\FullTextSearch\Db;


use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools;
use OCA\FullTextSearch\Model\Index;
use OCA\FullTextSearch\Tools\Traits\TArrayTools;
use OCP\DB\QueryBuilder\IQueryBuilder;


Expand All @@ -43,7 +43,6 @@
*/
class IndexesRequestBuilder extends CoreRequestBuilder {


use TArrayTools;


Expand All @@ -53,7 +52,7 @@ class IndexesRequestBuilder extends CoreRequestBuilder {
* @return IQueryBuilder
*/
protected function getIndexesInsertSql(): IQueryBuilder {
$qb = $this->dbConnection->getQueryBuilder();
$qb = $this->getQueryBuilder();
$qb->insert(self::TABLE_INDEXES);

return $qb;
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/TickRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
namespace OCA\FullTextSearch\Db;


use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools;
use OCA\FullTextSearch\Tools\Traits\TArrayTools;
use OCA\FullTextSearch\Model\Tick;
use OCP\DB\QueryBuilder\IQueryBuilder;

Expand Down
2 changes: 1 addition & 1 deletion lib/Model/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
namespace OCA\FullTextSearch\Model;


use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools;
use OCA\FullTextSearch\Tools\Traits\TArrayTools;
use JsonSerializable;
use OCP\FullTextSearch\Model\IIndex;
use OCP\IURLGenerator;
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/IndexOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
namespace OCA\FullTextSearch\Model;


use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools;
use OCA\FullTextSearch\Tools\Traits\TArrayTools;
use JsonSerializable;
use OCP\FullTextSearch\Model\IIndexOptions;

Expand Down
2 changes: 1 addition & 1 deletion lib/Model/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
namespace OCA\FullTextSearch\Model;


use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools;
use OCA\FullTextSearch\Tools\Traits\TArrayTools;
use Exception;
use OCA\FullTextSearch\ACommandBase;
use OCA\FullTextSearch\Exceptions\RunnerAlreadyUpException;
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/SearchRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
namespace OCA\FullTextSearch\Model;


use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools;
use OCA\FullTextSearch\Tools\Traits\TArrayTools;
use JsonSerializable;
use OCP\FullTextSearch\Model\ISearchRequest;
use OCP\FullTextSearch\Model\ISearchRequestSimpleQuery;
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/Tick.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
namespace OCA\FullTextSearch\Model;


use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools;
use OCA\FullTextSearch\Tools\Traits\TArrayTools;

/**
* Class Tick
Expand Down
2 changes: 1 addition & 1 deletion lib/Search/UnifiedSearchProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
namespace OCA\FullTextSearch\Search;


use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools;
use OCA\FullTextSearch\Tools\Traits\TArrayTools;
use Exception;
use OCA\FullTextSearch\Model\SearchRequest;
use OCA\FullTextSearch\Service\ConfigService;
Expand Down
5 changes: 3 additions & 2 deletions lib/Service/SearchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
namespace OCA\FullTextSearch\Service;


use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger;
use OCA\FullTextSearch\Tools\Traits\Nextcloud\nc22\TNC22Logger;
use Exception;
use OC;
use OC\App\AppManager;
Expand All @@ -44,6 +44,7 @@
use OCA\FullTextSearch\Exceptions\ProviderDoesNotExistException;
use OCA\FullTextSearch\Model\SearchRequest;
use OCA\FullTextSearch\Model\SearchResult;
use OCA\FullTextSearch\Tools\Traits\TNCLogger;
use OCP\FullTextSearch\IFullTextSearchPlatform;
use OCP\FullTextSearch\IFullTextSearchProvider;
use OCP\FullTextSearch\Model\IDocumentAccess;
Expand All @@ -63,7 +64,7 @@
class SearchService implements ISearchService {


use TNC22Logger;
use TNCLogger;


/** @var string */
Expand Down
Loading