Download the PHP package donatj/php-ini-builder without Composer
On this page you can find all versions of the php package donatj/php-ini-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download donatj/php-ini-builder
More information about donatj/php-ini-builder
Files in donatj/php-ini-builder
Package php-ini-builder
Short Description PHP `parse_ini_string` Compatible INI Builder
License MIT
Informations about the package php-ini-builder
PHP INI Builder
Create PHP parse_ini_string
/ parse_ini_file
compatible INI strings from associative arrays.
Requirements
- php: >=7.1
- ext-ctype: *
Installing
Install the latest version with:
Example
Here is a simple example script:
Which outputs:
Documentation
Class: donatj\Ini\Builder
Utility for Converting An Array to a INI string
Method: Builder->__construct
Parameters:
- bool
$enableBool
- Enable automatic boolean detection? - bool
$enableNumeric
- Enable automatic numeric detection? - bool
$enableAlphaNumeric
- Enable automatic alpha-numeric detection? - bool
$skipNullValues
- Skip null values?
Method: Builder->generate
INI String Result
Throws: \donatj\Ini\ExceededMaxDepthException
Method: Builder->__invoke
Same as generate
- exists to make Builder callable.
Method: Builder->escape
Escapes Values According to Currently Set Rules
Parameters:
- bool | float | int | string | null
$value
Method: Builder->enableBoolDetection
Enable / Disable Automatic Boolean Detection
PHP's built in parse_ini_*
methods parse 1
, '1'
and true
and likewise ''
, and false
to the same
values when the scanner mode is set to INI_SCANNER_NORMAL
, enabling this option causes these values to be
output as true
/ false
Method: Builder->enableNumericDetection
Enable / Disable Automatic Numeric Detection
PHP's built in parse_ini_*
methods parse all values to string. Enabling this option enables numeric detection
so they will be output once again as floats/ints
Method: Builder->enableAlphaNumericDetection
Enable / Disable Automatic AlphaNumeric Detection
PHP's built in parse_ini_*
methods does not require quotation marks around simple strings without spaces.
Enabling this option removes the quotation marks on said simple strings.
Method: Builder->enableSkipNullValues
Enable / Disable Skipping Null Values
When enabled, null values will be skipped.
Class: donatj\Ini\ExceededMaxDepthException
Exception thrown when the max depth supported by INI is exceeded.
All versions of php-ini-builder with dependencies
ext-ctype Version *