masnathan / parser
Global data type parser
Installs: 12 954
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 2
Requires
- php: >=5.3.0
- camspiers/json-pretty: ^1.0
Requires (Dev)
- nette/neon: ^2.3
- phpunit/phpunit: 4.*
- scrutinizer/ocular: ~1.1
- symfony/var-dumper: ^2.7
- symfony/yaml: ^2.7
Suggests
- nette/neon: For parsing NEON files.
- symfony/yaml: For parsing YAML files.
This package is auto-updated.
Last update: 2023-06-16 13:38:35 UTC
README
Global data type parser
Install
Via Composer
$ composer require masnathan/parser
Usage
use MASNathan\Parser\Parser; $data = array( 'foo' => 'bar', 'sup' => 'World' ); $content = Parser::data($data); $content->setPrettyOutput(true); echo $content->to('json'); // outputs in json format echo $content->to('xml'); // outputs in xml format
And also...
$content = Parser::file('path/to/my/file.json')->from('json'); echo $content->to('xml'); // outputs in xml format // or echo Parser::file('path/to/my/file.xml') ->from('xml') ->setPrettyOutput(true) ->to('yaml');
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email andre.r.flip@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.