• File: Config.php
  • Full Path: /home/lef/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/otgs/installer/includes/loader/Config.php
  • File size: 716 bytes
  • MIME-type: text/x-php
  • Charset: utf-8
<?php

namespace OTGS\Installer\Loader;

class Config {

	public static function merge( array $delegate, array $wpInstallerInstances ) {
		$args_to_merge = [ 'site_key_nags' ];
		foreach ( $wpInstallerInstances as $instance ) {
			if ( $instance['bootfile'] !== $delegate['bootfile'] ) {
				foreach ( $args_to_merge as $arg ) {
					if ( isset( $instance['args'][ $arg ] ) && is_array( $instance['args'][ $arg ] ) ) {
						if ( isset( $delegate['args'][ $arg ] ) ) {
							$delegate['args'][ $arg ] = array_merge_recursive( $delegate['args'][ $arg ], $instance['args'][ $arg ] );
						} else {
							$delegate['args'][ $arg ] = $instance['args'][ $arg ];
						}
					}
				}
			}
		}

		return $delegate;
	}
}