sitebill/ymlparser
最新稳定版本:1.0.1
Composer 安装命令:
composer require sitebill/ymlparser
包简介
YML (Yandex Market Language) parser
README 文档
README
About
YML (Yandex Market Language) streaming parser with validation. Based on XMLReader. Suitable for large files.
Install
Add the "sitebill/ymlparser": "^1.0" package to your require section in the composer.json file
or
$ php composer.phar require sitebill/ymlparser
Usage
use LireinCore\YMLParser\YML; $yml = new YML(); try { $yml->parse($filepath); $date = $yml->getDate(); $shop = $yml->getShop(); if ($shop->isValid()) { $offersCount = $shop->getOffersCount(); $shopData = $shop->getData(); //... foreach ($yml->getOffers() as $offer) { if ($offer->isValid()) { $offerCategoryHierarchy = $shop->getCategoryHierarchy($offer->getCategoryId()); $offerData = $offer->getData(); //... } else { var_dump($offer->getErrors()); //... } } } else { var_dump($shop->getErrors()); //... } } catch (\Exception $e) { echo $e->getMessage(); //... }
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-02-08