1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +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:
rubencm
2021-03-28 06:18:14 +02:00
committed by Ruben Calvo
parent 0c3e084d35
commit f1a2558cfe
15 changed files with 282 additions and 39 deletions

View File

@@ -17,6 +17,8 @@ use phpbb\config\config;
use phpbb\db\driver\driver_interface;
use phpbb\event\dispatcher_interface;
use phpbb\language\language;
use phpbb\search\exception\index_created_exception;
use phpbb\search\exception\index_empty_exception;
use phpbb\user;
use RuntimeException;
@@ -913,6 +915,11 @@ class fulltext_mysql extends base implements search_backend_interface
*/
public function create_index(int &$post_counter = 0): ?array
{
if ($this->index_created())
{
throw new index_created_exception();
}
// Make sure we can actually use MySQL with fulltext indexes
if ($error = $this->init())
{
@@ -985,6 +992,11 @@ class fulltext_mysql extends base implements search_backend_interface
*/
public function delete_index(int &$post_counter = null): ?array
{
if (!$this->index_created())
{
throw new index_empty_exception();
}
// Make sure we can actually use MySQL with fulltext indexes
if ($error = $this->init())
{