PHP code example of yiisoft / composer-config-plugin

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

    

yiisoft / composer-config-plugin example snippets




return [
    'components' => [
        'db' => [
            'class' => \my\Db::class,
            'name' => $params['db.name'],
            'password' => $params['db.password'],
        ],
    ],
];

$config = 



return [
    'class' => \my\Db::class,
    'name' => $params['db.name'],
    'password' => $params['db.password'],
];



use Yiisoft\Composer\Config\Builder;

return [
    'components' => [
        'db' => Builder::

// Don't do it in production, assembling takes it's time
if (getenv('APP_ENV') === 'dev') {
    Yiisoft\Composer\Config\Builder::rebuild();
}

    "params": [
       "params.php",
       "?params-local.php"
    ]
    

  "web": [
     "../src/Modules/*/config/web.php"
  ]
  

  "params": [
     "params.php",
     "?params-local.php"
  ],
  "params-console": [
     "$params",
     "params-console.php"
  ],
  "params-web": [
     "$params",
     "params-web.php"
  ]
  
sh
composer dump-autoload