leuchtfeuer/leuchtfeuer-housekeeping-bundle
Composer 安装命令:
composer require leuchtfeuer/leuchtfeuer-housekeeping-bundle
包简介
A Mautic plugin that helps you to keep your database in a good shape
README 文档
README
Overview / Purpose / Features
This plugin provides a Mautic Housekeeping Command for database cleanup purposes.
Requirements / Version Support
- Mautic 6.0
- PHP 8.1 or higher
Installation
Composer
This plugin can be installed through composer.
Manual Installation
Alternatively, it can be installed manually, following the usual steps:
- Download the plugin
- Unzip to the Mautic
pluginsdirectory - Rename folder to
LeuchtfeuerHousekeepingBundle - In the Mautic backend, go to the
Pluginspage as an administrator - Click on the
Install/Upgrade Pluginsbutton to install the Plugin. OR - If you have shell access, execute
php bin\console cache:clearandphp bin\console mautic:plugins:reloadto install the plugins.
Command
Command to delete lead_event_log table entries, campaign_lead_event_log table entries, email_stats table entries where the referenced email entry is currently not published and email_stats_devices table entries.
Important: If referenced email is ever switched back to published, the contacts will get the email again.
bin/console leuchtfeuer:housekeeping
By default, entries older than 365 days are deleted from the CampaignLeadEventLog, LeadEventLog, EmailStats (only email_stats entries that referenced emails entry is currently not published), EmailStatsDevices and PageHit tables.
Parameter
-d | --days-old | Specifies the minimum age of the entries to be deleted. Default: 365 days
-r | --dry-run | Execute as dry run. No entries will be deleted
-0 | --optimize-tables | Runs OPTIMIZE TABLE on all Mautic tables after the entries have been deleted.
-i | --cmp-id | Delete only data for a specific campaign ID from campaign_lead_event_log
-c | --campaign-lead | Only entries from the campaign_lead_event_log table will be deleted
-m | --email-stats | Only entries from the email_stats table where the referenced email entry is currently not published and from the email_stats_devices table will be deleted.
-t | --email-stats-tokens | Only set tokens fields in Email Stats Records to NULL instead of deleting the whole record
-l | --lead | Only entries from the lead_event_log table will be deleted.
-p | --page-hits | Only entries from the page_hits table will be deleted.
| --exclude-emails | Exclude specific email IDs from event log cleanup. Accepts comma-separated list of email IDs (e.g., 1,44,61). Works with --email-stats and --email-stats-tokens.
Notice
- Every last entry from the campaign_lead_event_log per campaign will be kept. This is due to contacts restarting campaigns if there is no last step preserved in the log.
Deleting huge ammounts of data
- It might happen that the plugin fails to delete if the data is too large to handle. In that case: Create the following bash script and iterate through the deletion day by day:
#!/bin/sh
DOCROOT="path/to/mautic"
TIME="/usr/bin/time"
OUT="$DOCROOT/../log/housekeeping-loop.date +%Y%m%d_%H%M%S"
START=put_start_day_here #(for example 200)
END=put_end_day_here #(for example 100)
OP="put_your_operator_here" #(for example "-m" for emails / "-p" for page_hits | needs to be in "")
seq $START -1 $END |while read i ; do
echo "********** $i **********" >> $OUT
$TIME -ao $OUT sudo -u www-data php $DOCROOT/bin/console leu:hou $OP -d $i 2>&1 >>$OUT
sleep 2
done
Author
Leuchtfeuer Digital Marketing GmbH
License
This plugin is licensed under the GPL v3 License.
leuchtfeuer/leuchtfeuer-housekeeping-bundle 适用场景与选型建议
leuchtfeuer/leuchtfeuer-housekeeping-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 106 次下载、GitHub Stars 达 24, 最近一次更新时间为 2025 年 06 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「plugin」 「integration」 「cleanup」 「Mautic」 「housekeeping」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 leuchtfeuer/leuchtfeuer-housekeeping-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 leuchtfeuer/leuchtfeuer-housekeeping-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 leuchtfeuer/leuchtfeuer-housekeeping-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
LinkedIn API PHP SDK with OAuth 2.0 & CSRF support. Can be used for social sign in or sharing on LinkedIn. Examples. Documentation.
Library that let you catch fatal errors
LinkedIn API PHP SDK with OAuth 2.0 & CSRF support. Can be used for social sign in or sharing on LinkedIn. Examples. Documentation.
A vendor minify package, to remove tests and documentation and minifing all php files to save space
Laravel integration for blade-to-react
统计信息
- 总下载量: 106
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 24
- 点击次数: 31
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2025-06-30