Skip to content

Commit

Permalink
Merge pull request #403 from tyrant88/tyrant88-patch-192
Browse files Browse the repository at this point in the history
6.12.1 cronjob to clear search cache
  • Loading branch information
tyrant88 authored Jan 14, 2025
2 parents fcd75b9 + f37b812 commit 8962cb0
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## Version 6.12.1 (2025-01-14)
- remove/replace utf8_encode() in statistik PlugIn for PHP 8.2
- cronjob to clear search cache

## Version 6.11.2 (2024-07-29)
- autocomplete Plugin is deprecated, use the new subpage instead
Expand Down
1 change: 1 addition & 0 deletions boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
}
if (rex_addon::get('cronjob')->isAvailable() && !rex::isSafeMode()) {
rex_cronjob_manager::registerType(rex_cronjob_reindex::class);
rex_cronjob_manager::registerType(rex_cronjob_clearcache::class);
}

if (rex_request('search_it_build_index', 'string', '') != '') {
Expand Down
3 changes: 2 additions & 1 deletion lang/de_de.lang
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ search_it_generate_full_text = Die Index-Tabelle wird gelöscht und neu aufgebau
search_it_generate_incremental = Index schrittweise erstellen
search_it_generate_incremental_text = Bei Problemen mit der maximalen Skriptlaufzeit (max_execution_time) kann der Index schrittweise erstellt werden.
search_it_generate_incremental_confirm = Die schrittweise Indexierung starten?
search_it_generate_delete_cache = Suchcache löschen
search_it_generate_delete_cache = Search it: Suchcache löschen
search_it_generate_delete_cache_text = Wenn eine Neuindexierung nicht erforderlich ist, kann auch ausschließlich der Cache gelöscht werden.
search_it_generate_cache_deleted = Suchcache wurde gelöscht
search_it_generate_cache_deleted_error = Fehler beim Löschen des Suchcaches
search_it_generate_delete_keywords = Keyword-Index leeren
search_it_generate_delete_keywords_text = Löscht alle Keywords, die bei der Indexierung oder über Suchanfragen gesammelt wurden. Diese Keywords werden unter anderem für die Ähnlichkeitssuche gebraucht und sollten nicht gelöscht werden.
search_it_generate_delete_keywords_confirm = Wirklich alle Keywords löschen?
Expand Down
5 changes: 3 additions & 2 deletions lang/en_gb.lang
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ search_it_generate_full_text = Deletes and rebuilds the index table.
search_it_generate_incremental = Generate index incrementally
search_it_generate_incremental_text = When having problems with maximum execution time the index can be generated incrementally.
search_it_generate_incremental_confirm = Start incremental indexing?
search_it_generate_delete_cache = Clear search cache
search_it_generate_delete_cache = Search it: Clear search cache
search_it_generate_delete_cache_text = If recreation of the index is not nescessary, the search cache can be deleted exclusively.
search_it_generate_cache_deleted = Search cache cleared
search_it_generate_cache_deleted = Search cache was cleared
search_it_generate_cache_deleted_error = Error while deleting the search cache
search_it_generate_delete_keywords = Truncate keyword index
search_it_generate_delete_keywords_text = Deletes all keywords collected during the indexing process and with searches. These keywords are nescessary for the fuzzy search and should not be deleted.
search_it_generate_delete_keywords_confirm = Do you really want to delete all keywords?
Expand Down
3 changes: 2 additions & 1 deletion lang/es_es.lang
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ search_it_generate_full_text = La tabla de índice se elimina y se reconstruye.
search_it_generate_incremental = Crear índice paso a paso
search_it_generate_incremental_text = Para los problemas con el tiempo de ejecución máximo del script (max_execution_time), el índice se puede crear paso a paso.
search_it_generate_incremental_confirm = Comience la indexación gradual?
search_it_generate_delete_cache = Eliminar caché de búsqueda
search_it_generate_delete_cache = Search it: Eliminar caché de búsqueda
search_it_generate_delete_cache_text = Si no es necesario reindexar, solo se puede eliminar el caché.
search_it_generate_cache_deleted = La memoria caché de búsqueda ha sido eliminada
search_it_generate_cache_deleted_error = Error al eliminar la memoria caché de búsqueda
search_it_generate_delete_keywords = Índice de palabras clave vacías
search_it_generate_delete_keywords_text = Elimina todas las palabras clave recopiladas durante la indexación o mediante consultas de búsqueda. Estas palabras clave se utilizan, entre otras cosas, para la búsqueda de similitud y no se deben eliminar.
search_it_generate_delete_keywords_confirm = ¿Realmente borras todas las palabras clave?
Expand Down
3 changes: 2 additions & 1 deletion lang/pt_br.lang
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ search_it_generate_full_text = A tabela de índice será descartada e reconstru
search_it_generate_incremental = Criar Index gradualmente
search_it_generate_incremental_text = Para problemas com o tempo máximo de execução de script (max_execution_time), o índice pode ser criado gradualmente.
search_it_generate_incremental_confirm = Começar a indexação progressiva?
search_it_generate_delete_cache = Limpar cachê de busca
search_it_generate_delete_cache = Search it: Limpar cachê de busca
search_it_generate_delete_cache_text = Se um re-indexação não é necessária, o cache também pode ser totalmente excluído.
search_it_generate_cache_deleted = Cachê de busca foi apagado
search_it_generate_cache_deleted_error = Erro ao apagar o cache de busca
search_it_generate_delete_keywords = Esvaziar o Index de palavras-chave
search_it_generate_delete_keywords_text = Apaga todas as palavras-chave que foram coletadas através de indexação ou solicitações de busca. Essas palavras-chave são utilizadas para a busca por similiridade, entre outras, e não devem ser deletadas.
search_it_generate_delete_keywords_confirm = Você realmente deseja deletar todas as palavras-chave?
Expand Down
3 changes: 2 additions & 1 deletion lang/sv_se.lang
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ search_it_generate_full_text = Raderar och bygger om indextabellen.
search_it_generate_incremental = Generera index inkrementellt
search_it_generate_incremental_text = När du har problem med maximal körtid (max_execution_time) kan indexet genereras stegvis.
search_it_generate_incremental_confirm = Börja inkrementell indexering?
search_it_generate_delete_cache = Rensa sökcachen
search_it_generate_delete_cache = Search it: Rensa sökcachen
search_it_generate_delete_cache_text = Om en nyindexering inte är nödvändig kan enbart cachen raderas.
search_it_generate_cache_deleted = Sökcachen raderades.
search_it_generate_cache_deleted_error = Fel vid radering av cachen.
search_it_generate_delete_keywords = Tömma nyckelord-index
search_it_generate_delete_keywords_text = Ta bort alla sökord som samlats in under indexeringsprocessen och/eller med sökningar. Dessa nyckelord är bl.a. nödvändiga för den likhetssökningen och bör inte raderas.
search_it_generate_delete_keywords_confirm = Vill du verkligen ta bort alla nyckelord?
Expand Down
37 changes: 37 additions & 0 deletions lib/command/clearCache.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
* @package redaxo\be-style
*
* @author bloep
*
* @internal
*/
class rex_search_it_command_clearcache extends rex_console_command
{
protected function configure()
{
$this->setDescription(rex_i18n::rawMsg('search_it_generate_delete_cache'));
}

protected function execute(InputInterface $input, OutputInterface $output)
{
$io = $this->getStyle($input, $output);
$io->title('search_it clear cache');

$search_it = new search_it();
$global_return = $search_it->deleteCache();

if ($global_return < 4) {
echo $io->success(rex_i18n::rawMsg('search_it_generate_cache_deleted'));
return 0;
} else {
echo $io->error(rex_i18n::rawMsg('search_it_generate_cache_deleted_error'));
}

return 1;
}
}
35 changes: 35 additions & 0 deletions lib/cronjob_clearcache.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

class rex_cronjob_clearcache extends rex_cronjob
{
public function execute()
{

if (rex_addon::get('search_it')->isAvailable()) {

//$message = $this->getParam('action').':'."\n";

$search_it = new search_it();

$search_it->deleteCache();



//if ( $message != '' ) { $this->setMessage($message); }
return true;
}
$this->setMessage('Search it is not installed');
return false;
}

public function getTypeName()
{
return rex_i18n::msg('search_it_generate_delete_cache');
}

public function getParamFields()
{
$fields = [];
return $fields;
}
}
3 changes: 2 additions & 1 deletion package.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package: search_it
version: '6.11.2'
version: '6.12.1'
author: Friends Of REDAXO
supportpage: https://github.com/FriendsOfREDAXO/search_it

Expand Down Expand Up @@ -33,6 +33,7 @@ page:

console_commands:
search_it:reindex: rex_search_it_command_reindex
search_it:clearCache: rex_search_it_command_clearcache

requires:
redaxo: '^5.6.0'
Expand Down
2 changes: 1 addition & 1 deletion plugins/stats/package.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package: search_it/stats
version: '6.11.2'
version: '6.12.1'
author: Friends Of REDAXO

title: 'translate:search_it_stats_plugin_title'
Expand Down

0 comments on commit 8962cb0

Please sign in to comment.