public static function mergeFromFiles($_)
    {
        $files = array_reverse(func_get_args());
        $data  = [];

        if (is_array($files[0])) {
            $files = array_reverse($files[0]);
        }

        while (count($files) > 0) {
            try {
                $file = array_pop($files);

                if (! is_readable($file)) {
                    continue;
                }

                $new_data = static::getFromCache($file, function ($file) {
                    return Loader::load($file);
                });

                if (null === $data) {
                    continue;
                }

                $data = array_replace_recursive($data, $new_data);
            } catch (Exception $exception) {
                // Fail silently and try next file.
            }
        }

        return static::createFromArray($data);
    }
public static function mergeFromFiles($_)
    {
        $files = array_reverse(func_get_args());
        $data  = [];

        if (is_array($files[0])) {
            $files = array_reverse($files[0]);
        }

        while (count($files) > 0) {
            try {
                $file = array_pop($files);

                if (! is_readable($file)) {
                    continue;
                }

                $new_data = static::getFromCache($file, function ($file) {
                    return Loader::load($file);
                });

                if (null === $data) {
                    continue;
                }

                $data = array_replace_recursive($data, $new_data);
            } catch (Exception $exception) {
                // Fail silently and try next file.
            }
        }

        return static::createFromArray($data);
    }
public static function mergeFromFiles ( $ _ ) { $ files = array_reverse ( func_get_args ( ) ) ; $ data = [ ] ; if ( is_array ( $ files [ 0 ] ) ) { $ files = array_reverse ( $ files [ 0 ] ) ; } while ( count ( $ files ) > 0 ) { try { $ file = array_pop ( $ files ) ; if ( ! is_readable ( $ file ) ) { continue ; } $ new_data = static :: getFromCache ( $ file , function ( $ file ) { return Loader :: load ( $ file ) ; } ) ; if ( null === $ data ) { continue ; } $ data = array_replace_recursive ( $ data , $ new_data ) ; } catch ( Exception $ exception ) { // Fail silently and try next file. } } return static :: createFromArray ( $ data ) ; }
Create a new ConfigInterface object by merging data from several files.

If a comma-separated list of files is provided, they are loaded in sequence and later files override settings in
earlier files.

@since 0.4.6

@param string|array $_ List of files.

@return ConfigInterface Instance of a ConfigInterface implementation.
Create a new ConfigInterface object by merging data from several files .