sitewards/setup

Sitewards Setup

v2.0.1 2017-02-10 13:43 UTC

This package is not auto-updated.

Last update: 2024-09-14 20:30:31 UTC


README

Build Status Scrutinizer Code Quality

这是一个模块,允许开发人员通过命令行导入和导出内容以及配置,只要为该框架已构建了桥接模块。

架构

我们的通用Setup模块的服务层实现了以下功能

  1. src/Sitewards/Setup/Service/Page/ExporterInterface.php 的实现
  • 它利用了PageRepository来获取请求的页面。然后我们将内容序列化并输出到文件中。
  1. src/Sitewards/Setup/Service/Page/ImporterInterface.php 的实现
  • 它利用了PageRepository来尝试存储给定的页面,在反序列化从pages.json文件中找到的内容后。

每个桥接模块需要以下内容

  1. src/Sitewards/Setup/Application/BridgeInterface.php 的实现
  • 目前唯一需要的方法是getPageRepository(),它作为一个工厂方法。该方法应返回你的PageRepositoryInterface实现。虽然不是必需的,但我们强烈建议你在此时启动使用的系统。请查看Magento1和Magento2桥接中的initMagento()方法,以查看其实际示例。
  1. src/Sitewards/Setup/Domain/Page/PageRepositoryInterface.php 的实现
  • 这个实现的目的是为Setup模块提供一个与底层系统通信的方式。使用findByIdsfindAll方法来获取页面,无论它们来自哪里(数据库、文件系统等)。使用import方法将页面存储到系统中。
  1. bin/setup 的实现
  • 该文件作为桥接模块的引导点,您只需实例化应用程序,并用您自己的Sitewards\Setup\Application\BridgeInterface实现来填充它。

桥接

要构建桥接,您需要使用接口src/Sitewards/Setup/Domain/Page/PageRepositoryInterface.php,并为您的系统创建此接口的实现。

当前桥接

  1. Magento 1 (https://github.com/sitewards/setup-mage1)
  2. Magento 2 (https://github.com/sitewards/setup-mage2)

问题

要了解有关问题的信息,请点击这里。要打开问题,请点击这里

作者