original_string: public function get_option($config = '') {
          global $DB;
          $cache = cache::make('core', 'repositories');
          if (($entries = $cache->get('ops:'. $this->id)) === false) {
              $entries = $DB->get_records('repository_instance_config', array('instanceid' => $this->id));
              $cache->set('ops:'. $this->id, $entries);
          }
  
          $ret = array();
          foreach($entries as $entry) {
              $ret[$entry->name] = $entry->value;
          }
  
          if (!empty($config)) {
              if (isset($ret[$config])) {
                  return $ret[$config];
              } else {
                  return null;
              }
          } else {
              return $ret;
          }
      }
code: public function get_option($config = '') {
          global $DB;
          $cache = cache::make('core', 'repositories');
          if (($entries = $cache->get('ops:'. $this->id)) === false) {
              $entries = $DB->get_records('repository_instance_config', array('instanceid' => $this->id));
              $cache->set('ops:'. $this->id, $entries);
          }
  
          $ret = array();
          foreach($entries as $entry) {
              $ret[$entry->name] = $entry->value;
          }
  
          if (!empty($config)) {
              if (isset($ret[$config])) {
                  return $ret[$config];
              } else {
                  return null;
              }
          } else {
              return $ret;
          }
      }
code_tokens: public function get_option ( $ config = '' ) { global $ DB ; $ cache = cache :: make ( 'core' , 'repositories' ) ; if ( ( $ entries = $ cache -> get ( 'ops:' . $ this -> id ) ) === false ) { $ entries = $ DB -> get_records ( 'repository_instance_config' , array ( 'instanceid' => $ this -> id ) ) ; $ cache -> set ( 'ops:' . $ this -> id , $ entries ) ; } $ ret = array ( ) ; foreach ( $ entries as $ entry ) { $ ret [ $ entry -> name ] = $ entry -> value ; } if ( ! empty ( $ config ) ) { if ( isset ( $ ret [ $ config ] ) ) { return $ ret [ $ config ] ; } else { return null ; } } else { return $ ret ; } }
docstring: Get settings for repository instance.
  
  @param string $config a specific option to get.
  @return mixed returns an array of options. If $config is not empty, then it returns that option,
  or null if the option does not exist.
docstring_tokens: Get settings for repository instance .