original_string: public function getConfig($path, $default_value = UNDEFINED)
      {
          /*
           * For given path such as 'dsn' or 'logger/log_dir' returns
           * corresponding config value. Throws ExceptionNotConfigured if not set.
           *
           * To find out if config is set, do this:
           *
           * $var_is_set = true;
           * try { $app->getConfig($path); } catch ExceptionNotConfigured($e) { $var_is_set=false; }
           */
          $parts = explode('/', $path);
          $current_position = $this->config;
          foreach ($parts as $part) {
              if (!array_key_exists($part, $current_position)) {
                  if ($default_value !== UNDEFINED) {
                      return $default_value;
                  }
                  throw $this->exception('Configuration parameter is missing in config.php', 'NotConfigured')
                      ->addMoreInfo('config_files_loaded', $this->config_files_loaded)
                      ->addMoreInfo('missign_line', " \$config['".implode("']['", explode('/', $path))."']");
              } else {
                  $current_position = $current_position[$part];
              }
          }
  
          return $current_position;
      }
code: public function getConfig($path, $default_value = UNDEFINED)
      {
          /*
           * For given path such as 'dsn' or 'logger/log_dir' returns
           * corresponding config value. Throws ExceptionNotConfigured if not set.
           *
           * To find out if config is set, do this:
           *
           * $var_is_set = true;
           * try { $app->getConfig($path); } catch ExceptionNotConfigured($e) { $var_is_set=false; }
           */
          $parts = explode('/', $path);
          $current_position = $this->config;
          foreach ($parts as $part) {
              if (!array_key_exists($part, $current_position)) {
                  if ($default_value !== UNDEFINED) {
                      return $default_value;
                  }
                  throw $this->exception('Configuration parameter is missing in config.php', 'NotConfigured')
                      ->addMoreInfo('config_files_loaded', $this->config_files_loaded)
                      ->addMoreInfo('missign_line', " \$config['".implode("']['", explode('/', $path))."']");
              } else {
                  $current_position = $current_position[$part];
              }
          }
  
          return $current_position;
      }
code_tokens: public function getConfig ( $ path , $ default_value = UNDEFINED ) { /*
           * For given path such as 'dsn' or 'logger/log_dir' returns
           * corresponding config value. Throws ExceptionNotConfigured if not set.
           *
           * To find out if config is set, do this:
           *
           * $var_is_set = true;
           * try { $app->getConfig($path); } catch ExceptionNotConfigured($e) { $var_is_set=false; }
           */ $ parts = explode ( '/' , $ path ) ; $ current_position = $ this -> config ; foreach ( $ parts as $ part ) { if ( ! array_key_exists ( $ part , $ current_position ) ) { if ( $ default_value !== UNDEFINED ) { return $ default_value ; } throw $ this -> exception ( 'Configuration parameter is missing in config.php' , 'NotConfigured' ) -> addMoreInfo ( 'config_files_loaded' , $ this -> config_files_loaded ) -> addMoreInfo ( 'missign_line' , " \$config['" . implode ( "']['" , explode ( '/' , $ path ) ) . "']" ) ; } else { $ current_position = $ current_position [ $ part ] ; } } return $ current_position ; }
docstring: Load config if necessary and look up corresponding setting.
  
  @param string $path
  @param mixed $default_value
  
  @return string
docstring_tokens: Load config if necessary and look up corresponding setting .