Download the PHP package sirian/yandex-market-language-parser without Composer
On this page you can find all versions of the php package sirian/yandex-market-language-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sirian/yandex-market-language-parser
More information about sirian/yandex-market-language-parser
Files in sirian/yandex-market-language-parser
Package yandex-market-language-parser
Short Description Yandex Market Language parser
License
Informations about the package yandex-market-language-parser
Yandex Market Language Parser
Streaming parser for Yandex Market Language (YML) feeds.
Uses XMLReader for the outer scan and SimpleXMLElement for per-offer parsing, so the whole catalog is never loaded in memory — offers arrive as a Generator.
Requirements
- PHP >= 8.3
- Extensions:
ext-mbstring,ext-simplexml,ext-xmlreader,ext-libxml
Installation
Usage
Offer types
Sirian\YMLParser\Factory\Factory::createOffer() returns:
type attribute |
class |
|---|---|
vendor.model |
Sirian\YMLParser\Model\Offer\VendorModelOffer |
book |
Sirian\YMLParser\Model\Offer\BookOffer |
| anything else | Sirian\YMLParser\Model\Offer\Offer |
| absent | Sirian\YMLParser\Model\Offer\VendorModelOffer (default) |
Customization
Provide a custom FactoryInterface to swap any model/storage implementation:
Extending offer field mapping
Offer::applyField(string $field, string $value): bool maps XML child elements onto setters. Override it in your own offer subclass to handle YML fields beyond the built-in ones:
Any field can also be accessed via the raw XML — $offer->getXml() / $shop->getXml().
Development
License
MIT
All versions of yandex-market-language-parser with dependencies
ext-mbstring Version *
ext-simplexml Version *
ext-xmlreader Version *
ext-libxml Version *