开源项目 `importexportfree` 使用教程

开源项目 importexportfree 使用教程

importexportfreeImprove default Magento 2 Import / Export features - cron jobs, CSV , XML , JSON , Excel , mapping of any format, Google Sheet, data and price modification, improved speed and a lot more!项目地址:https://gitcode.com/gh_mirrors/im/importexportfree

1. 项目的目录结构及介绍

importexportfree 项目的目录结构如下:

importexportfree/
├── composer.json
├── README.md
├── etc/
│   ├── module.xml
│   ├── di.xml
│   ├── events.xml
│   └── ...
├── Model/
│   ├── Import/
│   │   ├── Adapter/
│   │   └── ...
│   └── ...
├── Setup/
│   ├── UpgradeSchema.php
│   └── ...
├── view/
│   ├── adminhtml/
│   │   ├── layout/
│   │   └── ...
│   └── ...
└── ...

目录介绍:

  • composer.json: 项目的依赖管理文件。
  • README.md: 项目说明文档。
  • etc/: 包含项目的配置文件。
    • module.xml: 定义模块的基本信息。
    • di.xml: 依赖注入配置文件。
    • events.xml: 事件配置文件。
  • Model/: 包含项目的业务逻辑模型。
    • Import/: 导入相关的模型。
  • Setup/: 数据库安装和升级脚本。
    • UpgradeSchema.php: 数据库升级脚本。
  • view/: 视图文件。
    • adminhtml/: 后台视图文件。

2. 项目的启动文件介绍

项目的启动文件主要是 composer.json,它负责管理项目的依赖和自动加载。

{
    "name": "firebearstudio/importexportfree",
    "description": "Improve default Magento 2 Import / Export features",
    "type": "magento2-module",
    "version": "1.0.0",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "require": {
        "php": "~7.1.3||~7.2.0||~7.3.0",
        "magento/framework": "102.0.*",
        "magento/module-import-export": "100.3.*"
    },
    "autoload": {
        "psr-4": {
            "Firebear\\ImportExportFree\\": ""
        },
        "files": [
            "registration.php"
        ]
    }
}

启动文件介绍:

  • name: 项目名称。
  • description: 项目描述。
  • type: 项目类型。
  • version: 项目版本。
  • license: 项目许可证。
  • require: 项目依赖。
  • autoload: 自动加载配置。

3. 项目的配置文件介绍

项目的配置文件主要位于 etc/ 目录下,包括 module.xml, di.xml, events.xml 等。

module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Firebear_ImportExportFree" setup_version="1.0.0"/>
</config>

di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\ImportExport\Model\Import\Adapter" type="Firebear\ImportExportFree\Model\Import\Adapter"/>
</config>

events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="controller_action_predispatch">
        <observer name="firebear_importexportfree_predispatch" instance="Firebear\ImportExportFree\Observer\Predispatch"/>
    </event>
</config>

配置文件介绍:

  • module.xml: 定义模块的基本信息和版本。
  • di.xml: 配置依赖注入。
  • events.xml: 配置事件监听。

以上是 importexportfree 项目的基本使用教程,涵盖了项目的目录结构、启动文件和配置文件的介绍。希望对您有所帮助!

importexportfreeImprove default Magento 2 Import / Export features - cron jobs, CSV , XML , JSON , Excel , mapping of any format, Google Sheet, data and price modification, improved speed and a lot more!项目地址:https://gitcode.com/gh_mirrors/im/importexportfree

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

侯宜伶Ernestine

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值