Download the PHP package me-io/php-ini-parser without Composer

On this page you can find all versions of the php package me-io/php-ini-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-ini-parser

PHP .ini parser

Ini Parser is a simple parser for complex INI files, providing a number of extra syntactic features to the built-in INI parsing functions, including section inheritance, property nesting, and array literals.


Build Status Code Cov Scrutinizer downloads MIT License Donate

PRs Welcome Code of Conduct Watch on GitHub Star on GitHub Tweet

Installing

Add me-io/php-ini-parser following inside your composer.json file like this:

Then inside your terminal run the following command to install the dependencies:

Example

Standard INI files look like this:

And when parsed with PHP's built-in parse_ini_string() or parse_ini_file(), looks like:

This is great when you just want a simple configuration file, but here is a super-charged INI file that you might find in the wild:

And when parsed with \Ini\Parser:

You get the following structure:

Supported Features

Array Literals

You can directly create arrays using the syntax [a, b, c] on the right hand side of an assignment. For example:

NOTE: At the moment, quoted strings inside array literals have undefined behavior.

Dictionaries and complex structures

Besides arrays, you can create dictionaries and more complex structures using JSON syntax. For example, you can use:

This turns into an array like:

NOTE: Remember to wrap the JSON strings in single quotes for a correct analysis. The JSON names must be enclosed in double quotes and trailing commas are not allowed.

Property Nesting

Ini Parser allows you to treat properties as associative arrays:

This turns into an array like:

Section Inheritance

Keeping to the DRY principle, Ini Parser allows you to "inherit" from other sections (similar to OOP inheritance), meaning you don't have to continually re-define the same properties over and over again. As you can see in the example above, "production" inherits from "staging", which in turn inherits from "testing".

You can even inherit from multiple parents, as in [child : p1 : p2 : p3]. The properties of each parent are merged into the child from left to right, so that the properties in p1 are overridden by those in p2, then by p3, then by those in child on top of that.

During the inheritance process, if a key ends in a +, the merge behavior changes from overwriting the parent value to prepending the parent value (or appending the child value - same thing). So the example file

would be parsed into the following:

If you can think of a more useful operation than concatenation for non-array types, please open an issue

Finally, it is possible to inherit from the special ^ section, representing the top-level or global properties:

Parses to:

ArrayObject

As an added bonus, Ini Parser also allows you to access the values OO-style:

Contributors

A huge thanks to all of our contributors:


Mohamed Meabed

💻 📢

Zeeshan Ahmad

💻 🐛 ⚠️ 📖

License

The code is available under the MIT license.


All versions of php-ini-parser with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package me-io/php-ini-parser contains the following files

Loading the files please wait ....