PHPackages                             tcgunel/xml-aligner - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tcgunel/xml-aligner

AbandonedLibrary[Utility &amp; Helpers](/categories/utility)

tcgunel/xml-aligner
===================

Converts small/large xml files by the data structure of given array with minimum memory consumption.

v1.1.0(4y ago)057MITPHPPHP ^7.3|^8.0

Since Mar 19Pushed 4y ago1 watchersCompare

[ Source](https://github.com/tcgunel/xml-aligner)[ Packagist](https://packagist.org/packages/tcgunel/xml-aligner)[ RSS](/packages/tcgunel-xml-aligner/feed)WikiDiscussions main Synced 2mo ago

READMEChangelogDependencies (4)Versions (9)Used By (0)

[![License](https://camo.githubusercontent.com/8e171ea180b763cb2d72951b1d871b64d26249a712f0fac7abd52f9f8818898a/68747470733a2f2f706f7365722e707567782e6f72672f746367756e656c2f6e657467736d2f6c6963656e7365)](https://packagist.org/packages/tcgunel/netgsm)[![Buy us a tree](https://camo.githubusercontent.com/130148911f548b001b2ac68a32c0a06559977ca60ada3bf480c72ae4ea093175/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54726565776172652d2546302539462538432542332d6c69676874677265656e)](https://plant.treeware.earth/tcgunel/netgsm)[![PHP Composer](https://github.com/tcgunel/xml-aligner/actions/workflows/tests.yml/badge.svg)](https://github.com/tcgunel/xml-aligner/actions/workflows/tests.yml)

Xml aligner
===========

[](#xml-aligner)

Converts small/large xml files by the data structure of given array with minimum memory consumption

Only tags and their contents are being processed. Attributes will be ignored.

Uses XMLWriter, XMLReader, fopen for memory efficiency. SimpleXML for parsing small parts of XML tags.

Requirements
------------

[](#requirements)

PHPPackage^7.3-^8.0v1.0.0Kurulum
-------

[](#kurulum)

1. Download package with composer:

```
composer require TCGunel/xml-aligner

```

Example Usage
=============

[](#example-usage)

**1:n Gönderim**

```
// Each key represents xml tag from source xml file, except "xmlNode" and "values",
// Each value represents correspondent output xml tag,
$format = [
    "urun" => [ // Each  tag,
        "xmlNode" => "item", // Gets converted to  tag,
        "values"  => [ // Has these children,
            "kategori" => "categoryTree",
            "urunadi"  => "name",
            "urunid"   => "code",
            "detay"    => "description",
            "resimler" => [ // Child with children,
                "xmlNode" => "pictures",
                "values"  => [
                    "resim" => "picture[]", // If name has [] in it, then this tag is a repeater.
                ],
            ],
        ],
    ],
];

// Initiate class.
$instance = new XmlAligner();

// Source file.
$xml_file    = __DIR__ . '/../../storage/public/test.xml';

// Target Path.
$output_path = __DIR__ . '/../../storage/public/outputs/';

$result = $instance
    ->setDataStructure($format)
    ->setValidXmlFilePath($xml_file)
    ->setOutputPath($output_path)
    ->convert();

// Contains filename created with sha1 hash of the source file.
// Example: 20b5918bb61909f47c4ab14b44aecc9fd093fe43.xml
$instance->getOutputFileName()

```

Test
----

[](#test)

```
composer test

```

For windows:

```
vendor\bin\paratest.bat

```

Authors
-------

[](#authors)

- [**Tolga Can GÜNEL**](https://github.com/tcgunel) - *Altyapı ve proje başlangıcı*

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

Treeware
--------

[](#treeware)

This package is [Treeware](https://treeware.earth). If you use it in production, then we ask that you [**buy the world a tree**](https://plant.treeware.earth/tcgunel/netgsm) to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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.

###  Release Activity

Cadence

Every ~38 days

Recently: every ~66 days

Total

8

Last Release

1613d ago

PHP version history (2 changes)v1.0.0PHP ^7.2

v1.0.6PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/36dffe883e88aeef07c26067af3d6a7eda1c2a81f1ae45fdd430b721665131da?d=identicon)[Mobius Studio](/maintainers/Mobius%20Studio)

---

Top Contributors

[![tcgunel](https://avatars.githubusercontent.com/u/3923425?v=4)](https://github.com/tcgunel "tcgunel (6 commits)")[![tolgaCTRLF5](https://avatars.githubusercontent.com/u/33447585?v=4)](https://github.com/tolgaCTRLF5 "tolgaCTRLF5 (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tcgunel-xml-aligner/health.svg)

```
[![Health](https://phpackages.com/badges/tcgunel-xml-aligner/health.svg)](https://phpackages.com/packages/tcgunel-xml-aligner)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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