1. Go to this page and download the library: Download rosalana/configure library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rosalana / configure example snippets
use Rosalana\Configure\Configure;
$file = Configure::file('database');
$value = $file->value('connections.mysql.host');
$value->get(); // current value
$value->set('localhost'); // hard set
$value->add('localhost'); // soft set
$value->remove(); // delete value
$file->section('connections')
->comment(
'Database connections',
"Used by the application\nDo not edit manually"
);
'connections' => [
/*
|----------------------------------------------------
| Database connections
|----------------------------------------------------
|
| Used by the application
| Do not edit manually
|
*/
]
/**
* Get the node array representation.
* @return array<string, mixed>
*/
$node->toArray();
/**
* Get the type of the node.
*
* @return string 'file', 'section', 'value', 'comment', 'richcomment'
*/
$node->type();
/**
* Get the node path.
* @return string
*/
$node->path(): string;
/**
* Get the node name.
* @return string
*/
$node->name(): string;
/**
* Get the node start line number.
* @return int
*/
$node->start(): int;
/**
* Get the node end line number.
* @return int
*/
$node->end(): int;
/**
* Get the node raw array of lines.
* @return array<int, string>
*/
$node->raw(): array;
/**
* Render the node to array of lines.
* @return array<int, string>
*/
$node->render(): array;
/**
* Get the node indentation level. (including padding)
* @return int
*/
$node->scale(): int;
/**
* Get the node parent instance.
* @return ?ParentNode
*/
$node->parent(): ?ParentNode;
/**
* Get the node siblings collection.
* @return Collection<Node>
*/
$node->siblings(): Collection;
/**
* Get the sibling nodes before the current node.
* @return Collection<Node>
*/
$node->siblingsBefore(): Collection;
/**
* Get the sibling nodes after the current node.
* @return Collection<Node>
*/
$node->siblingsAfter(): : Collection;
/**
* Get the root file instance.
* @return File
*/
$node->root(): File;
/** Determine if the node was created during this session. */
$node->isNew(): bool;
/** Determine if the node has unsaved changes. */
$node->isDirty(): bool;
/** Determine if the node is of a specific type. */
$node->isTypeOf(string $type): bool;
/** Determine if the node is a sub-node (not top-level). */
$node->isSubNode(): bool;
/** Determine if the node is at root top-level. */
$node->isRoot(): bool;
/** Determine if the node is the first child of its parent. */
$node->isFirstChild(): bool;
/** Determine if the node is the last child of its parent. */
$node->isLastChild(): bool;