PHP code example of nimbly / caboodle

1. Go to this page and download the library: Download nimbly/caboodle 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/ */

    

nimbly / caboodle example snippets


$config = new Config([
	new FileLoader(__DIR__ . "/config")
]);

$config->get("database.hostname");

new FileLoader("/path/to/config/files");



// file: config/database.php

return [
	"host" => "localhost",
	"port" => 1234,
	"user" => "dbuser",
	"password" => "dbpassword",
];

$config->addLoader(
	new FileLoader(__DIR__ . "/config")
);

$config->get("database.host");

$config->get("database.connections.default.host");

$config->setThrowIfNotFound(true);

$config->get("prod.database#connections.default.hostname");

$config->add("queue", [
	"name" => "jobs",
	"host" => "localhost",
	"port" => 1234
]);

$config->setItems([
	"key1" => "value1",
	"key2" => [
		"key3" => "value3"
	]
]);