2017 © Pedro Peláez
 

library parser

Elgentos Parser for json/yaml files to readable array

image

elgentos/parser

Elgentos Parser for json/yaml files to readable array

  • Wednesday, July 18, 2018
  • by peterjaap
  • Repository
  • 6 Watchers
  • 1 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

Elgentos Content parser Build Status

Parse content from json/yaml/csv/text to a usable array, (*1)

Description

Use this library to turn your day-to-day configurations into usable arrays/objects., (*2)

Supports json, yaml, csv, xml and plain text., (*3)

<?php
/**
 * Read a file, import recursive and return a merged array
 */
$data = Elgentos\Parser::readFile('file.json');
<?php
/**
 * Read a file, no recursion
 */
$data = Elgentos\Parser::readSimple('file.json');

Instalation

To use in your project require, (*4)

composer require elgentos/parser, (*5)

To support YAML also require:, (*6)

composer require symfony/yaml, (*7)

Directives

You can use directives inside your file., (*8)

@import

Load content of other files directly in your current file., (*9)

YAML, (*10)

othercontent:
  "@import": path/to/other/file.yaml

JSON, (*11)

{
  "othercontent": {"@import": "path/to/otherfile.yaml"  }
} 

CSV, (*12)

"@import"
"path/to/file.json"
"path/to/otherfile.yaml"
"path/to/file2.yaml"

@import-dir

Read a directory recursively., (*13)

base:
  "@import-dir": "path/to/directory"
{
  "base": {"@import-dir": "path/to/directory"}
}

Customization

Due Service Contracts you can easily add your own functionality: - Rules \Elgenttos\Parser\Interfaces\RuleInterface - Matcher \Elgenttos\Parser\Interfaces\MatcherInterface - Parser \Elgenttos\Parser\Interfaces\RuleInterface - Stories \Elgenttos\Parser\Interfaces\StoriesInterface, (*14)

Automated creation of objects

Technical description

For our technical docs docs/technical.md., (*15)

The Versions

18/07 2018

dev-master

9999999-dev https://elgentos.nl/

Elgentos Parser for json/yaml files to readable array

  Sources   Download

MIT

The Development Requires

18/07 2018

1.4.2

1.4.2.0 https://elgentos.nl/

Elgentos Parser for json/yaml files to readable array

  Sources   Download

MIT License

The Development Requires

18/07 2018

1.4.1

1.4.1.0 https://elgentos.nl/

Elgentos Parser for json/yaml files to readable array

  Sources   Download

MIT License

The Development Requires

17/07 2018

1.4.0

1.4.0.0 https://elgentos.nl/

Elgentos Parser for json/yaml files to readable array

  Sources   Download

MIT License

The Development Requires

17/07 2018

1.3.1

1.3.1.0 https://elgentos.nl/

Elgentos Parser for json/yaml files to readable array

  Sources   Download

MIT License

The Development Requires

17/07 2018

1.3.0

1.3.0.0 https://elgentos.nl/

Elgentos Parser for json/yaml files to readable array

  Sources   Download

MIT License

The Development Requires

17/07 2018

1.2.1

1.2.1.0 https://elgentos.nl/

Elgentos Parser for json/yaml files to readable array

  Sources   Download

MIT License

The Development Requires

17/07 2018

1.2.0

1.2.0.0 https://elgentos.nl/

Elgentos Parser for json/yaml files to readable array

  Sources   Download

MIT License

The Development Requires

17/07 2018

1.1.0

1.1.0.0 https://elgentos.nl/

Elgentos Parser for json/yaml files to readable array

  Sources   Download

MIT License

The Development Requires

17/07 2018

1.0.1

1.0.1.0 https://elgentos.nl/

Elgentos Parser for json/yaml files to readable array

  Sources   Download

MIT License

The Development Requires

17/07 2018

1.0.0

1.0.0.0 https://elgentos.nl/

Elgentos Parser for json/yaml files to readable array

  Sources   Download

MIT License

The Development Requires