PHPackages                             snono/stream-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. snono/stream-parser

ActiveNo[Parsing &amp; Serialization](/categories/parsing)

snono/stream-parser
===================

convert xml,json,csv contant to array

03PHP

Since Nov 19Pushed 6y ago1 watchersCompare

[ Source](https://github.com/yasergh/StreamParser)[ Packagist](https://packagist.org/packages/snono/stream-parser)[ RSS](/packages/snono-stream-parser/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![](https://camo.githubusercontent.com/97b5803421d3fe4307917cb5ab71bb9ad8ea9b32346d92cf52bf68c697d15478/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f6474666276766b79702f696d6167652f75706c6f61642f76313536363333313337372f6c61726176656c2d6c6f676f6c6f636b75702d636d796b2d7265642e737667)](https://snono-systems.com)

[![Build Status](https://camo.githubusercontent.com/e80182419f53d99362bd0e77a03a1e313386ab4ffe21b3755acb37fa999482c2/68747470733a2f2f7472617669732d63692e6f72672f736e6f6e6f2f73747265616d2d7061727365722e737667)](https://travis-ci.org/snono/stream-parser)[![Total Downloads](https://camo.githubusercontent.com/a48ccca13d6ac5fd5126b37d03c55f43b089cb5b4fc1e548f826ad6cdc939337/68747470733a2f2f706f7365722e707567782e6f72672f736e6f6e6f2f73747265616d2d7061727365722f642f746f74616c2e737667)](https://packagist.org/packages/snono/stream-parser)[![Latest Stable Version](https://camo.githubusercontent.com/babeeedfaeb5dc9bd63ebc03e0ff333eab6f236740a1a3a6254aafedd7504a62/68747470733a2f2f706f7365722e707567782e6f72672f736e6f6e6f2f73747265616d2d7061727365722f762f737461626c652e737667)](https://packagist.org/packages/snono/stream-parser)[![License](https://camo.githubusercontent.com/69fe21592b0c62ad752eb475271fead6dd24af1d2da6d949390ef4e14032c5db/68747470733a2f2f706f7365722e707567782e6f72672f736e6f6e6f2f73747265616d2d7061727365722f6c6963656e73652e737667)](https://packagist.org/packages/snono/stream-parser)

Stream Parser For Laravel Framework
-----------------------------------

[](#stream-parser-for-laravel-framework)

> **Note:** This repository contains the core code of convert XML file to array.

Installation
------------

[](#installation)

```
composer require snono/stream-parser

```

Recommended usage
-----------------

[](#recommended-usage)

Delegate as possible the callback execution so it doesn't blocks the document reading:

Practical Input/Code/Output demos
---------------------------------

[](#practical-inputcodeoutput-demos)

### XML

[](#xml)

```

        31774
        Giliola Mor Pembe Detaylı Çocuk Spor Ayakkabı]]>

        Giliola Mor Pembe Detaylı Çocuk Spor Ayakkabı
        ANT-CCK-CSP-133124
        3177431774317
        40.00
        40.00
        True

                ...
                ...
                3031774317743
                ...
                ...

                1782578
                ANT-CCK-CSP-133124
                3331774317743
                0

                        Çocuk Numara
                        33

                https://www.xmlcim.com/image/catalog/erbilden/Y5Lnj9L9HVD15ciAS1r2xkSAospZcG3Qmk1fY.jpg

                https://www.xmlcim.com/image/catalog/erbilden/FOnQWf6dPYqTDSDqhMcUhwSIIHoI57oolYj1V.jpg

                288
                Çocuk Spor
                ...

                7
                Erbilden]]>

```

```
    use Snono\StreamParser\XMLParser;

    $objXML = new XMLParser();
    $arr =  $objXML->setUrl('http://localhost/product.xml')
                   ->xmlParser()
                   ->mapping(
                        array(
                                'Products' => array(
                                    'Product' => array(
                                                'id_product' => 'ProductId',
                                                'sku' => 'SKU',
                                                'qty' => 'StockQuantity',
                                                'title' => 'MetaTitle',
                                                'images' => 'Pictures.Picture.PictureUrl',
                                                'category' => 'Categories.Category.CategoryId:Name:CategoryPath',
                                                'manufacturer' => 'Manufacturers.Manufacturer',
                                                'productCombinations' => 'ProductCombinations.ProductCombination.StockQuantity:SKU:ProductCombinationId:ProductAttributes',
                                    )
                                )
                            )
                        )
                   ->toArray();
```

```
[
  {
    "id_product": "31774",
    "sku": "ANT-CCK-CSP-133124",
    "qty": "7",
    "title": "Giliola Mor Pembe Detaylı Çocuk Spor Ayakkabı",
    "images": [
      {
        "PictureUrl": "https://www.xmlcim.com/image/catalog/erbilden/Y5Lnj9L9HVD15ciAS1r2xkSAospZcG3Qmk1fY.jpg"
      },
      {
        "PictureUrl": "https://www.xmlcim.com/image/catalog/erbilden/FOnQWf6dPYqTDSDqhMcUhwSIIHoI57oolYj1V.jpg"
      },
      {
        "PictureUrl": "https://www.xmlcim.com/image/catalog/erbilden/4JYDn1jVXJdLHaUaQ11QyX0rQjLOHk4seRfF3.jpg"
      },
      {
        "PictureUrl": "https://www.xmlcim.com/image/catalog/erbilden/k6oVbvFRlxd3SdQCCcZLovODTi4V5xkZutrzj.jpg"
      }
    ],
    "category": {
      "CategoryId": "288",
      "Name": "Çocuk Spor",
      "CategoryPath": "Çocuk Ayakkabı &gt;&gt; Çocuk Spor"
    },
    "manufacturer": {
      "Id": "7",
      "Name": "Erbilden"
    },
    "productCombinations": [
      {
        "ProductCombinationId": "1782575",
        "SKU": "ANT-CCK-CSP-133124",
        "Gtin": "3031774317743",
        "StockQuantity": "1",
        "ProductAttributes": {
          "ProductAttribute": {
            "Name": "Çocuk Numara",
            "Value": "30"
          }
        }
      }
    ]
  },
  {
    "id_product": "31763",
    "sku": "ANT-CCK-CSP-133113",
    "qty": "7",
    "title": "Giliola Mor Çocuk Spor Ayakkabı ",
    "images": [
      {
        "PictureUrl": "https://www.xmlcim.com/image/catalog/erbilden/xvspaJFco5uFRGJtjf3LG6wtVCWtQVYsENuBy.jpg"
      },
      {
        "PictureUrl": "https://www.xmlcim.com/image/catalog/erbilden/UfLqiVkJi6XzuBEdgGfZuxtfuHcLSJhlsgN3U.jpg"
      },
      {
        "PictureUrl": "https://www.xmlcim.com/image/catalog/erbilden/vR0fTLvE69rmScPQQ062z0kxp8oQzNMyHVUtG.jpg"
      },
      {
        "PictureUrl": "https://www.xmlcim.com/image/catalog/erbilden/T5tphhfeCTYvFc5NzWVqHDB8XVRXJkWOYTOIw.jpg"
      }
    ],
    "category": {
      "CategoryId": "288",
      "Name": "Çocuk Spor",
      "CategoryPath": "Çocuk Ayakkabı &gt;&gt; Çocuk Spor"
    },
    "manufacturer": {
      "Id": "7",
      "Name": "Erbilden"
    },
    "productCombinations": [
      {
        "ProductCombinationId": "1782515",
        "SKU": "ANT-CCK-CSP-133113",
        "Gtin": "2631763317633",
        "StockQuantity": "1",
        "ProductAttributes": {
          "ProductAttribute": {
            "Name": "Çocuk Numara",
            "Value": "26"
          }
        }
      }
    ]
  }
]

```

### Data Source two type

[](#data-source-two-type)

From URL link use code

```
    $objXML->setUrl('http://localhost/product.xml');
```

Or load data from local file

```
    $objXML->setFileName('./tmp/product.xml');
```

### Return all data without mapping

[](#return-all-data-without-mapping)

```
    $arr = $objXML->getContent();
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3448788?v=4)[Yaser](/maintainers/yasergh)[@yasergh](https://github.com/yasergh)

---

Top Contributors

[![yasergh](https://avatars.githubusercontent.com/u/3448788?v=4)](https://github.com/yasergh "yasergh (3 commits)")

### Embed Badge

![Health badge](/badges/snono-stream-parser/health.svg)

```
[![Health](https://phpackages.com/badges/snono-stream-parser/health.svg)](https://phpackages.com/packages/snono-stream-parser)
```

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
