PHP code example of kanellov / config-merge

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

    

kanellov / config-merge example snippets


 return array(
    'db'    => array(
        'dsn'      => 'mysql:dbname=production_db;host=production_server',
        'options' => array(
            PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',
        ),
    ),
    'dompdf' => array(
        'temp_dir'            => 'cache',
        'default_font'        => 'dejavu',
        'enable_remote'       => true,
        'font_height_ratio'   => 0.95,
        'enable_html5_parser' => true,
    ),
);

 return array(
  'db'    => array(
      'dsn'      => 'mysql:dbname=dev_db;host=dev_server',
      'user'     => 'username',
      'password' => 'password',
  ),
  'recaptcha' => array(
      'public_key'  => 'SOMEPUBLICKEY',
      'private_key' => 'SOMEPRIVATEKEY',
  ),
);

$config = \Knlv\config_merge('/some/path', array('global', 'local'));

array(
  'db'    => array(
      'dsn'      => 'mysql:dbname=dev_db;host=dev_server',
      'user'     => 'username',
      'password' => 'password',
      'options' => array(
          PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',
      ),
  ),
  'recaptcha' => array(
      'public_key'  => 'SOMEPUBLICKEY',
      'private_key' => 'SOMEPRIVATEKEY',
  ),
  'dompdf' => array(
      'temp_dir'            => 'cache',
      'default_font'        => 'dejavu',
      'enable_remote'       => true,
      'font_height_ratio'   => 0.95,
      'enable_html5_parser' => true,
  ),
);