PHP code example of lovelock / spf

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

    

lovelock / spf example snippets


$container['db_spw'] = function ($c) {
    return new \Spw\Connection\Connection(Bag::get('database', 'spw'));
};

class Database extends AbstractConfig
{
    public function __construct($dbName)
    {
         $contents = parse_ini_file(WEB_ROOT . '/App/Config/' . ucfirst(ENV) . '/database.ini', true);
         $this->config = $contents[$dbName];
    }
}