PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/stable-1.2.0/Client/PHPModuleProxy.cs

#
C# | 131 lines | 98 code | 25 blank | 8 comment | 6 complexity | 72e457eb088ba9a1d892039ec2d0a383 MD5 | raw file
  1//-----------------------------------------------------------------------
  2// <copyright>
  3// Copyright (C) Ruslan Yakushev for the PHP Manager for IIS project.
  4//
  5// This file is subject to the terms and conditions of the Microsoft Public License (MS-PL).
  6// See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL for more details.
  7// </copyright>
  8//----------------------------------------------------------------------- 
  9
 10using System.Collections;
 11using Microsoft.Web.Management.Client;
 12using Web.Management.PHP.Config;
 13
 14namespace Web.Management.PHP
 15{
 16
 17    internal sealed class PHPModuleProxy : ModuleServiceProxy
 18    {
 19
 20        internal string AddExtension(string extensionPath)
 21        {
 22            return (string)Invoke("AddExtension", extensionPath);
 23        }
 24
 25        internal void AddOrUpdateSettings(RemoteObjectCollection<PHPIniSetting> settings)
 26        {
 27            Invoke("AddOrUpdateSettings", settings.GetData());
 28        }
 29
 30        internal void ApplyRecommendedSettings(ArrayList configIssueIndexes)
 31        {
 32            Invoke("ApplyRecommendedSettings", configIssueIndexes);
 33        }
 34
 35        internal bool CheckForLocalPHPHandler(string siteName, string virtualPath)
 36        {
 37            return (bool)Invoke("CheckForLocalPHPHandler", siteName, virtualPath);
 38        }
 39
 40        internal string CreatePHPInfo(string siteName)
 41        {
 42            return (string)Invoke("CreatePHPInfo", siteName);
 43        }
 44
 45        internal RemoteObjectCollection<PHPVersion> GetAllPHPVersions()
 46        {
 47            object o = Invoke("GetAllPHPVersions");
 48
 49            if (o != null)
 50            {
 51                RemoteObjectCollection<PHPVersion> versions = new RemoteObjectCollection<PHPVersion>();
 52                versions.SetData(o);
 53                return versions;
 54            }
 55
 56            return null;
 57        }
 58
 59        internal RemoteObjectCollection<PHPConfigIssue> GetConfigIssues()
 60        {
 61            object o = Invoke("GetConfigIssues");
 62
 63            if (o != null)
 64            {
 65                RemoteObjectCollection<PHPConfigIssue> configIssues = new RemoteObjectCollection<PHPConfigIssue>();
 66                configIssues.SetData(o);
 67                return configIssues;
 68            }
 69
 70            return null;
 71        }
 72
 73        internal PHPConfigInfo GetPHPConfigInfo()
 74        {
 75            object o = Invoke("GetPHPConfigInfo");
 76            PHPConfigInfo result = null;
 77            if (o != null)
 78            {
 79                result = new PHPConfigInfo();
 80                result.SetData(o);
 81            }            
 82            return result;
 83        }
 84
 85        internal string GetPHPIniPhysicalPath()
 86        {
 87            return (string)Invoke("GetPHPIniPhysicalPath");
 88        }
 89
 90        internal object GetPHPIniSettings()
 91        {
 92            return Invoke("GetPHPIniSettings");
 93        }
 94
 95        internal ArrayList GetSiteBindings(string siteName)
 96        {
 97            return (ArrayList)Invoke("GetSiteBindings", siteName);
 98        }
 99
100        internal ArrayList GetSites()
101        {
102            return (ArrayList)Invoke("GetSites");
103        }
104
105        internal void RegisterPHPWithIIS(string path)
106        {
107            Invoke("RegisterPHPWithIIS", path);
108        }
109
110        internal void RemovePHPInfo(string filePath)
111        {
112            Invoke("RemovePHPInfo", filePath);
113        }
114
115        internal void RemoveSetting(PHPIniSetting setting)
116        {
117            Invoke("RemovePHPIniSetting", setting.GetData());
118        }
119
120        internal void SelectPHPVersion(string name)
121        {
122            Invoke("SelectPHPVersion", name);
123        }
124
125        internal void UpdateExtensions(RemoteObjectCollection<PHPIniExtension> extensions)
126        {
127            Invoke("UpdateExtensions", extensions.GetData());
128        }
129
130    }
131}