PHPackages                             topolis/yaml - 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. topolis/yaml

ActiveLibrary

topolis/yaml
============

Extension to the symfony yaml class

1.1.1(4y ago)0545MITPHPCI failing

Since Oct 4Pushed 4y agoCompare

[ Source](https://github.com/Topolis/Yaml)[ Packagist](https://packagist.org/packages/topolis/yaml)[ RSS](/packages/topolis-yaml/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Yaml
====

[](#yaml)

A small extension library for symfony yaml. This library adds custom commands to the yaml format, using symfony's TaggedValue classes.

Yaml Sample:

```
secure:
    message: !decrypt WaXEqRY+dgNjsC/75nAE5k2JlizY1GWRY1FuageWAFI=
environment:
    name: !env COMPUTERNAME
dates:
    current: !date now "Y-m-d H:i:s"
    formatted: !date now Y-m-d
    currentIso: !date now
imported:
    external: !import test/samples/test.yml
    custom-external: !import test/samples/test.json json

```

Usage:

```
$yaml = new Yaml();

$handler = new \Topolis\Yaml\Handler\Decrypt();
$handler->addKey("This is my key");
$yaml->addHandler($handler);

$handler = new \Topolis\Yaml\Handler\Date();
$yaml->addHandler($handler);

$handler = new \Topolis\Yaml\Handler\Import();
$handler->addParser('yaml2', [$yaml,'parse'], 'D:\\Webserver\www');
$yaml->addHandler($handler);

$parsed = $yaml->parse($data);

```

Date
----

[](#date)

Parameters can either be a string OR an array with {format: , value: } A string can either be a unix timestamp or a string parseable by PHP's strtotime function

Examples:

```
!date 1264322
!date '+1 day'
!date now 'Y-m-d'

```

Decrypt
-------

[](#decrypt)

Decrypt a encrypted variables in various formats. Supported format's can be determined with openssl\_get\_cipher\_methods(). The encrypted data consists of the data, prefixed be the IV and base64 encoded.

Add keys to use to the handler before use. You should never add the keys themselves to the Yaml file:

```
$handler = new Decrypt();
$handler->addKey("This is my key", "aes-256-cbc", "default"); // 2md & 3rd parameters are optional

```

You can AES-256-CBC encrypt with this sample php script:

```
$ivlen = openssl_cipher_iv_length("aes-256-cbc");
$iv = openssl_random_pseudo_bytes($ivlen);
$encrypted = openssl_encrypt("Hello world!", "aes-256-cbc", "This is my key", OPENSSL_RAW_DATA, $iv);
echo base64_encode($iv.$encrypted);

```

Usage:

```
# use default key
!decrypt WaXEqRY+dgNjsC/75nAE5k2JlizY1GWRY1FuageWAFI=
# Use the key with id 'greenKey'
!decrypt greenKey WaXEqRY+dgNjsC/75nAE5k2JlizY1GWRY1FuageWAFI=

```

Environment
-----------

[](#environment)

Returns the value of the specified environment variable

Example:

```
!env COMPUTERNAME

```

You can optionally specify an array of allowed strings to access inside the constructor

Import
------

[](#import)

Imports a file in various formats at this position. By default, these parsers are available:

- **php** - parsed by PHP's unserialize function
- **yaml** - parsed by Symfony Yaml parser (can easily replaced by this packages parser)
- **json** - parsed by json\_decode and set to return associative arrays

You can set your own parsers with addParser():

```
$handler = new Import();
$handler->addParser('myformat', [$MyClass, 'myparse'], '/only/inside/here', ['other','params']);

```

Usage:

```
!import

```

Samples:

```
!import myfile
!import myfile json

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~366 days

Total

3

Last Release

1678d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f3e51460b8424774241a747201a81cdc8a8d9734007b3ef4fd7b997f8a4271ab?d=identicon)[ToBe998](/maintainers/ToBe998)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/topolis-yaml/health.svg)

```
[![Health](https://phpackages.com/badges/topolis-yaml/health.svg)](https://phpackages.com/packages/topolis-yaml)
```

###  Alternatives

[getkirby/cms

The Kirby core

1.5k535.5k350](/packages/getkirby-cms)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[neos/flow

Flow Application Framework

862.0M450](/packages/neos-flow)

PHPackages © 2026

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