mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-19 06:51:33 +02:00
[ticket/16738] Multiple changes
Add post helper to get last post id Launch exception if an action is in progress Launch an exception if the action is already done When listing search backend in cli, if the active backend is not indexed an error is launched Add state to commands Fix small error in sphinx search backend PHPBB3-16738
This commit is contained in:
@@ -16,6 +16,8 @@ namespace phpbb\search\backend;
|
||||
use phpbb\cache\service;
|
||||
use phpbb\config\config;
|
||||
use phpbb\db\driver\driver_interface;
|
||||
use phpbb\search\exception\index_created_exception;
|
||||
use phpbb\search\exception\index_empty_exception;
|
||||
use phpbb\user;
|
||||
|
||||
/**
|
||||
@@ -323,6 +325,11 @@ abstract class base implements search_backend_interface
|
||||
*/
|
||||
public function create_index(int &$post_counter = 0): ?array
|
||||
{
|
||||
if ($this->index_created())
|
||||
{
|
||||
throw new index_created_exception();
|
||||
}
|
||||
|
||||
$max_post_id = $this->get_max_post_id();
|
||||
$forums_indexing_enabled = $this->forum_ids_with_indexing_enabled();
|
||||
|
||||
@@ -385,6 +392,11 @@ abstract class base implements search_backend_interface
|
||||
*/
|
||||
public function delete_index(int &$post_counter = null): ?array
|
||||
{
|
||||
if (!$this->index_created())
|
||||
{
|
||||
throw new index_empty_exception();
|
||||
}
|
||||
|
||||
$max_post_id = $this->get_max_post_id();
|
||||
|
||||
$starttime = microtime(true);
|
||||
|
Reference in New Issue
Block a user