PHP code example of merlinblack / nigelib

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

    

merlinblack / nigelib example snippets

 php

use NigeLib\ConfigFacade as Config;
use NigeLib\Environment;
use NigeLib\DatabaseConnectionManagerFacade as DB;

// This needs to be done only once...
Config::init( 'localconfig', Environment::getEnvironmentName('envmap.php'), 'config' );

// Grab the PDO instance associated with 'temp' or create one based on the info
// in config/database.php
$temp_pdo = DB::get('temp');

 php

// Environment map.
//
// Maps environment names to one or more host names.
// These can be used by the Config class via the Environment class
// to read different configurations depending on which host this is running
// on.

return array(
    'live' => array( 'www.atkinson.kiwi' ),
    'test' => array( 'localhost.com', 'localhost','test.atkinson.kiwi' ),
);
 php

return array(

    'default' => 'blog',

    'connections' => array(

        'blog' => array(
            'driver' => 'pgsql',
            'host' => 'localhost',
            'database' => 'test',
            'user' => 'postgres',
            'password' => '',
        ),

        'temp' => array(
            'driver' => 'sqlite',
            'filename' => ':memory:',
        ),
    ),
);