定制 nathanday/module-catalog-images-clean 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

nathanday/module-catalog-images-clean

Composer 安装命令:

composer require nathanday/module-catalog-images-clean

包简介

Magento 2 module to facilitate maintenance of catalog images

README 文档

README

Facts

Description

Magento 2 Module to Clean Catalog Images able to Remove Unused Images from the file system and missing images from the database.

Requirements

  • PHP >= 7.0.0
  • Mage_Core

Compatibility

  • Magento >= 2.0

Installation Instructions

composer config repositories.catalogimagesclean git git@github.com:natedawg92/CatalogImagesClean.git
composer require nathanday/module-catalog-images-clean
php bin/magento module:enable NathanDay_CatalogImagesClean
php bin/magento setup:upgrade

Uninstallation

php bin/magento module:uninstall NathanDay_CatalogImagesClean

Usage

Info Command

php bin/magento catalog:images:info             
Description:
  Information about Unused and/or Missing Images

Usage:
  catalog:images:info [options]

Options:
  -u, --unused          Info on unused product images
  -m, --missing         Info on missing product images
  -t, --duplicate       Info on duplicate product images
  -d, --database        Info on Product images in the Database
  -p, --physical        Info on Product images in the filesystem
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

For Details of Unused, Missing and Duplicated images you do not need to specify any particular flag, if you want information on one or more, specify which flag you require

Sample Output


======================================
Catalog Product Image Information
======================================
53 Unique Images in Database
802 Images in Filesystem
0 Missing Images
749 Unused Images
78 Duplicate Images

for more detailed information add -v to the command and this will print out detailed information specific for each type.

  • in the case of missing images the verbose flag will print a list of files and how many times that file appears in the gallery records.
  • in the case of unused images this will print out a list of images that are present in the filesystem but not in the database
  • in the case of duplicated date, this will print a list of images and what they are a duplicate of

Clean Command

php bin/magento catalog:images:clean

Description:
  Clean Catalog Images, Delete Unused Images in the Filesystem and/or Remove records in the Database for Missing Images

Usage:
  catalog:images:clean [options]

Options:
  -u, --unused          Delete unused product images
  -m, --missing         Remove missing product image Records
  -t, --duplicate       Remove duplicate product images and update database Records
  -d, --dry-run         Dry Run, don't make any changes
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug```

Important: Before utilising this command it is recommended to take a Database and Media Backup.

The clean command will process through all actions to clean up your catalog image files and database records. As with the info command you can specify an individual subset of images to clean e.g. --missing will only action the clean command for missing images.

you can specify the --dry-run flag which will print out what actions would be taken.

The verbose flag -v can also be added to the command to print a list of the Images or database records that will be updated.

When using this command without the --dry-run flag you will shown a recommendation to make an appropriate backup before proceeding at which point you will be asked to confirm you want to proceed.

after this point the command will proceed to Update your database to remove any instances of missing image records and/or Delete files from the media directory that are not associated with any product, depending on your choice of which subsets to clean.

Support

If you have any issues with this extension, open an issue on GitHub.

Contribution

Any contribution is highly appreciated. The best way to contribute code is to open a pull request on GitHub.

Developer

Nathan Day

Licence

OSL - Open Software Licence 3.0

Copyright

(c) 2020 Nathan Day

nathanday/module-catalog-images-clean 适用场景与选型建议

nathanday/module-catalog-images-clean 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 24k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2022 年 01 月 10 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 nathanday/module-catalog-images-clean 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 nathanday/module-catalog-images-clean 我们能提供哪些服务?
定制开发 / 二次开发

基于 nathanday/module-catalog-images-clean 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2022-01-10