ConfigRewrite
class ConfigRewrite
Configuration rewriter
https://github.com/daftspunk/laravel-config-writer
This class lets you rewrite array values inside a basic configuration file that returns a single array definition (a Laravel config file) whilst maintaining the integrity of the file, leaving comments and advanced settings intact.
The following value types are supported for writing:
- strings
- integers
- booleans
- nulls
- single-dimension arrays
To do:
- When an entry does not exist, provide a way to create it
Pro Regex tip: Use [\s\S] instead of . for multi-line support
Methods
No description
No description
No description
No description
No description
No description
No description
Common constants only (true, false, null, integers)
Single level arrays only
No description
Details
at line 30
toFile($filePath, $newValues, $useValidation = true)
No description
at line 39
toContent($contents, $newValues, $useValidation = true)
No description
at line 65
protected
parseContent($contents, $newValues)
No description
at line 75
protected
parseContentValue($contents, $path, $value)
No description
at line 99
protected
writeValueToPhp($value)
No description
at line 125
protected
writeArrayToPhp($array)
No description
at line 137
protected
buildStringExpression($targetKey, $arrayItems = [], $quoteChar = "'")
No description
at line 162
protected string
buildConstantExpression($targetKey, array $arrayItems = [])
Common constants only (true, false, null, integers)
at line 184
protected string
buildArrayExpression($targetKey, array $arrayItems = [])
Single level arrays only
at line 200
protected
buildArrayOpeningExpression($arrayItems)
No description