定制 simpsons/composermode 二次开发

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

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

simpsons/composermode

Composer 安装命令:

composer require simpsons/composermode

包简介

A custom module for Magento 2

README 文档

README

Introduction

This guide provides steps to create a simple module, install it via Composer in a third-party or your own Magento 2 project, and upload the package to Packagist.org while connecting it with GitHub.

Creating a Simple Module

  1. Create Module Structure

    • Create the necessary directories and files for your Magento 2 module.
  2. Define composer.json

    • Create a composer.json file in the root directory of your module with the following content:
      {
        "name": "simpsons/composermode",
        "description": "A simple Magento 2 module",
        "require": {
          "php": "^8.1"
        },
        "type": "magento2-module",
        "version": "1.0.0",
        "autoload": {
          "files": [
            "registration.php"
          ],
          "psr-4": {
            "Simpsons\\ComposerModule\\": ""
          }
        }
      }
  3. Create Module Files

    • Create registration.php and module.xml files as required by Magento 2.

Installing the Module via Composer

  1. Install the Module
    • Use the following command to install the module:
      composer require simpsons/composermode dev-main

Requirements

  • PHP 8.1 is required for compatibility.

Uploading Your Package to Packagist.org

  1. Create an Account on Packagist.org

    • Visit Packagist.org and sign up for a new account.
    • Verify your email address to activate the account.
  2. Submit Your Package

    • Once logged in, click on "Submit" in the top menu.
    • Enter the URL of your GitHub repository and click "Check".
    • After validation, submit your package.

Connecting GitHub with Packagist

  1. Link Your GitHub Account

    • Go to your Packagist profile and click on "Settings".
    • Click "Link GitHub account" and follow the instructions to authorize Packagist to access your GitHub repositories.
  2. Automate Package Updates

    • In your GitHub repository, navigate to "Settings" > "Webhooks".
    • Add a new webhook with the following details:
      • Payload URL: https://packagist.org/api/github
      • Content type: application/json
      • Events: Select "Just the push event".
    • Save the webhook.

Summary

Following the steps above, you can create a simple Magento 2 module, install it using Composer, and manage your package on Packagist.org. Ensure your module meets the PHP 8.1 requirement for compatibility.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2024-06-06