承接 inspiredminds/contao-search-and-replace 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

inspiredminds/contao-search-and-replace

最新稳定版本:1.0.0

Composer 安装命令:

composer require inspiredminds/contao-search-and-replace

包简介

Search and replace strings in the database.

README 文档

README

Contao Search & Replace

Allows you to search the database for a specific string and replace the occurences with another. You can also specify individual records to be replaced.

Before the strings are replaced in the database, a backup (via Contao's database backup functionality) will be created automatically. Keep in mind that Contao only keeps one backup of the same day by default.

Configuration

Default Tables

When going to Search & Replace in the back end, only the table tl_content will be selected by default. If you want other tables to be selected by default, you can change this via the contao_search_and_replace.default_tables parameter:

# config/config.yaml
parameters:
    contao_search_and_replace.default_tables:
        - tl_content
        - tl_news
        - tl_calendar_events

Ignored Tables

Some tables will not show up in the list of tables by default. You can change the list of tables to ignore via the contao_search_and_replace.ignored_tables parameter:

# config/config.yaml
parameters:
    contao_search_and_replace.ignored_tables:
        - altcha_challenges
        - messenger_messages
        - rememberme_token
        - search_and_replace_job
        - tl_crawl_queue
        - tl_cron_job
        - tl_log
        - tl_message_queue
        - tl_opt_in
        - tl_opt_in_related
        - tl_remember_me
        - tl_trusted_device
        - tl_undo
        - tl_version
        - webauthn_credentials

Asynchronous Operation

This extension supports asynchronous operation via Symfony Messenger - which will be important for large databases.

Contao 5.3+

In Contao 5.3 and up you will only need to route the messages manually:

# config/config.yaml
framework:
    messenger:
        routing:
            'InspiredMinds\ContaoSearchAndReplace\Message\SearchMessage': contao_prio_normal
            'InspiredMinds\ContaoSearchAndReplace\Message\ReplaceMessage': contao_prio_normal

You need to make sure though that a proper contao:cron cronjob is configured.

Contao 4.13

In Contao 4.13 you will also have to create a messenger transport, e.g.:

framework:
    messenger:
        transports:
            search_and_replace: 'doctrine://default?queue_name=search_and_replace'
        routing:
            'InspiredMinds\ContaoSearchAndReplace\Message\SearchMessage': search_and_replace
            'InspiredMinds\ContaoSearchAndReplace\Message\ReplaceMessage': search_and_replace

If you use such a doctrine:// messenger transport you will also have to install symfony/doctrine-messenger:

composer require symfony/doctrine-messenger

Then you have to consume the messages somehow via

vendor/bin/contao-console messenger:consume search_and_replace

e.g. via a crontab entry like this:

* * * * * /usr/bin/php /var/www/example.com/vendor/bin/contao-console messenger:consume search_and_replace --time-limit=59 --quiet

统计信息

  • 总下载量: 39
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2025-04-14