do-it-well/magento2-module-cms-command
Composer 安装命令:
composer require do-it-well/magento2-module-cms-command
包简介
CMS import/export commands for Magento2
README 文档
README
A Magento2 Module providing CMS-related command-line tools.
Installation
This module can be installed via composer and the Magento2 command-line tool. For example:
composer require do-it-well/magento2-module-cms-command
./bin/magento module:enable DIW_CmsCommand
./bin/magento setup:upgrade
Commands
- cms:block:list list available CMS block IDs
- cms:block:dump dump (as JSON) either all CMS block data, or (if
specified) the CMS block data of a specific
block_id - cms:block:load load (from a JSON object, or array of JSON objects), CMS block data
- cms:page:list list available CMS page IDs
- cms:page:dump dump (as JSON) either all CMS page data, or (if
specified) the CMS page data of a specific
page_id - cms:page:load load (from a JSON object, or array of JSON objects), CMS page data
What It Does
The cms:*:dump commands dump either a single model, or each of a collection of
models, and directly output the result of $model->getData() as a JSON object
to STDOUT.
The cms:*:load commands read a JSON object (or each object from a JSON array
of objects). If a relevant *_id attribute is set within the JSON object, that
object is loaded; otherwise, an empty model is created. In either case, the
decoded JSON object is passed to $model->setData() directly, and the model is
saved. ie: if the *_id field is not set, a new page/block will be created.
As should be obvious, this method of dumping / loading CMS data is very basic, and there are many situations in which these methods would not be appropriate or safe. No guarantees are made. You should perform both dumps and loads only with a complete understanding of the limitations of this implementation.
Examples
You can dump a specific page or block as a single json object to STDOUT, by identifier
$ bin/magento cms:page:dump home
{"page_id":"2","title":"My eCommerce Site","page_layout":...
...or by numeric id
$ bin/magento cms:page:dump 2
{"page_id":"2","title":"My eCommerce Site","page_layout":...
You can also dump all pages / blocks, as a json array of json objects, by omitting the id/identifier
$ bin/magento cms:page:dump
[
{"page_id":"1","title":"404 Not Found","page_layout":...},
{"page_id":"2","title":"My eCommerce Site","page_layout":...},
...
The same format can also be used to re-import a dumped page or block
$ bin/magento cms:page:dump home > home.json
... edit home.json ...
$ bin/magento cms:page:load < home.json
...or a list of multiple pages or blocks
$ bin/magento cms:page:dump > pages.json
... edit pages.json ...
$ bin/magento cms:page:load < pages.json
License
All module code within this repository is licensed under the MIT license. See the MIT-LICENSE.txt file for details.
Support
If you encounter any problems with this module, you may open an issue on GitHub at https://github.com/do-it-well/magento2-module-cms/issues
Premium support, assistance in module installation or configuration, or other development services, can be obtained by contacting Do It Well Limited
do-it-well/magento2-module-cms-command 适用场景与选型建议
do-it-well/magento2-module-cms-command 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18.62k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 08 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 do-it-well/magento2-module-cms-command 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 do-it-well/magento2-module-cms-command 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 18.62k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-08-15