# Magento

**Magento** 是一个用 PHP 编写的开源电子商务平台，为在线零售商提供商品目录管理、结账、营销和多店铺功能。它于 2007 年由 Varien 公司首次发布，2018 年被 Adobe 收购，如今以两种主要形式存在：免费的 Magento 开源版和需授权的 Adobe Commerce。<sup>[1](https://delftswa.gitbooks.io/desosa-2017/content/magento/chapter.html)</sup><sup> • </sup><sup>[2](https://business.adobe.com/content/dam/dx/us/en/resources/reports/2019-guide-to-ecommerce-platforms/pdfs/2019-Guide-to-Ecommerce-Platforms.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 首次发布 | 2007 年发布 Beta 版；首个稳定版 1.0 于 2008 年 3 月 31 日发布，由 Varien 开发<sup>[1](https://delftswa.gitbooks.io/desosa-2017/content/magento/chapter.html)</sup> |
| Magento 2.0 | 2015 年 11 月由当时尚为独立公司的 Magento Commerce 发布<sup>[3](https://github.com/run-as-root/awesome-magento2/blob/master/README.md)</sup><sup> • </sup><sup>[1](https://delftswa.gitbooks.io/desosa-2017/content/magento/chapter.html)</sup> |
| Adobe 收购 | 2018 年 6 月完成，交易金额 16.8 亿美元；Magento Commerce 并入 Adobe Commerce<sup>[2](https://business.adobe.com/content/dam/dx/us/en/resources/reports/2019-guide-to-ecommerce-platforms/pdfs/2019-Guide-to-Ecommerce-Platforms.pdf)</sup><sup> • </sup><sup>[4](https://business.adobe.com/blog/the-latest/magento-is-now-part-of-adobe)</sup> |
| 许可证 | 开放软件许可证 3.0（OSL-3.0）与学术自由许可证 3.0（AFL-3.0）<sup>[5](https://github.com/magento/magento2/blob/2.4-develop/composer.json)</sup> |
| 语言与技术栈 | PHP 应用；2.4-develop 分支要求 PHP 8.4 或 8.5<sup>[5](https://github.com/magento/magento2/blob/2.4-develop/composer.json)</sup> |
| 规模 | 项目 wiki 称其为企业级平台，全球商户超过 10 万家<sup>[6](https://github.com/magento/magento2/wiki)</sup> |
| 当前支持 | Adobe 为每个版本提供自正式发布之日起三年的标准支持期<sup>[7](https://experienceleague.adobe.com/en/docs/commerce-operations/release/planning/lifecycle-policy?trk=article-ssr-frontend-pulse_little-text-block)</sup> |

## 历史

Magento 最初是洛杉矶公司 Varien 的一个项目，2007 年发布首个 Beta 版，2008 年 3 月 31 日发布 1.0 版。<sup>[1](https://delftswa.gitbooks.io/desosa-2017/content/magento/chapter.html)</sup> 2015 年，Magento Commerce 作为独立公司成立，并发布 Magento 2.0——这是一次重写，旨在改善用户体验、实现平台现代化。<sup>[1](https://delftswa.gitbooks.io/desosa-2017/content/magento/chapter.html)</sup> 社区方面的记述指出，2.x 版本起初推广艰难，原因在于其架构复杂，前端工具也显陈旧，如 KnockoutJS、RequireJS 和 [Zend Framework](https://www.edgepedia.org/zh/zend-framework) 1。<sup>[3](https://github.com/run-as-root/awesome-magento2/blob/master/README.md)</sup>

**Adobe 所有权。** Adobe 于 2018 年 6 月以 16.8 亿美元完成对 Magento Commerce 的收购，将电子商务技术纳入 Adobe Experience Cloud——此前该云平台涵盖内容、数据和营销，但不涉及交易。<sup>[2](https://business.adobe.com/content/dam/dx/us/en/resources/reports/2019-guide-to-ecommerce-platforms/pdfs/2019-Guide-to-Ecommerce-Platforms.pdf)</sup><sup> • </sup><sup>[4](https://business.adobe.com/blog/the-latest/magento-is-now-part-of-adobe)</sup> 需授权的产品更名为 Adobe Commerce，免费版本则继续以 Magento 开源版的形式存在。<sup>[8](https://business.adobe.com/products/commerce/magento.html)</sup>

## 架构

Magento 的架构围绕模块化与可扩展性构建。应用划分为核心组件和独立模块，每个模块负责单一功能，且模块之间采用松耦合设计：模块对其他模块的依赖必须显式声明，应避免循环依赖和未声明依赖，移除或禁用一个模块不会导致其他模块失效。<sup>[9](https://developer.adobe.com/commerce/php/architecture/modules/dependencies)</sup>

**服务契约与依赖注入。** 模块的公共 API 由服务契约定义，即置于模块 `/Api` 目录下的 PHP 接口，通常按仓储接口、管理接口和元数据接口来组织。<sup>[10](https://developer.adobe.com/commerce/php/architecture/layers/service)</sup> 框架实现了依赖注入：`ObjectManager` 服务类在引导阶段实例化对象，并注入构造函数签名中声明的依赖，具体实现则在模块的 `di.xml` 配置文件中映射。Adobe 称依赖注入取代了 Magento 1.x 中的全局 `Mage` 类。<sup>[11](https://developer.adobe.com/commerce/php/development/components/dependency-injection)</sup>

**扩展点。** 开发者通过多种机制定制行为：插件（又称拦截器），可在任意公共方法执行前、执行后或抛出异常时改变其行为；基于发布-订阅模式的事件与观察者，观察者实现 `ObserverInterface` 并在 `events.xml` 文件中配置；以及在 `di.xml` 中声明偏好，用自定义类替换服务契约的默认实现。<sup>[9](https://developer.adobe.com/commerce/php/architecture/modules/dependencies)</sup><sup> • </sup><sup>[12](https://developer.adobe.com/commerce/php/development/components/events-and-observers/)</sup><sup> • </sup><sup>[10](https://developer.adobe.com/commerce/php/architecture/layers/service)</sup>

**数据模型。** 平台采用实体-属性-值（EAV）数据库设计，商品和客户属性分散存储在多个 MySQL 表中，而非固定列。这使商户无需重新设计数据库即可添加属性，代价是查询更为复杂；Magento 开发者以 PHP 对象在 MySQL 数据存储之上实现了 EAV 系统。<sup>[1](https://delftswa.gitbooks.io/desosa-2017/content/magento/chapter.html)</sup>

## Web API 与无头电商

Adobe Commerce 和 Magento 开源版同时提供 REST 和 GraphQL API。REST 框架在 Adobe Commerce 云版、本地部署版和 Magento 开源版之间通用，支持面向第三方应用的 OAuth 1.0a、面向移动应用的令牌认证，以及管理员和客户的登录凭据。<sup>[13](https://developer.adobe.com/commerce/webapi/rest/)</sup> GraphQL 查询服务于商品列表、客户数据、购物车等店面场景，REST 端点则处理更多管理类任务；平台会根据字段、对象和节点数量，拒绝其认为过于复杂的查询。<sup>[14](https://developer.adobe.com/commerce/webapi/graphql/usage/)</sup> 每个模块都可以通过其 `etc` 目录下的 `schema.graphqls` 文件扩展 GraphQL 模式。<sup>[15](https://developer.adobe.com/commerce/webapi/graphql/develop/)</sup>

Adobe 还将部分店面功能迁移到托管的 SaaS 服务中。Catalog Service、Live Search 和 Product Recommendations 在独立的 Adobe 端点上公开各自的只读 GraphQL 模式，与核心 Commerce GraphQL 模式相区分——后者保留购物车、结账和客户操作的全部变更（mutation）。<sup>[16](https://developer.adobe.com/commerce/webapi/graphql/schema/storefront-services/)</sup>

## 版本与授权

代码库采用 OSL-3.0 和 AFL-3.0 双重许可。<sup>[5](https://github.com/magento/magento2/blob/2.4-develop/composer.json)</sup> Magento 开源版提供从零搭建店铺的基础电商能力，Adobe Commerce 则增加了优化的云架构与托管，以及 AI 驱动的商品营销与分析功能。<sup>[17](https://github.com/magento/magento2/blob/2.4-develop/README.md?plain=1)</sup> 公司账户、报价、公司管理等 B2B 功能仅在 Adobe Commerce 中提供，Magento 开源版没有。<sup>[18](https://experienceleague.adobe.com/docs/authoring-guide/assets/adobe_experience_cloud_guidelines.pdf?lang=en)</sup> 拖拽式内容创作工具 Page Builder 于 2021 年向 Magento 开源版商户开放。<sup>[19](https://business.adobe.com/blog/how-to/bringing-page-builder-content-authoring-magento-open-source-community)</sup>

Adobe 的生命周期政策为每个版本提供自正式发布起三年的标准支持期，涵盖质量修复、安全补丁和关键漏洞热修复；对于 2.4.6 和 2.4.7 版本，还免费额外提供一年延长支持。<sup>[7](https://experienceleague.adobe.com/en/docs/commerce-operations/release/planning/lifecycle-policy?trk=article-ssr-frontend-pulse_little-text-block)</sup> 2.4.9 版于 2026 年 5 月 12 日正式发布，支持 PHP 8.5、MariaDB 11.8 和 12.x 以及 OpenSearch 3.x，并停止支持 PHP 8.2 和 8.3。<sup>[20](https://experienceleague.adobe.com/en/docs/commerce-operations/release/notes/adobe-commerce/2-4-9?lang=en)</sup><sup> • </sup><sup>[7](https://experienceleague.adobe.com/en/docs/commerce-operations/release/planning/lifecycle-policy?trk=article-ssr-frontend-pulse_little-text-block)</sup>

## 安全

由于电商网站要处理支付数据，安全一直是反复出现的关切。[代尔夫特理工大学](https://www.edgepedia.org/zh/delft-university-of-technology) 2017 年的一份架构分析引用了 TrustWave《2016 年全球安全报告》，该报告发现当年被攻陷的电商系统中，Magento 安装实例占 85%，并将多数事件归因于服务器环境的薄弱而非应用本身；同一分析还指出，核心产品每年发现的漏洞相对较少。<sup>[1](https://delftswa.gitbooks.io/desosa-2017/content/magento/chapter.html)</sup>

近期，Adobe 修复了 [Web API](https://www.edgepedia.org/zh/web-api) 中 ServiceInputProcessor 组件的一个严重输入验证不当漏洞，编号 CVE-2025-54236，绰号 SessionReaper，严重性评分为 9.1（满分 10）。该漏洞可在无需用户交互的情况下导致会话被接管，修复补丁于 2025 年 9 月 9 日发布，影响版本包括 2.4.8-p2、2.4.7-p7 及更早版本。<sup>[21](https://www.techradar.com/pro/security/adobe-patches-most-severe-flaw-in-magento-ecommerce-platform)</sup> 平台的资源需求也影响部署方式：托管指南建议至少 2 GB 内存，多数店铺建议 4 GB 以上，技术栈为 Linux、Apache 或 Nginx、MySQL 和 PHP。<sup>[22](https://www.techradar.com/best/magento-hosting)</sup>

## 社区分支

开源社区已独立于 Adobe 组织起来。2021 年，担忧 Magento 开源版前景的社区领袖开始筹划；2022 年，Mage-OS 协会在波兰注册为非营利组织，并于 2023 年发布 Mage-OS 1.0 发行版、2025 年发布 Mage-OS 2.0——这是一个基于 Magento 开源版代码库的向后兼容发行版，带有性能改进和焕新的管理后台。<sup>[23](https://mage-os.org/about/)</sup> 另一个独立机构 Magento 协会称其使命是通过开放协作与教育推动全球 Magento 开源版社区的发展。<sup>[24](https://www.magentoassociation.org/who-we-are)</sup>

## References

1. [Magento: an e-commerce platform for growing your online business, Delft Students on Software Architecture (DESOSA) 2017](https://delftswa.gitbooks.io/desosa-2017/content/magento/chapter.html)
2. [2019 Guide to Ecommerce Platforms, Adobe](https://business.adobe.com/content/dam/dx/us/en/resources/reports/2019-guide-to-ecommerce-platforms/pdfs/2019-Guide-to-Ecommerce-Platforms.pdf)
3. [awesome-magento2 README, run-as-root on GitHub](https://github.com/run-as-root/awesome-magento2/blob/master/README.md)
4. [Magento Is Now Adobe Commerce, Adobe Blog (June 19, 2018)](https://business.adobe.com/blog/the-latest/magento-is-now-part-of-adobe)
5. [magento2 composer.json, 2.4-develop branch, GitHub](https://github.com/magento/magento2/blob/2.4-develop/composer.json)
6. [magento/magento2 Wiki, GitHub](https://github.com/magento/magento2/wiki)
7. [Software lifecycle policy, Adobe Commerce](https://experienceleague.adobe.com/en/docs/commerce-operations/release/planning/lifecycle-policy?trk=article-ssr-frontend-pulse_little-text-block)
8. [From Magento to Adobe Commerce, Adobe](https://business.adobe.com/products/commerce/magento.html)
9. [Module Dependencies, Commerce PHP Extensions, Adobe Developer](https://developer.adobe.com/commerce/php/architecture/modules/dependencies)
10. [Service Layer, Commerce PHP Extensions, Adobe Developer](https://developer.adobe.com/commerce/php/architecture/layers/service)
11. [Dependency Injection, Commerce PHP Extensions, Adobe Developer](https://developer.adobe.com/commerce/php/development/components/dependency-injection)
12. [Events and Observers, Commerce PHP Extensions, Adobe Developer](https://developer.adobe.com/commerce/php/development/components/events-and-observers/)
13. [REST API Overview, Adobe Developer](https://developer.adobe.com/commerce/webapi/rest/)
14. [Run GraphQL queries and mutations, Adobe Developer](https://developer.adobe.com/commerce/webapi/graphql/usage/)
15. [Define the GraphQL schema for a module, Adobe Developer](https://developer.adobe.com/commerce/webapi/graphql/develop/)
16. [Adobe Storefront Services GraphQL, Adobe Developer](https://developer.adobe.com/commerce/webapi/graphql/schema/storefront-services/)
17. [magento2 README.md, 2.4-develop branch, GitHub](https://github.com/magento/magento2/blob/2.4-develop/README.md?plain=1)
18. [Adobe Experience Cloud Guidelines](https://experienceleague.adobe.com/docs/authoring-guide/assets/adobe_experience_cloud_guidelines.pdf?lang=en)
19. [Bringing Page Builder Content Authoring to the Magento Open Source Community, Adobe Blog (2021)](https://business.adobe.com/blog/how-to/bringing-page-builder-content-authoring-magento-open-source-community)
20. [Adobe Commerce 2.4.9 release notes, Adobe Experience League](https://experienceleague.adobe.com/en/docs/commerce-operations/release/notes/adobe-commerce/2-4-9?lang=en)
21. [Adobe patches 'most severe' flaw in Magento eCommerce platform, TechRadar (September 2025)](https://www.techradar.com/pro/security/adobe-patches-most-severe-flaw-in-magento-ecommerce-platform)
22. [Best Magento hosting of 2025, TechRadar](https://www.techradar.com/best/magento-hosting)
23. [About the Mage-OS Association](https://mage-os.org/about/)
24. [Who We Are, Magento Association](https://www.magentoassociation.org/who-we-are)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 软件与编程 › Named software products and platforms › Web servers and content platforms

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/magento

English original: https://www.edgepedia.org/magento
