williarin/wordpress-anonymizer
Composer 安装命令:
composer create-project williarin/wordpress-anonymizer
包简介
Anonymize a WordPress database without a WordPress installation
README 文档
README
Introduction
This repository can be used as a third party library or as a standalone Docker application.
The main use case is to anonymize a database filled with user and customer data before committing it to a VCS repository. It will anonymize both WordPress base data and WooCommerce data.
Docker standalone usage
Run this command to automatically anonymize your WordPress database.
WARNING! This operation is irreversible. Make a database backup before proceeding. To make automatic backups of your WordPress database, you can use williarin/secure-mysql-backups.
docker run --rm \
-e DATABASE_URL='mysql://user:user@127.0.0.1:3306/wp_mywebsite?serverVersion=8.0&charset=utf8mb4' \
williarin/wordpress-anonymizer
Variables:
| Variable | Description | Default |
|---|---|---|
DATABASE_URL |
The database url to connect to. | mysql://test:test@127.0.0.1:6033/wp_test?serverVersion=8.0&charset=utf8mb4 |
TABLE_PREFIX |
The table prefix used by WordPress. | wp_ |
Installation as a library in your project
To integrate this library to your project, install it with Composer:
composer require williarin/wordpress-anonymizer
Usage
$faker = Faker\Factory::create(); $connection = DriverManager::getConnection(['url' => 'mysql://user:pass@localhost:3306/wp_mywebsite?serverVersion=8.0']); $tablePrefix = 'wp_'; $anonymizer = new Anonymizer([ new UserProvider($connection, $faker, $tablePrefix), new UserMetaProvider($connection, $faker, $tablePrefix), new CommentProvider($connection, $faker, $tablePrefix), new WoocommerceUserMetaProvider($connection, $faker, $tablePrefix), new WoocommercePostMetaProvider($connection, $faker, $tablePrefix), ]); // Anonymize the whole database at once $anonymizer->anonymize(); // or use a provider to anonymize only a part $commentProvider = new CommentProvider($connection, $faker, $tablePrefix); $commentProvider->anonymize();
License
Copyright (c) 2022, William Arin
williarin/wordpress-anonymizer 适用场景与选型建议
williarin/wordpress-anonymizer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 507 次下载、GitHub Stars 达 23, 最近一次更新时间为 2022 年 02 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 williarin/wordpress-anonymizer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 williarin/wordpress-anonymizer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 507
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 23
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-05