mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/12683] phpdoc and spaces
PHPBB3-12683
This commit is contained in:
parent
9a6d42770e
commit
d55f1e04eb
15 changed files with 76 additions and 70 deletions
|
@ -23,7 +23,7 @@ imports:
|
|||
- { resource: services_notification.yml }
|
||||
- { resource: services_password.yml }
|
||||
- { resource: services_php.yml }
|
||||
- { resource: services_post.yml }
|
||||
- { resource: services_posting.yml }
|
||||
- { resource: services_profilefield.yml }
|
||||
- { resource: services_report.yml }
|
||||
- { resource: services_routing.yml }
|
||||
|
|
|
@ -324,19 +324,19 @@ class acp_search
|
|||
foreach ($this->search_backend_collection as $search)
|
||||
{
|
||||
$this->template->assign_block_vars('backends', [
|
||||
'NAME' => $search->get_name(),
|
||||
'TYPE' => $search->get_type(),
|
||||
'NAME' => $search->get_name(),
|
||||
'TYPE' => $search->get_type(),
|
||||
|
||||
'S_ACTIVE' => $search->get_type() === $this->config['search_type'],
|
||||
'S_HIDDEN_FIELDS' => build_hidden_fields(['search_type' => $search->get_type()]),
|
||||
'S_INDEXED' => $search->index_created(),
|
||||
'S_STATS' => $search->index_stats(),
|
||||
'S_ACTIVE' => $search->get_type() === $this->config['search_type'],
|
||||
'S_HIDDEN_FIELDS' => build_hidden_fields(['search_type' => $search->get_type()]),
|
||||
'S_INDEXED' => $search->index_created(),
|
||||
'S_STATS' => $search->index_stats(),
|
||||
]);
|
||||
}
|
||||
|
||||
$this->template->assign_vars([
|
||||
'U_ACTION' => $this->u_action . '&hash=' . generate_link_hash('acp_search'),
|
||||
'UA_PROGRESS_BAR' => addslashes($this->u_action . '&action=progress_bar'),
|
||||
'U_ACTION' => $this->u_action . '&hash=' . generate_link_hash('acp_search'),
|
||||
'UA_PROGRESS_BAR' => addslashes($this->u_action . '&action=progress_bar'),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -152,8 +152,8 @@ $lang = array_merge($lang, array(
|
|||
'CLI_SEARCHINDEX_CREATE_FAILURE' => 'Error creating search index',
|
||||
'CLI_SEARCHINDEX_DELETE_SUCCESS' => 'Search index deleted successfully',
|
||||
'CLI_SEARCHINDEX_DELETE_FAILURE' => 'Error deleting search index',
|
||||
'CLI_SEARCHINDEX_ACTION_IN_PROGRESS' => 'There is an action currently in progress. CLI doesn\'t support incomplete index/delete actions, please solve it from the ACP',
|
||||
'CLI_SEARCHINDEX_ACTIVE_NOT_INDEXED' => 'Active search backend isn\'t indexed',
|
||||
'CLI_SEARCHINDEX_ACTION_IN_PROGRESS' => 'There is an action currently in progress. CLI doesn’t support incomplete index/delete actions, please solve it from the ACP',
|
||||
'CLI_SEARCHINDEX_ACTIVE_NOT_INDEXED' => 'Active search backend isn’t indexed',
|
||||
|
||||
// In all the case %1$s is the logical name of the file and %2$s the real name on the filesystem
|
||||
// eg: big_image.png (2_a51529ae7932008cf8454a95af84cacd) generated.
|
||||
|
|
|
@ -50,13 +50,13 @@ class create extends command
|
|||
/**
|
||||
* Construct method
|
||||
*
|
||||
* @param config $config
|
||||
* @param language $language
|
||||
* @param log $log
|
||||
* @param post_helper $post_helper
|
||||
* @param search_backend_factory $search_backend_factory
|
||||
* @param state_helper $state_helper
|
||||
* @param user $user
|
||||
* @param config $config
|
||||
* @param language $language
|
||||
* @param log $log
|
||||
* @param post_helper $post_helper
|
||||
* @param search_backend_factory $search_backend_factory
|
||||
* @param state_helper $state_helper
|
||||
* @param user $user
|
||||
*/
|
||||
public function __construct(config $config, language $language, log $log, post_helper $post_helper, search_backend_factory $search_backend_factory, state_helper $state_helper, user $user)
|
||||
{
|
||||
|
@ -93,8 +93,8 @@ class create extends command
|
|||
*
|
||||
* Create search index
|
||||
*
|
||||
* @param InputInterface $input The input stream used to get the options
|
||||
* @param OutputInterface $output The output stream, used to print messages
|
||||
* @param InputInterface $input The input stream used to get the options
|
||||
* @param OutputInterface $output The output stream, used to print messages
|
||||
*
|
||||
* @return int 0 if all is well, 1 if any errors occurred
|
||||
*/
|
||||
|
|
|
@ -50,13 +50,13 @@ class delete extends command
|
|||
/**
|
||||
* Construct method
|
||||
*
|
||||
* @param config $config
|
||||
* @param language $language
|
||||
* @param log $log
|
||||
* @param post_helper $post_helper
|
||||
* @param search_backend_factory $search_backend_factory
|
||||
* @param state_helper $state_helper
|
||||
* @param user $user
|
||||
* @param config $config
|
||||
* @param language $language
|
||||
* @param log $log
|
||||
* @param post_helper $post_helper
|
||||
* @param search_backend_factory $search_backend_factory
|
||||
* @param state_helper $state_helper
|
||||
* @param user $user
|
||||
*/
|
||||
public function __construct(config $config, language $language, log $log, post_helper $post_helper, search_backend_factory $search_backend_factory, state_helper $state_helper, user $user)
|
||||
{
|
||||
|
@ -93,8 +93,8 @@ class delete extends command
|
|||
*
|
||||
* Delete search index
|
||||
*
|
||||
* @param InputInterface $input The input stream used to get the options
|
||||
* @param OutputInterface $output The output stream, used to print messages
|
||||
* @param InputInterface $input The input stream used to get the options
|
||||
* @param OutputInterface $output The output stream, used to print messages
|
||||
*
|
||||
* @return int 0 if all is well, 1 if any errors occurred
|
||||
*/
|
||||
|
|
|
@ -59,11 +59,11 @@ abstract class base implements search_backend_interface
|
|||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param service $cache
|
||||
* @param config $config
|
||||
* @param driver_interface $db
|
||||
* @param user $user
|
||||
* @param string $search_results_table
|
||||
* @param service $cache
|
||||
* @param config $config
|
||||
* @param driver_interface $db
|
||||
* @param user $user
|
||||
* @param string $search_results_table
|
||||
*/
|
||||
public function __construct(service $cache, config $config, driver_interface $db, user $user, string $search_results_table)
|
||||
{
|
||||
|
|
|
@ -72,14 +72,14 @@ class fulltext_mysql extends base implements search_backend_interface
|
|||
* Constructor
|
||||
* Creates a new \phpbb\search\backend\fulltext_mysql, which is used as a search backend
|
||||
*
|
||||
* @param config $config Config object
|
||||
* @param driver_interface $db Database object
|
||||
* @param dispatcher_interface $phpbb_dispatcher Event dispatcher object
|
||||
* @param language $language
|
||||
* @param user $user User object
|
||||
* @param string $search_results_table
|
||||
* @param string $phpbb_root_path Relative path to phpBB root
|
||||
* @param string $phpEx PHP file extension
|
||||
* @param config $config Config object
|
||||
* @param driver_interface $db Database object
|
||||
* @param dispatcher_interface $phpbb_dispatcher Event dispatcher object
|
||||
* @param language $language
|
||||
* @param user $user User object
|
||||
* @param string $search_results_table
|
||||
* @param string $phpbb_root_path Relative path to phpBB root
|
||||
* @param string $phpEx PHP file extension
|
||||
*/
|
||||
public function __construct(config $config, driver_interface $db, dispatcher_interface $phpbb_dispatcher, language $language, user $user, string $search_results_table, string $phpbb_root_path, string $phpEx)
|
||||
{
|
||||
|
|
|
@ -111,16 +111,16 @@ class fulltext_native extends base implements search_backend_interface
|
|||
/**
|
||||
* Initialises the fulltext_native search backend with min/max word length
|
||||
*
|
||||
* @param config $config Config object
|
||||
* @param driver_interface $db Database object
|
||||
* @param dispatcher_interface $phpbb_dispatcher Event dispatcher object
|
||||
* @param language $language
|
||||
* @param user $user User object
|
||||
* @param string $search_results_table
|
||||
* @param string $search_wordlist_table
|
||||
* @param string $search_wordmatch_table
|
||||
* @param string $phpbb_root_path phpBB root path
|
||||
* @param string $phpEx PHP file extension
|
||||
* @param config $config Config object
|
||||
* @param driver_interface $db Database object
|
||||
* @param dispatcher_interface $phpbb_dispatcher Event dispatcher object
|
||||
* @param language $language
|
||||
* @param user $user User object
|
||||
* @param string $search_results_table
|
||||
* @param string $search_wordlist_table
|
||||
* @param string $search_wordmatch_table
|
||||
* @param string $phpbb_root_path phpBB root path
|
||||
* @param string $phpEx PHP file extension
|
||||
*/
|
||||
public function __construct(config $config, driver_interface $db, dispatcher_interface $phpbb_dispatcher, language $language, user $user, string $search_results_table, string $search_wordlist_table, string $search_wordmatch_table, string $phpbb_root_path, string $phpEx)
|
||||
{
|
||||
|
|
|
@ -84,14 +84,14 @@ class fulltext_postgres extends base implements search_backend_interface
|
|||
* Constructor
|
||||
* Creates a new \phpbb\search\backend\fulltext_postgres, which is used as a search backend
|
||||
*
|
||||
* @param config $config Config object
|
||||
* @param driver_interface $db Database object
|
||||
* @param dispatcher_interface $phpbb_dispatcher Event dispatcher object
|
||||
* @param language $language
|
||||
* @param user $user User object
|
||||
* @param string $search_results_table
|
||||
* @param string $phpbb_root_path Relative path to phpBB root
|
||||
* @param string $phpEx PHP file extension
|
||||
* @param config $config Config object
|
||||
* @param driver_interface $db Database object
|
||||
* @param dispatcher_interface $phpbb_dispatcher Event dispatcher object
|
||||
* @param language $language
|
||||
* @param user $user User object
|
||||
* @param string $search_results_table
|
||||
* @param string $phpbb_root_path Relative path to phpBB root
|
||||
* @param string $phpEx PHP file extension
|
||||
*/
|
||||
public function __construct(config $config, driver_interface $db, dispatcher_interface $phpbb_dispatcher, language $language, user $user, string $search_results_table, string $phpbb_root_path, string $phpEx)
|
||||
{
|
||||
|
|
|
@ -15,5 +15,4 @@ namespace phpbb\search\exception;
|
|||
|
||||
class action_in_progress_exception extends search_exception
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -15,5 +15,4 @@ namespace phpbb\search\exception;
|
|||
|
||||
class no_action_in_progress_exception extends search_exception
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -15,5 +15,4 @@ namespace phpbb\search\exception;
|
|||
|
||||
class no_search_backend_found_exception extends search_exception
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -17,5 +17,4 @@ use phpbb\exception\runtime_exception;
|
|||
|
||||
class search_exception extends runtime_exception
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ namespace phpbb\search;
|
|||
use phpbb\config\config;
|
||||
use phpbb\search\exception\action_in_progress_exception;
|
||||
use phpbb\search\exception\no_action_in_progress_exception;
|
||||
use phpbb\search\exception\no_search_backend_found_exception;
|
||||
use phpbb\search\exception\search_exception;
|
||||
|
||||
class state_helper
|
||||
|
@ -33,8 +34,8 @@ class state_helper
|
|||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param config $config
|
||||
* @param search_backend_factory $search_backend_factory
|
||||
* @param config $config
|
||||
* @param search_backend_factory $search_backend_factory
|
||||
*/
|
||||
public function __construct(config $config, search_backend_factory $search_backend_factory)
|
||||
{
|
||||
|
@ -53,7 +54,7 @@ class state_helper
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string The class name of the search backend
|
||||
*
|
||||
* @throws no_action_in_progress_exception If there is no action in progress
|
||||
*/
|
||||
|
@ -65,7 +66,7 @@ class state_helper
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string The action that is being executed, can be 'create' or 'delete'
|
||||
*
|
||||
* @throws no_action_in_progress_exception If there is no action in progress
|
||||
*/
|
||||
|
@ -77,7 +78,7 @@ class state_helper
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return int The post counter
|
||||
*
|
||||
* @throws no_action_in_progress_exception If there is no action in progress
|
||||
*/
|
||||
|
@ -89,11 +90,14 @@ class state_helper
|
|||
}
|
||||
|
||||
/**
|
||||
* Start a indexing or delete process.
|
||||
*
|
||||
* @param string $search_type
|
||||
* @param string $action
|
||||
*
|
||||
* @throws action_in_progress_exception If there is an action in progress
|
||||
* @throws no_search_backend_found_exception If search backend don't exist
|
||||
* @throws search_exception If action isn't valid
|
||||
*/
|
||||
public function init(string $search_type, string $action): void
|
||||
{
|
||||
|
@ -103,7 +107,7 @@ class state_helper
|
|||
throw new action_in_progress_exception();
|
||||
}
|
||||
|
||||
// Make sure the search type exist (if not, the next line launch an exception)
|
||||
// Make sure the search type exists (if not, throw an exception)
|
||||
$this->search_backend_factory->get($search_type);
|
||||
|
||||
// Make sure the action is correct (just in case)
|
||||
|
@ -122,6 +126,8 @@ class state_helper
|
|||
}
|
||||
|
||||
/**
|
||||
* Set the post counter
|
||||
*
|
||||
* @param int $counter
|
||||
*
|
||||
* @throws no_action_in_progress_exception If there is no action in progress
|
||||
|
@ -144,6 +150,8 @@ class state_helper
|
|||
}
|
||||
|
||||
/**
|
||||
* Load the state from the database
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws no_action_in_progress_exception If there is no action in progress
|
||||
|
@ -160,6 +168,8 @@ class state_helper
|
|||
}
|
||||
|
||||
/**
|
||||
* Save the specified state in the database
|
||||
*
|
||||
* @param array $state
|
||||
*/
|
||||
private function save_state(array $state = []): void
|
||||
|
|
Loading…
Add table
Reference in a new issue