mothership/mothership_magerun

Mothership Magerun 扩展程序,用于 Magento

安装: 356

依赖项: 0

建议者: 0

安全: 0

星标: 4

关注者: 7

分支: 2

开放问题: 6

类型:magento-module

v1.3.11 2017-09-12 16:46 UTC

README

#Mothership Magerun 扩展程序

Dependency Status Latest Stable Version Total Downloads Latest Unstable Version License

========================= 本仓库包含了一系列扩展程序列表,这些扩展程序可能对你的开发工作流程非常有用。

安装

目前有三种不同的方式来包含 magerun-components。我将描述每种方法。请查阅官方 文档 了解更多信息。在我看来,首选的方法应该是 composer 方式。

方法 1 - 最简单的方法

此方法需要你有一个主目录,所有自定义模块都位于该目录。

  • 执行以下代码片段
mkdir -p ~/.n98-magerun/modules/
  • 克隆仓库或创建符号链接。我更喜欢使用符号链接方式,因为所有我的仓库都在一个地方检出,但这完全取决于你。以下示例将直接克隆目录。
cd ~/.n98-magerun/modules/
git clone https://github.com/mothership-gmbh/magerun_mothership.git

方法 2 - 仍然很简单,但更适用于特定环境

虽然有一种方法可以将所有模块集中在一起,但我更喜欢具有特定环境模块。

  • 要实现这一点,你只需要在您的 Magento 项目文件夹中创建一个文件夹。
// replace MAGENTO_ROOT with your directory
mkdir -p MAGENTO_ROOT/lib/n98-magerun/modules

下一步与之前相同。只需克隆和/或创建符号链接到仓库。

cd MAGENTO_ROOT/lib/n98-magerun/modules
git clone https://github.com/mothership-gmbh/magerun_mothership.git

方法 3 - composer.json

只需将此 require 添加到您的 composer.json。请自行检查最新标签版本。

"require": 
{
	"mothership/mothership_magerun":"<latest_tagged_version>"
}

命令

mothership:environment:dump

从匹配给定正则表达式的 core_config_data 表中导出所有设置。依赖于配置文件。

mothership:env:dump --

阅读更多...

mothership:environment:import

通过覆盖现有配置来导入配置设置。有一个示例文件 settings.example.php。只需将文件复制为 settings.php 并根据您的需求自定义设置。

  • 文件结构

您需要在 Mothership\Environment\resource 目录中拥有一些文件。它们的名称应类似于 environment_anyname。如果有多个文件,请根据您的环境命名。请定义一个文件作为回退。

阅读更多...

mothership:images:create-dummy

此命令将为 catalog_product_entity_media_gallery 表中的每个条目创建一个图像文件。请确保您的 media 目录中有一个名为 dummy.jpg 的文件。这在你必须处理大量产品数据但不想下载一个巨大的目录时非常有用。

为了更多乐趣,使用官方 Mothership 图像。

Logo

mothership:images:resize

这是一个方便的命令,用于最小化基础图像。这将创建一个以 --dir 参数命名的目录,并创建所有现有图像的较小版本。请注意,如果您有与相同名称的新图像文件,此命令将不会识别它。在这种情况下,请从调整大小的图像目录中删除现有文件,然后重新运行命令。

magerun typehype:images:resize --dir=thumbnails --size=100

mothership:reports:observerstimes

这是一个 magerun 命令,用于创建一个 csv 报告,以找到在浏览器导航过程中调用的每个 Magento 页面的事件和相关的观察者。

更多文档

magerun mothership:reports:observerstimes

mothership:workflow:render

超级酷的图表生成器!除了运行我们的状态机外,您还可以渲染它们以方便调试。

图表创建依赖于graphviz,因此请确保您已安装它,以便运行dot命令。在Debian环境中,请使用apt-get install graphviz

magerun mothership:workflow:render --config=Demo.yaml

创建的图表将类似于这样。请检查源文件

Logo

是的,您可以直接像图表中显示的那样运行此工作流程。请检查下一条命令。

mothership:workflow:run

从目录<root>/app/etc/mothership/workflows运行工作流程。此功能非常强大,在许多复杂场景中使用。它基本上依赖于Mothership状态机,并是在Magento环境中运行有限状态机的辅助工具。

magerun mothership:workflow:run --config=yourworkflow.yaml
magerun mothership:workflow:run --config=yourworkflow.yaml --help
magerun mothership:workflow:run --config=yourworkflow.yaml --interactive
magerun mothership:workflow:run --config=yourworkflow.yaml --queue

除了纯PHP状态机实现之外,此命令还具有以下功能

  • 解析工作流程定义文件中的新节点。
  • 交互模式:每个选项都可以通过对话框设置。
  • 队列:使用php-resque队列在后台运行工作流程。

更多文档