original_string: public function updateComponents($componentsWithUpdateFile)
      {
          $warnings = array();
          $errors   = array();
          $deactivatedPlugins = array();
          $coreError = false;
  
          if (!empty($componentsWithUpdateFile)) {
              $currentAccess      = Access::getInstance();
              $hasSuperUserAccess = $currentAccess->hasSuperUserAccess();
  
              if (!$hasSuperUserAccess) {
                  $currentAccess->setSuperUserAccess(true);
              }
  
              // if error in any core update, show message + help message + EXIT
              // if errors in any plugins updates, show them on screen, disable plugins that errored + CONTINUE
              // if warning in any core update or in any plugins update, show message + CONTINUE
              // if no error or warning, success message + CONTINUE
              foreach ($componentsWithUpdateFile as $name => $filenames) {
                  try {
                      $warnings = array_merge($warnings, $this->update($name));
                  } catch (UpdaterErrorException $e) {
                      $errors[] = $e->getMessage();
                      if ($name == 'core') {
                          $coreError = true;
                          break;
                      } elseif (\Piwik\Plugin\Manager::getInstance()->isPluginActivated($name)) {
                          \Piwik\Plugin\Manager::getInstance()->deactivatePlugin($name);
                          $deactivatedPlugins[] = $name;
                      }
                  }
              }
  
              if (!$hasSuperUserAccess) {
                  $currentAccess->setSuperUserAccess(false);
              }
          }
  
          Filesystem::deleteAllCacheOnUpdate();
          ServerFilesGenerator::createHtAccessFiles();
  
          $result = array(
              'warnings'  => $warnings,
              'errors'    => $errors,
              'coreError' => $coreError,
              'deactivatedPlugins' => $deactivatedPlugins
          );
  
          /**
           * Triggered after Piwik has been updated.
           */
          Piwik::postEvent('CoreUpdater.update.end');
  
          return $result;
      }
code: public function updateComponents($componentsWithUpdateFile)
      {
          $warnings = array();
          $errors   = array();
          $deactivatedPlugins = array();
          $coreError = false;
  
          if (!empty($componentsWithUpdateFile)) {
              $currentAccess      = Access::getInstance();
              $hasSuperUserAccess = $currentAccess->hasSuperUserAccess();
  
              if (!$hasSuperUserAccess) {
                  $currentAccess->setSuperUserAccess(true);
              }
  
              // if error in any core update, show message + help message + EXIT
              // if errors in any plugins updates, show them on screen, disable plugins that errored + CONTINUE
              // if warning in any core update or in any plugins update, show message + CONTINUE
              // if no error or warning, success message + CONTINUE
              foreach ($componentsWithUpdateFile as $name => $filenames) {
                  try {
                      $warnings = array_merge($warnings, $this->update($name));
                  } catch (UpdaterErrorException $e) {
                      $errors[] = $e->getMessage();
                      if ($name == 'core') {
                          $coreError = true;
                          break;
                      } elseif (\Piwik\Plugin\Manager::getInstance()->isPluginActivated($name)) {
                          \Piwik\Plugin\Manager::getInstance()->deactivatePlugin($name);
                          $deactivatedPlugins[] = $name;
                      }
                  }
              }
  
              if (!$hasSuperUserAccess) {
                  $currentAccess->setSuperUserAccess(false);
              }
          }
  
          Filesystem::deleteAllCacheOnUpdate();
          ServerFilesGenerator::createHtAccessFiles();
  
          $result = array(
              'warnings'  => $warnings,
              'errors'    => $errors,
              'coreError' => $coreError,
              'deactivatedPlugins' => $deactivatedPlugins
          );
  
          /**
           * Triggered after Piwik has been updated.
           */
          Piwik::postEvent('CoreUpdater.update.end');
  
          return $result;
      }
code_tokens: public function updateComponents ( $ componentsWithUpdateFile ) { $ warnings = array ( ) ; $ errors = array ( ) ; $ deactivatedPlugins = array ( ) ; $ coreError = false ; if ( ! empty ( $ componentsWithUpdateFile ) ) { $ currentAccess = Access :: getInstance ( ) ; $ hasSuperUserAccess = $ currentAccess -> hasSuperUserAccess ( ) ; if ( ! $ hasSuperUserAccess ) { $ currentAccess -> setSuperUserAccess ( true ) ; } // if error in any core update, show message + help message + EXIT // if errors in any plugins updates, show them on screen, disable plugins that errored + CONTINUE // if warning in any core update or in any plugins update, show message + CONTINUE // if no error or warning, success message + CONTINUE foreach ( $ componentsWithUpdateFile as $ name => $ filenames ) { try { $ warnings = array_merge ( $ warnings , $ this -> update ( $ name ) ) ; } catch ( UpdaterErrorException $ e ) { $ errors [ ] = $ e -> getMessage ( ) ; if ( $ name == 'core' ) { $ coreError = true ; break ; } elseif ( \ Piwik \ Plugin \ Manager :: getInstance ( ) -> isPluginActivated ( $ name ) ) { \ Piwik \ Plugin \ Manager :: getInstance ( ) -> deactivatePlugin ( $ name ) ; $ deactivatedPlugins [ ] = $ name ; } } } if ( ! $ hasSuperUserAccess ) { $ currentAccess -> setSuperUserAccess ( false ) ; } } Filesystem :: deleteAllCacheOnUpdate ( ) ; ServerFilesGenerator :: createHtAccessFiles ( ) ; $ result = array ( 'warnings' => $ warnings , 'errors' => $ errors , 'coreError' => $ coreError , 'deactivatedPlugins' => $ deactivatedPlugins ) ; /**
           * Triggered after Piwik has been updated.
           */ Piwik :: postEvent ( 'CoreUpdater.update.end' ) ; return $ result ; }
docstring: Updates multiple components, while capturing & returning errors and warnings.
  
  @param string[] $componentsWithUpdateFile Component names mapped with arrays of update files. Same structure
  as the result of `getComponentsWithUpdateFile()`.
  @return array Information about the update process, including:
  
  * **warnings**: The list of warnings that occurred during the update process.
  * **errors**: The list of updater exceptions thrown during individual component updates.
  * **coreError**: True if an exception was thrown while updating core.
  * **deactivatedPlugins**: The list of plugins that were deactivated due to an error in the
  update process.
docstring_tokens: Updates multiple components while capturing & returning errors and warnings .