PHP code example of spacetab-io / db-config

1. Go to this page and download the library: Download spacetab-io/db-config 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/ */

    

spacetab-io / db-config example snippets




use Spacetab\DbConfig\Packer\KeyValue;
use Spacetab\DbConfig\Reader;

$config = new Reader([
    'default' => [
        'type' => 'pgsql',
        'name' => 'roquie',
        'host' => ['127.0.0.1', '127.0.0.2'],
        'port' => [5432, 6432],
        'user' => 'roquie',
        'pass' => 'secret',
        'schema' => 'public',
        'options' => [
            'connect_timeout' => 10,
            'target_session_attrs' => 'any',
            'sslmode' => '