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