original_string: public function config_write($name, $value) {
          global $DB, $USER, $CFG;
  
          if ($this->nosave) {
              return true;
          }
  
          // make sure it is a real change
          $oldvalue = get_config($this->plugin, $name);
          $oldvalue = ($oldvalue === false) ? null : $oldvalue; // normalise
          $value = is_null($value) ? null : (string)$value;
  
          if ($oldvalue === $value) {
              return true;
          }
  
          // store change
          set_config($name, $value, $this->plugin);
  
          // Some admin settings affect course modinfo
          if ($this->affectsmodinfo) {
              // Clear course cache for all courses
              rebuild_course_cache(0, true);
          }
  
          $this->add_to_config_log($name, $oldvalue, $value);
  
          return true; // BC only
      }
code: public function config_write($name, $value) {
          global $DB, $USER, $CFG;
  
          if ($this->nosave) {
              return true;
          }
  
          // make sure it is a real change
          $oldvalue = get_config($this->plugin, $name);
          $oldvalue = ($oldvalue === false) ? null : $oldvalue; // normalise
          $value = is_null($value) ? null : (string)$value;
  
          if ($oldvalue === $value) {
              return true;
          }
  
          // store change
          set_config($name, $value, $this->plugin);
  
          // Some admin settings affect course modinfo
          if ($this->affectsmodinfo) {
              // Clear course cache for all courses
              rebuild_course_cache(0, true);
          }
  
          $this->add_to_config_log($name, $oldvalue, $value);
  
          return true; // BC only
      }
code_tokens: public function config_write ( $ name , $ value ) { global $ DB , $ USER , $ CFG ; if ( $ this -> nosave ) { return true ; } // make sure it is a real change $ oldvalue = get_config ( $ this -> plugin , $ name ) ; $ oldvalue = ( $ oldvalue === false ) ? null : $ oldvalue ; // normalise $ value = is_null ( $ value ) ? null : ( string ) $ value ; if ( $ oldvalue === $ value ) { return true ; } // store change set_config ( $ name , $ value , $ this -> plugin ) ; // Some admin settings affect course modinfo if ( $ this -> affectsmodinfo ) { // Clear course cache for all courses rebuild_course_cache ( 0 , true ) ; } $ this -> add_to_config_log ( $ name , $ oldvalue , $ value ) ; return true ; // BC only }
docstring: Used to set a config pair and log change
  
  @param string $name
  @param mixed $value Gets converted to string if not null
  @return bool Write setting to config table
docstring_tokens: Used to set a config pair and log change