Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Laravel News:
Introduction to TOML Configuration in PHP
Jul 30, 2018 @ 14:37:31

On the Laravel News site today there's a tutorial posted introducing you to TOML configuration, a new configuration file structure that's designed to be easy for humans to read and highly flexible (all while staying relatively simple).

TOML is a configuration file format language that is intended to be minimal and easy to read. TOML stands for “Tom’s Obvious, Minimal Language,” which refers to the creator Tom Preston-Werner.

[...] TOML aims to be a minimal configuration file format that’s easy to read due to obvious semantics. TOML is designed to map unambiguously to a hash table. TOML should be easy to parse into data structures in a wide variety of languages.

In order to work with it in PHP (since there is no native support) they show you how to install the yosymfony/toml package. The tutorial then walks you through an example TOML configuration file and what the result of using the package to parse it looks like. It then takes it a step further an converts one of the database configuration files for a Laravel application to the TOML format. It also shows the reverse - using the package to create a TOML file and the resulting output.

tagged: toml configuration file custom format introduction tutorial

Link: https://laravel-news.com/toml-configuration-in-php


Trending Topics: