PHP code example of oihana / php-init

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

    

oihana / php-init example snippets


use DI\Container;

use function oihana\init\initConfig;
use function oihana\init\initContainer;
use function oihana\init\initDefinitions;

// 1. Load configuration (config.toml under the given base path)
$config = initConfig( __DIR__ . '/config' );

// 2. Build a DI container from all PHP definition files in a directory
$definitions = initDefinitions( __DIR__ . '/definitions' );
$container    = initContainer( $definitions );
bash
composer