PHP code example of los / losdomain

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

    

los / losdomain example snippets


foreach (\LosDomain\DomainService::configFiles('config/autoload/domains') as $file) {
    $config = ArrayUtils::merge($config, 



use Laminas\Stdlib\ArrayUtils;
use Laminas\Stdlib\Glob;

/**
 * Configuration files are loaded in a specific order. First ``global.php``, then ``*.global.php``.
 * then ``local.php`` and finally ``*.local.php``. This way local settings overwrite global settings.
 *
 * The configuration can be cached. This can be done by setting ``config_cache_enabled`` to ``true``.
 *
 * Obviously, if you use closures in your config you can't cache it.
 */

ig['config_cache_enabled']) && $config['config_cache_enabled'] === true) {
        file_put_contents($cachedConfigFile, ' return ' . var_export($config, true) . ';');
    }
}

foreach (\LosDomain\DomainService::configFiles('config/autoload/domains') as $file) {
    $config = ArrayUtils::merge($config, 


return [
    'los_domain' => [
        'aliases' => [
            'www.test.local' => 'test.local',
        ],
    ],
];
config/autoload/domain/test.local/global.php
config/autoload/domains/config.php