*/ class ActivateMediaIntensiveCheck extends InstallAction { /** * @param $params * @return \common_report_Report */ public function __invoke($params) { try { $extension = \common_ext_ExtensionsManager::singleton()->getExtensionById('taoClientDiagnostic'); $config = $extension->getConfig('clientDiag'); if (!isset($config['testers']) || !isset($config['testers']['intensive_bandwidth'])) { $config['testers']['intensive_bandwidth'] = [ 'enabled' => false, 'level' => 2, 'tester' => 'taoClientDiagnostic/tools/bandwidth/tester', 'unit' => 1.2, 'ideal' => 45, 'max' => 100 ]; } $config['testers']['intensive_bandwidth']['enabled'] = true; $config['testers']['intensive_bandwidth']['fallbackThreshold'] = 0.2; $extension->setConfig('clientDiag', $config); return new \common_report_Report(\common_report_Report::TYPE_SUCCESS, "The Media Intensive check has been activated!"); } catch (\Exception $e) { return new \common_report_Report(\common_report_Report::TYPE_ERROR, $e->getMessage()); } } }