public string AddExtension(string extensionPath) { EnsureServerConnection(); string result = null; try { var mgmtUnitWrapper = new ManagementUnitWrapper(ManagementUnit); var configHelper = new PHPConfigHelper(mgmtUnitWrapper); result = configHelper.AddExtension(extensionPath); } catch (FileNotFoundException) { RaiseException("ErrorPHPIniNotFound"); } catch (IOException) { RaiseException("ErrorExtensionFileAlreadyExists"); } catch (InvalidOperationException) { RaiseException("ErrorPHPIsNotRegistered"); } catch (Exception) { RaiseException("ErrorCannotAddExtension"); } return(result); }
public void ApplyRecommendedSettings(ArrayList configIssueIndexes) { EnsureServerConnection(); try { var mgmtUnitWrapper = new ManagementUnitWrapper(ManagementUnit); var configHelper = new PHPConfigHelper(mgmtUnitWrapper); configHelper.ApplyRecommendedSettings(configIssueIndexes); } catch (FileNotFoundException) { RaiseException("ErrorPHPIniNotFound"); } catch (InvalidOperationException) { RaiseException("ErrorPHPIsNotRegistered"); } }
public object GetConfigIssues() { RemoteObjectCollection <PHPConfigIssue> configIssues = null; try { var mgmtUnitWrapper = new ManagementUnitWrapper(ManagementUnit); var configHelper = new PHPConfigHelper(mgmtUnitWrapper); configIssues = configHelper.ValidateConfiguration(); } catch (FileNotFoundException) { RaiseException("ErrorPHPIniNotFound"); } catch (InvalidOperationException) { RaiseException("ErrorPHPIsNotRegistered"); } return((configIssues != null) ? configIssues.GetData() : null); }
public object GetPHPIniPhysicalPath() { if (!ManagementUnit.Context.IsLocalConnection) { return(null); } string phpiniPath = null; try { var mgmtUnitWrapper = new ManagementUnitWrapper(ManagementUnit); var configHelper = new PHPConfigHelper(mgmtUnitWrapper); phpiniPath = configHelper.PHPIniFilePath; } catch (FileNotFoundException) { RaiseException("ErrorPHPIniNotFound"); } return(phpiniPath); }
public object GetAllPHPVersions() { EnsureServerOrSiteConnection(); RemoteObjectCollection <PHPVersion> versions = null; try { var mgmtUnitWrapper = new ManagementUnitWrapper(ManagementUnit); var configHelper = new PHPConfigHelper(mgmtUnitWrapper); versions = configHelper.GetAllPHPVersions(); } catch (FileNotFoundException) { RaiseException("ErrorPHPIniNotFound"); } catch (InvalidOperationException) { RaiseException("ErrorPHPIsNotRegistered"); } return((versions != null) ? versions.GetData() : null); }
public void AddOrUpdateSettings(object settingsData) { EnsureServerConnection(); var settings = new RemoteObjectCollection <PHPIniSetting>(); settings.SetData(settingsData); try { var mgmtUnitWrapper = new ManagementUnitWrapper(ManagementUnit); var configHelper = new PHPConfigHelper(mgmtUnitWrapper); configHelper.AddOrUpdatePHPIniSettings(settings); } catch (FileNotFoundException) { RaiseException("ErrorPHPIniNotFound"); } catch (InvalidOperationException) { RaiseException("ErrorPHPIsNotRegistered"); } }
public void UpdateExtensions(object extensionsData) { EnsureServerConnection(); var extensions = new RemoteObjectCollection <PHPIniExtension>(); extensions.SetData(extensionsData); try { var mgmtUnitWrapper = new ManagementUnitWrapper(ManagementUnit); var configHelper = new PHPConfigHelper(mgmtUnitWrapper); configHelper.UpdateExtensions(extensions); } catch (FileNotFoundException) { RaiseException("ErrorPHPIniNotFound"); } catch (InvalidOperationException) { RaiseException("ErrorPHPIsNotRegistered"); } }
public void SelectPHPVersion(string name) { EnsureServerOrSiteConnection(); try { var mgmtUnitWrapper = new ManagementUnitWrapper(ManagementUnit); var configHelper = new PHPConfigHelper(mgmtUnitWrapper); configHelper.SelectPHPHandler(name); } catch (FileLoadException) { RaiseException("ErrorSomeHandlersLocked"); } catch (FileNotFoundException) { RaiseException("ErrorPHPIniNotFound"); } catch (InvalidOperationException) { RaiseException("ErrorPHPIsNotRegistered"); } }
public void RemovePHPIniSetting(object settingData) { EnsureServerConnection(); var setting = new PHPIniSetting(); setting.SetData(settingData); try { var mgmtUnitWrapper = new ManagementUnitWrapper(ManagementUnit); var configHelper = new PHPConfigHelper(mgmtUnitWrapper); configHelper.RemovePHPIniSetting(setting); } catch (FileNotFoundException) { RaiseException("ErrorPHPIniNotFound"); } catch (InvalidOperationException) { RaiseException("ErrorPHPIsNotRegistered"); } }
public void RegisterPHPWithIIS(string phpExePath) { EnsureServerConnection(); try { var mgmtUnitWrapper = new ManagementUnitWrapper(ManagementUnit); var configHelper = new PHPConfigHelper(mgmtUnitWrapper); configHelper.RegisterPHPWithIIS(phpExePath); } catch (ArgumentException) { RaiseException("ErrorInvalidPHPExecutablePath"); } catch (FileNotFoundException) { RaiseException("ErrorNoPHPFilesInDirectory"); } catch (DirectoryNotFoundException) { RaiseException("ErrorNoExtDirectory"); } }
public object GetPHPConfigInfo() { EnsureServerOrSiteConnection(); PHPConfigInfo result = null; try { var mgmtUnitWrapper = new ManagementUnitWrapper(ManagementUnit); var configHelper = new PHPConfigHelper(mgmtUnitWrapper); result = configHelper.GetPHPConfigInfo(); } catch (FileNotFoundException) { RaiseException("ErrorPHPIniNotFound"); } catch (InvalidOperationException) { RaiseException("ErrorPHPIsNotRegistered"); } return((result != null) ? result.GetData() : null); }
public object GetPHPIniSettings() { EnsureServerOrSiteConnection(); PHPIniFile file = null; try { var mgmtUnitWrapper = new ManagementUnitWrapper(ManagementUnit); var configHelper = new PHPConfigHelper(mgmtUnitWrapper); file = configHelper.GetPHPIniFile(); } catch (FileNotFoundException) { RaiseException("ErrorPHPIniNotFound"); } catch (InvalidOperationException) { RaiseException("ErrorPHPIsNotRegistered"); } Debug.Assert(file != null); return(file.GetData()); }