original_string: protected function writeConfig($clear = true)
      {
          $output = $this->dumpConfig();
          if ($output !== null
              && $output !== false
          ) {
              $localPath = $this->getLocalPath();
  
              if ($this->doNotWriteConfigInTests) {
                  // simulate whether it would be successful
                  $success = is_writable($localPath);
              } else {
                  $success = @file_put_contents($localPath, $output, LOCK_EX);
              }
  
              if ($success === false) {
                  throw $this->getConfigNotWritableException();
              }
  
              /**
               * Triggered when a INI config file is changed on disk.
               *
               * @param string $localPath Absolute path to the changed file on the server.
               */
              Piwik::postEvent('Core.configFileChanged', [$localPath]);
          }
  
          if ($clear) {
              $this->reload();
          }
      }
code: protected function writeConfig($clear = true)
      {
          $output = $this->dumpConfig();
          if ($output !== null
              && $output !== false
          ) {
              $localPath = $this->getLocalPath();
  
              if ($this->doNotWriteConfigInTests) {
                  // simulate whether it would be successful
                  $success = is_writable($localPath);
              } else {
                  $success = @file_put_contents($localPath, $output, LOCK_EX);
              }
  
              if ($success === false) {
                  throw $this->getConfigNotWritableException();
              }
  
              /**
               * Triggered when a INI config file is changed on disk.
               *
               * @param string $localPath Absolute path to the changed file on the server.
               */
              Piwik::postEvent('Core.configFileChanged', [$localPath]);
          }
  
          if ($clear) {
              $this->reload();
          }
      }
code_tokens: protected function writeConfig ( $ clear = true ) { $ output = $ this -> dumpConfig ( ) ; if ( $ output !== null && $ output !== false ) { $ localPath = $ this -> getLocalPath ( ) ; if ( $ this -> doNotWriteConfigInTests ) { // simulate whether it would be successful $ success = is_writable ( $ localPath ) ; } else { $ success = @ file_put_contents ( $ localPath , $ output , LOCK_EX ) ; } if ( $ success === false ) { throw $ this -> getConfigNotWritableException ( ) ; } /**
               * Triggered when a INI config file is changed on disk.
               *
               * @param string $localPath Absolute path to the changed file on the server.
               */ Piwik :: postEvent ( 'Core.configFileChanged' , [ $ localPath ] ) ; } if ( $ clear ) { $ this -> reload ( ) ; } }
docstring: Write user configuration file
  
  @param array $configLocal
  @param array $configGlobal
  @param array $configCommon
  @param array $configCache
  @param string $pathLocal
  @param bool $clear
  
  @throws \Exception if config file not writable
docstring_tokens: Write user configuration file