public function loadAndMerge(string $filename)
  {
    # Attempt to load config file
    if ( \file_exists($filename) ) {
      # Set filename
      $this->filename = $filename;
      # Load the config
      $configArray = \json_decode( \file_get_contents($filename), true);
      if ($configArray) {
        // $configArray = $this->array_change_key_case_recursive($configArray); // Lowercase the keys
        # Merge the Config with existing config
        $this->confValues = \array_replace_recursive($this->confValues, $configArray);

      } else {
        throw new SpinException('Invalid JSON file "'.$filename.'"');

      }

    }

    return $this;
  }
public function loadAndMerge(string $filename)
  {
    # Attempt to load config file
    if ( \file_exists($filename) ) {
      # Set filename
      $this->filename = $filename;
      # Load the config
      $configArray = \json_decode( \file_get_contents($filename), true);
      if ($configArray) {
        // $configArray = $this->array_change_key_case_recursive($configArray); // Lowercase the keys
        # Merge the Config with existing config
        $this->confValues = \array_replace_recursive($this->confValues, $configArray);

      } else {
        throw new SpinException('Invalid JSON file "'.$filename.'"');

      }

    }

    return $this;
  }
public function loadAndMerge ( string $ filename ) { # Attempt to load config file if ( \ file_exists ( $ filename ) ) { # Set filename $ this -> filename = $ filename ; # Load the config $ configArray = \ json_decode ( \ file_get_contents ( $ filename ) , true ) ; if ( $ configArray ) { // $configArray = $this->array_change_key_case_recursive($configArray); // Lowercase the keys # Merge the Config with existing config $ this -> confValues = \ array_replace_recursive ( $ this -> confValues , $ configArray ) ; } else { throw new SpinException ( 'Invalid JSON file "' . $ filename . '"' ) ; } } return $ this ; }
Load & Merge Configuration file to existing config

@param      string     $filename

@throws     Exception  On invalid JSON file

@return     self
Load & Merge Configuration file to existing config