定制 arsengoian/commerce-ml 二次开发

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

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

arsengoian/commerce-ml

Composer 安装命令:

composer require arsengoian/commerce-ml

包简介

Easy-peasy CommerceML 2.10 PHP library

README 文档

README

Simple and requirements-free SimpleXML-based CommerceML parser and builder.

Features

Usage:

 composer require arsengoian/commerce-ml

Parse CommerceML:

use CommerceML\Client;
/**
 * @var string $input
 */
$commercialInformation = Client::toCommerceML($input);

Build CommerceML string from CommerceML object:

use CommerceML\Client;
/**
 * @var CommerceML\Implementation\CommercialInformation $commercialInformation
 */
$output = Client::toString($commercialInformation);

Namespaces:

  • CommerceML\Nodes - abstract classes representing nodes. May have a custom implementation, including database storage
  • CommerceML\Implementation - simplest implementations storing variables in protected fields. This implementation will be returned while parsing. Nodes collecting arrays also implement ArrayAccess, IteratorAggregate and Countable.
  • CommerceML\Constructors - implementations with constructors, extend those from CommerceML\Implementation. Use these while building a custom CommerceML tree.

Advanced:

To use custom classes while parsing, before calling Client::toString(), do:

use CommerceML\Node\Node

Node::overrideImplementations([
    ProductCustomImplementation::class, // Must inherit from CommerceML\Implementations\Product
]);

Contributions

Current implementation of the library doesn't cover all possible CommerceML nodes. E.g. product import nodes aren't covered.

Also complete test coverage would be welcomed.

统计信息

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

GitHub 信息

  • Stars: 10
  • Watchers: 2
  • Forks: 14
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2018-11-25