protected override void DoProcessing() { using (ServerManager serverManager = new ServerManager()) { ServerManagerWrapper serverManagerWrapper = new ServerManagerWrapper(serverManager, this.SiteName, this.VirtualPath); PHPConfigHelper configHelper = new PHPConfigHelper(serverManagerWrapper); PHPIniFile phpIniFile = configHelper.GetPHPIniFile(); PHPIniSetting setting = Helper.FindSetting(phpIniFile.Settings, Name); if (setting != null) { if (ShouldProcess(Name)) { string warningMessage = String.Format(Resources.DeleteSettingWarningMessage, setting.Name, setting.Value); if (Force || ShouldContinue(warningMessage, Resources.DeleteSettingWarningCaption)) { configHelper.RemovePHPIniSetting(setting); } } } else { ArgumentException ex = new ArgumentException(String.Format(Resources.SettingDoesNotExistError, Name)); ReportNonTerminatingError(ex, "InvalidArgument", ErrorCategory.ObjectNotFound); } } }
public void RemovePHPIniSetting(object settingData) { EnsureServerConnection(); PHPIniSetting setting = new PHPIniSetting(); setting.SetData(settingData); try { PHPConfigHelper configHelper = new PHPConfigHelper(ManagementUnit); configHelper.RemovePHPIniSetting(setting); } catch (FileNotFoundException) { RaiseException("ErrorPHPIniNotFound"); } }
public void RemovePHPIniSetting(object settingData) { EnsureServerConnection(); PHPIniSetting setting = new PHPIniSetting(); setting.SetData(settingData); try { ManagementUnitWrapper mgmtUnitWrapper = new ManagementUnitWrapper(ManagementUnit); PHPConfigHelper configHelper = new PHPConfigHelper(mgmtUnitWrapper); configHelper.RemovePHPIniSetting(setting); } catch (FileNotFoundException) { RaiseException("ErrorPHPIniNotFound"); } catch (InvalidOperationException) { RaiseException("ErrorPHPIsNotRegistered"); } }