├── .gitattributes
├── .gitignore
├── Client
├── .refsignored
├── Config
│ ├── PHPConfigInfo.cs
│ ├── PHPConfigIssue.cs
│ ├── PHPIniFile.cs
│ ├── PHPRegistrationType.cs
│ └── PHPVersion.cs
├── Extensions
│ ├── AddExtensionDialog.cs
│ └── AllExtensionsPage.cs
├── Globals.cs
├── Helper.cs
├── Languages
│ ├── Resources.de-DE.resx
│ ├── Resources.fr-FR.resx
│ ├── Resources.ja-JP.resx
│ ├── Resources.nl-NL.resx
│ ├── Resources.ru-RU.resx
│ └── Resources.tr-TR.resx
├── NewPHPMGRSNF.snk
├── PHPManagerClient.csproj
├── PHPManagerClient.csproj.user
├── PHPModule.cs
├── PHPModuleProxy.cs
├── PHPPage.cs
├── PHPPageItemControl.Designer.cs
├── PHPPageItemControl.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── RemoteObject.cs
├── Resources.Designer.cs
├── Resources.resx
├── Resources
│ ├── Delete16.png
│ ├── goBack16.png
│ ├── php-extensions32.png
│ ├── php-logo16.png
│ ├── php-logo32.png
│ ├── php-settings32.png
│ ├── php-setup32.png
│ └── warning16.png
├── Settings
│ ├── AddEditSettingDialog.cs
│ ├── AllSettingsPage.cs
│ ├── ErrorReportingPage.cs
│ ├── RuntimeLimitSettings.cs
│ ├── RuntimeLimitsGlobals.cs
│ ├── RuntimeLimitsPage.cs
│ ├── SettingCategoryAttribute.cs
│ ├── SettingDescriptionAttribute.cs
│ ├── SettingDisplayNameAttribute.cs
│ └── SettingPropertyGridObject.cs
├── Setup
│ ├── ChangeVersionDialog.cs
│ ├── PHPInfoPage.cs
│ ├── RecommendedConfigDialog.cs
│ ├── RegisterPHPDialog.cs
│ └── SelectSiteAndUrlDialog.cs
├── app.config
└── packages.config
├── LICENSE
├── NewPHPMGRSNF.snk
├── PHPManager.sln
├── Powershell
├── BaseCmdlet.cs
├── Documentation
│ ├── Remove-WarningStuff.ps1
│ ├── Web.Management.PHP.PowerShell.dll-Help.xml
│ └── copyhelp.bat
├── GetPHPConfigurationCmdlet.cs
├── GetPHPExtensionCmdlet.cs
├── GetPHPSettingCmdlet.cs
├── GetPHPVersionCmdlet.cs
├── Helper.cs
├── Installer.cs
├── NewPHPMGRSNF.snk
├── NewPHPSettingCmdlet.cs
├── NewPHPVersionCmdlet.cs
├── PHPConfigurationItem.cs
├── PHPExtensionItem.cs
├── PHPManagerPowershell.csproj
├── PHPSettingItem.cs
├── PHPVersionItem.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── RemovePHPSettingCmdlet.cs
├── Resources.Designer.cs
├── Resources.resx
├── SetPHPExtensionCmdlet.cs
├── SetPHPSettingCmdlet.cs
├── SetPHPVersionCmdlet.cs
├── app.config
└── packages.config
├── README.md
├── Server
├── .refsignored
├── Config
│ ├── IConfigurationWrapper.cs
│ ├── ManagementUnitWrapper.cs
│ ├── PHPConfigHelper.cs
│ └── ServerManagerWrapper.cs
├── DefaultDocument
│ ├── DefaultDocumentSection.cs
│ ├── FileElement.cs
│ └── FilesCollection.cs
├── FastCgi
│ ├── ApplicationCollection.cs
│ ├── ApplicationElement.cs
│ ├── EnvironmentVariableElement.cs
│ ├── EnvironmentVariablesCollection.cs
│ ├── FastCgiSection.cs
│ ├── Protocol.cs
│ └── StderrMode.cs
├── Handlers
│ ├── HandlerElement.cs
│ ├── HandlersCollection.cs
│ ├── HandlersSection.cs
│ ├── RequireAccess.cs
│ └── ResourceType.cs
├── NewPHPMGRSNF.snk
├── PHPManager.csproj
├── PHPProvider.cs
├── PHPService.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── Resources.Designer.cs
├── Resources.resx
├── Settings.cs
└── packages.config
├── Setup
├── License.rtf
├── PHPManagerSetup.vdproj
├── PHPManagerSetupHelper
│ ├── InstallUtil.cs
│ ├── NewPHPMGRSNF.snk
│ ├── PHPManagerSetupHelper.csproj
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── SetupAction.cs
│ ├── app.config
│ └── packages.config
└── php-logo16.ico
├── SharedAssembyInfo.cs
└── bin
└── Release
└── PHPManagerForIIS.msi
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | [Xx]64/
19 | [Xx]86/
20 | [Bb]uild/
21 | bld/
22 | [Bb]in/
23 | [Oo]bj/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | artifacts/
46 |
47 | *_i.c
48 | *_p.c
49 | *_i.h
50 | *.ilk
51 | *.meta
52 | *.obj
53 | *.pch
54 | *.pdb
55 | *.pgc
56 | *.pgd
57 | *.rsp
58 | *.sbr
59 | *.tlb
60 | *.tli
61 | *.tlh
62 | *.tmp
63 | *.tmp_proj
64 | *.log
65 | *.vspscc
66 | *.vssscc
67 | .builds
68 | *.pidb
69 | *.svclog
70 | *.scc
71 |
72 | # Chutzpah Test files
73 | _Chutzpah*
74 |
75 | # Visual C++ cache files
76 | ipch/
77 | *.aps
78 | *.ncb
79 | *.opendb
80 | *.opensdf
81 | *.sdf
82 | *.cachefile
83 | *.VC.db
84 |
85 | # Visual Studio profiler
86 | *.psess
87 | *.vsp
88 | *.vspx
89 | *.sap
90 |
91 | # TFS 2012 Local Workspace
92 | $tf/
93 |
94 | # Guidance Automation Toolkit
95 | *.gpState
96 |
97 | # ReSharper is a .NET coding add-in
98 | _ReSharper*/
99 | *.[Rr]e[Ss]harper
100 | *.DotSettings.user
101 |
102 | # JustCode is a .NET coding add-in
103 | .JustCode
104 |
105 | # TeamCity is a build add-in
106 | _TeamCity*
107 |
108 | # DotCover is a Code Coverage Tool
109 | *.dotCover
110 |
111 | # NCrunch
112 | _NCrunch_*
113 | .*crunch*.local.xml
114 | nCrunchTemp_*
115 |
116 | # MightyMoose
117 | *.mm.*
118 | AutoTest.Net/
119 |
120 | # Web workbench (sass)
121 | .sass-cache/
122 |
123 | # Installshield output folder
124 | [Ee]xpress/
125 |
126 | # DocProject is a documentation generator add-in
127 | DocProject/buildhelp/
128 | DocProject/Help/*.HxT
129 | DocProject/Help/*.HxC
130 | DocProject/Help/*.hhc
131 | DocProject/Help/*.hhk
132 | DocProject/Help/*.hhp
133 | DocProject/Help/Html2
134 | DocProject/Help/html
135 |
136 | # Click-Once directory
137 | publish/
138 |
139 | # Publish Web Output
140 | *.[Pp]ublish.xml
141 | *.azurePubxml
142 |
143 | # TODO: Un-comment the next line if you do not want to checkin
144 | # your web deploy settings because they may include unencrypted
145 | # passwords
146 | #*.pubxml
147 | *.publishproj
148 |
149 | # NuGet Packages
150 | *.nupkg
151 | # The packages folder can be ignored because of Package Restore
152 | **/packages/*
153 | # except build/, which is used as an MSBuild target.
154 | !**/packages/build/
155 | # Uncomment if necessary however generally it will be regenerated when needed
156 | #!**/packages/repositories.config
157 | # NuGet v3's project.json files produces more ignoreable files
158 | *.nuget.props
159 | *.nuget.targets
160 |
161 | # Microsoft Azure Build Output
162 | csx/
163 | *.build.csdef
164 |
165 | # Microsoft Azure Emulator
166 | ecf/
167 | rcf/
168 |
169 | # Microsoft Azure ApplicationInsights config file
170 | ApplicationInsights.config
171 |
172 | # Windows Store app package directory
173 | AppPackages/
174 | BundleArtifacts/
175 |
176 | # Visual Studio cache files
177 | # files ending in .cache can be ignored
178 | *.[Cc]ache
179 | # but keep track of directories ending in .cache
180 | !*.[Cc]ache/
181 |
182 | # Others
183 | ClientBin/
184 | [Ss]tyle[Cc]op.*
185 | ~$*
186 | *~
187 | *.dbmdl
188 | *.dbproj.schemaview
189 | #*.pfx
190 | *.publishsettings
191 | node_modules/
192 | orleans.codegen.cs
193 |
194 | # RIA/Silverlight projects
195 | Generated_Code/
196 |
197 | # Backup & report files from converting an old project file
198 | # to a newer Visual Studio version. Backup files are not needed,
199 | # because we have git ;-)
200 | _UpgradeReport_Files/
201 | Backup*/
202 | UpgradeLog*.XML
203 | UpgradeLog*.htm
204 |
205 | # SQL Server files
206 | *.mdf
207 | *.ldf
208 |
209 | # Business Intelligence projects
210 | *.rdl.data
211 | *.bim.layout
212 | *.bim_*.settings
213 |
214 | # Microsoft Fakes
215 | FakesAssemblies/
216 |
217 | # GhostDoc plugin setting file
218 | *.GhostDoc.xml
219 |
220 | # Node.js Tools for Visual Studio
221 | .ntvs_analysis.dat
222 |
223 | # Visual Studio 6 build log
224 | *.plg
225 |
226 | # Visual Studio 6 workspace options file
227 | *.opt
228 |
229 | # Visual Studio LightSwitch build output
230 | **/*.HTMLClient/GeneratedArtifacts
231 | **/*.DesktopClient/GeneratedArtifacts
232 | **/*.DesktopClient/ModelManifest.xml
233 | **/*.Server/GeneratedArtifacts
234 | **/*.Server/ModelManifest.xml
235 | _Pvt_Extensions
236 |
237 | # LightSwitch generated files
238 | GeneratedArtifacts/
239 | ModelManifest.xml
240 |
241 | # Paket dependency manager
242 | .paket/paket.exe
243 |
244 | # FAKE - F# Make
245 | .fake/
--------------------------------------------------------------------------------
/Client/.refsignored:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RonaldCarter/PHPManager/f6cc53a7b6bae0c655331582c52ab5093602db97/Client/.refsignored
--------------------------------------------------------------------------------
/Client/Config/PHPConfigInfo.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 |
12 | namespace Web.Management.PHP.Config
13 | {
14 |
15 | public sealed class PHPConfigInfo : IRemoteObject
16 | {
17 | private object[] _data;
18 |
19 | private const int IndexPHPRegistrationType = 0;
20 | private const int IndexHandlerName = 1;
21 | private const int IndexHandlerIsLocal = 2;
22 | private const int IndexExecutable = 3;
23 | private const int IndexVersion = 4;
24 | private const int IndexPHPIniFilePath = 5;
25 | private const int IndexErrorLog = 6;
26 | private const int IndexEnabledExtCount = 7;
27 | private const int IndexInstalledExtCount = 8;
28 | private const int IndexIsConfigOptimal = 9;
29 |
30 | private const int Size = 10;
31 |
32 | public PHPConfigInfo()
33 | {
34 | _data = new object[Size];
35 | HandlerName = String.Empty;
36 | HandlerIsLocal = false;
37 | Executable = String.Empty;
38 | Version = String.Empty;
39 | PHPIniFilePath = String.Empty;
40 | ErrorLog = String.Empty;
41 | EnabledExtCount = 0;
42 | InstalledExtCount = 0;
43 | IsConfigOptimal = false;
44 | }
45 |
46 | public int EnabledExtCount
47 | {
48 | get
49 | {
50 | return (int)_data[IndexEnabledExtCount];
51 | }
52 | set
53 | {
54 | _data[IndexEnabledExtCount] = value;
55 | }
56 | }
57 |
58 | public string ErrorLog
59 | {
60 | get
61 | {
62 | return (string)_data[IndexErrorLog];
63 | }
64 | set
65 | {
66 | _data[IndexErrorLog] = value;
67 | }
68 | }
69 |
70 | public string Executable
71 | {
72 | get
73 | {
74 | return (string)_data[IndexExecutable];
75 | }
76 | set
77 | {
78 | _data[IndexExecutable] = value;
79 | }
80 | }
81 |
82 | public bool HandlerIsLocal
83 | {
84 | get
85 | {
86 | return (bool)_data[IndexHandlerIsLocal];
87 | }
88 | set
89 | {
90 | _data[IndexHandlerIsLocal] = value;
91 | }
92 | }
93 |
94 | public string HandlerName
95 | {
96 | get
97 | {
98 | return (string)_data[IndexHandlerName];
99 | }
100 | set
101 | {
102 | _data[IndexHandlerName] = value;
103 | }
104 | }
105 |
106 | public int InstalledExtCount
107 | {
108 | get
109 | {
110 | return (int)_data[IndexInstalledExtCount];
111 | }
112 | set
113 | {
114 | _data[IndexInstalledExtCount] = value;
115 | }
116 | }
117 |
118 | public bool IsConfigOptimal
119 | {
120 | get
121 | {
122 | return (bool)_data[IndexIsConfigOptimal];
123 | }
124 | set
125 | {
126 | _data[IndexIsConfigOptimal] = value;
127 | }
128 | }
129 |
130 | public string PHPIniFilePath
131 | {
132 | get
133 | {
134 | return (string)_data[IndexPHPIniFilePath];
135 | }
136 | set
137 | {
138 | _data[IndexPHPIniFilePath] = value;
139 | }
140 | }
141 |
142 | public PHPRegistrationType RegistrationType
143 | {
144 | get
145 | {
146 | return (PHPRegistrationType)_data[IndexPHPRegistrationType];
147 | }
148 | set
149 | {
150 | _data[IndexPHPRegistrationType] = (int)value;
151 | }
152 | }
153 |
154 | public string Version
155 | {
156 | get
157 | {
158 | return (string)_data[IndexVersion];
159 | }
160 | set
161 | {
162 | _data[IndexVersion] = value;
163 | }
164 | }
165 |
166 | #region IRemoteObject Members
167 |
168 | public object GetData()
169 | {
170 | return _data;
171 | }
172 |
173 | public void SetData(object o)
174 | {
175 | _data = (object[])o;
176 | }
177 |
178 | #endregion
179 | }
180 | }
--------------------------------------------------------------------------------
/Client/Config/PHPConfigIssue.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | namespace Web.Management.PHP.Config
11 | {
12 |
13 | public static class PHPConfigIssueIndex
14 | {
15 | public const int DefaultDocument = 0;
16 | public const int ResourceType = 1;
17 | public const int PHPMaxRequests = 2;
18 | public const int PHPRC = 3;
19 | public const int MonitorChangesTo = 4;
20 | public const int ExtensionDir = 5;
21 | public const int LogErrors = 6;
22 | public const int ErrorLog = 7;
23 | public const int SessionPath = 8;
24 | public const int CgiForceRedirect = 9;
25 | public const int CgiPathInfo = 10;
26 | public const int FastCgiImpersonation = 11;
27 | public const int UploadDir = 12;
28 | public const int DateTimeZone = 13;
29 | }
30 |
31 | public class PHPConfigIssue : IRemoteObject
32 | {
33 | private object[] _data;
34 | private const int Size = 6;
35 | private const int IndexName = 0;
36 | private const int IndexCurrentValue = 1;
37 | private const int IndexRecommendeValue = 2;
38 | private const int IndexIssueDescription = 3;
39 | private const int IndexRecommendation = 4;
40 | private const int IndexIssueIndex = 5;
41 |
42 | public PHPConfigIssue()
43 | {
44 | _data = new object[Size];
45 | }
46 |
47 | public PHPConfigIssue(string name, string currentValue, string recommendedValue, string issueDescription, string recommendation, int issueIndex)
48 | {
49 | _data = new object[Size];
50 | SettingName = name;
51 | CurrentValue = currentValue;
52 | RecommendedValue = recommendedValue;
53 | IssueDescription = issueDescription;
54 | Recommendation = recommendation;
55 | IssueIndex = issueIndex;
56 | }
57 |
58 | public string CurrentValue
59 | {
60 | get
61 | {
62 | return (string)_data[IndexCurrentValue];
63 | }
64 | set
65 | {
66 | _data[IndexCurrentValue] = value;
67 | }
68 | }
69 |
70 | public string IssueDescription
71 | {
72 | get
73 | {
74 | return (string)_data[IndexIssueDescription];
75 | }
76 | set
77 | {
78 | _data[IndexIssueDescription] = value;
79 | }
80 | }
81 |
82 | public int IssueIndex
83 | {
84 | get
85 | {
86 | return (int)_data[IndexIssueIndex];
87 | }
88 | set
89 | {
90 | _data[IndexIssueIndex] = value;
91 | }
92 | }
93 |
94 | public string Recommendation
95 | {
96 | get
97 | {
98 | return (string)_data[IndexRecommendation];
99 | }
100 | set
101 | {
102 | _data[IndexRecommendation] = value;
103 | }
104 | }
105 |
106 | public string RecommendedValue
107 | {
108 | get
109 | {
110 | return (string)_data[IndexRecommendeValue];
111 | }
112 | set
113 | {
114 | _data[IndexRecommendeValue] = value;
115 | }
116 | }
117 |
118 | public string SettingName
119 | {
120 | get
121 | {
122 | return (string)_data[IndexName];
123 | }
124 | set
125 | {
126 | _data[IndexName] = value;
127 | }
128 | }
129 |
130 | public object GetData()
131 | {
132 | return _data;
133 | }
134 |
135 | public void SetData(object o)
136 | {
137 | _data = (object[])o;
138 | }
139 | }
140 | }
141 |
--------------------------------------------------------------------------------
/Client/Config/PHPRegistrationType.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | namespace Web.Management.PHP.Config
11 | {
12 |
13 | public enum PHPRegistrationType
14 | {
15 | FastCgi,
16 | Cgi,
17 | Isapi,
18 | None,
19 | NoneNoFastCgi
20 | }
21 | }
--------------------------------------------------------------------------------
/Client/Config/PHPVersion.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 |
12 | namespace Web.Management.PHP.Config
13 | {
14 |
15 | // Used internally for the select version combo box
16 | public sealed class PHPVersion : IRemoteObject
17 | {
18 | private object[] _data;
19 |
20 | private const int IndexHandlerName = 0;
21 | private const int IndexScriptProcessor = 1;
22 | private const int IndexVersion = 2;
23 |
24 | private const int Size = 3;
25 |
26 | public PHPVersion()
27 | {
28 | _data = new object[Size];
29 | HandlerName = String.Empty;
30 | ScriptProcessor = String.Empty;
31 | Version = String.Empty;
32 | }
33 |
34 | public PHPVersion(string name, string scriptProcessor, string version)
35 | {
36 | _data = new object[Size];
37 | HandlerName = name;
38 | ScriptProcessor = scriptProcessor;
39 | Version = version;
40 | }
41 |
42 | public string HandlerName
43 | {
44 | get
45 | {
46 | return (string)_data[IndexHandlerName];
47 | }
48 | set
49 | {
50 | _data[IndexHandlerName] = value;
51 | }
52 | }
53 |
54 | public string ScriptProcessor
55 | {
56 | get
57 | {
58 | return (string)_data[IndexScriptProcessor];
59 | }
60 | set
61 | {
62 | _data[IndexScriptProcessor] = value;
63 | }
64 | }
65 |
66 | public string Version
67 | {
68 | get
69 | {
70 | return (string)_data[IndexVersion];
71 | }
72 | set
73 | {
74 | _data[IndexVersion] = value;
75 | }
76 | }
77 |
78 | #region IRemoteObject Members
79 |
80 | public object GetData()
81 | {
82 | return _data;
83 | }
84 |
85 | public void SetData(object o)
86 | {
87 | _data = (object[])o;
88 | }
89 |
90 | #endregion
91 |
92 | }
93 |
94 | }
95 |
--------------------------------------------------------------------------------
/Client/Globals.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 |
11 | namespace Web.Management.PHP
12 | {
13 |
14 | internal static class Globals {
15 |
16 | public const string PHPPageIdentifier = "3b388931-63a7-48f4-a6fc-464b05a44160";
17 | public const string PHPInfoPageIdentifier = "21a5d44d-3a61-44f1-91ef-5965c6e0e3e2";
18 | public const string PHPSettingsPageIdentifier = "d021b245-cbd8-48e7-bdfe-7e8a1a457b38";
19 | public const string PHPExtensionsPageIdentifier = "3449ff77-1f5c-4ba1-80cb-80f12512e367";
20 | public const string ErrorReportingPageIdentifier = "f52b2450-4b78-4602-a7e8-c8d9257a2c25";
21 | public const string RuntimeLimitsPageIdentifier = "4f13ca20-adc1-4fa8-aba7-5d537746d304";
22 |
23 | public const string PHPPageOnlineHelp = "http://phpmanager.codeplex.com/documentation";
24 |
25 | public const string RegisterPHPOnlineHelp = "http://phpmanager.codeplex.com/documentation";
26 | public const string ChangeVersionOnlineHelp = "http://phpmanager.codeplex.com/documentation";
27 | public const string SelectSiteDomainOnlineHelp = "http://phpmanager.codeplex.com/documentation";
28 | public const string PHPInfoPageOnlineHelp = "http://phpmanager.codeplex.com/documentation";
29 | public const string RecommendedConfigOnlineHelp = "http://phpmanager.codeplex.com/documentation";
30 |
31 | public const string ErrorReportingOnlineHelp = "http://phpmanager.codeplex.com/documentation";
32 | public const string RuntimeLimitsOnlineHelp = "http://phpmanager.codeplex.com/documentation";
33 | public const string AllSettingsOnlineHelp = "http://phpmanager.codeplex.com/documentation";
34 |
35 | public const string AllExtensionsOnlineHelp = "http://phpmanager.codeplex.com/documentation";
36 | public const string AddExtensionOnlineHelp = "http://phpmanager.codeplex.com/documentation";
37 |
38 | public const string EnableFastCgiLearnMore = "http://www.php.net/manual/{0}/install.windows.iis7.php";
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Client/Helper.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using System.Collections;
12 | using System.Collections.Generic;
13 | using System.Diagnostics;
14 | using System.Diagnostics.CodeAnalysis;
15 |
16 | namespace Web.Management.PHP
17 | {
18 |
19 | internal static class Helper
20 | {
21 |
22 | internal static bool Browse(string url)
23 | {
24 | if (url != null &&
25 | (url.StartsWith("http://", StringComparison.OrdinalIgnoreCase)) ||
26 | url.StartsWith("https://", StringComparison.OrdinalIgnoreCase))
27 | {
28 | try
29 | {
30 | Process.Start(url);
31 | return true;
32 | }
33 | catch
34 | {
35 | }
36 | }
37 | return false;
38 | }
39 |
40 | internal static string EnsureTrailingSlash(string path)
41 | {
42 | if (!path.EndsWith("/", StringComparison.Ordinal))
43 | {
44 | path = path + "/";
45 | }
46 |
47 | return path;
48 | }
49 |
50 | internal static string GetURLFromBinding(string serverName, string bindingProtocol, string bindingInformation)
51 | {
52 | string ipAddress = String.Empty;
53 | string port = String.Empty;
54 | string hostHeader = String.Empty;
55 |
56 | string[] values = bindingInformation.Split(':');
57 | if (values.Length == 3)
58 | {
59 | ipAddress = values[0];
60 | port = values[1];
61 | hostHeader = values[2];
62 | }
63 | else
64 | {
65 | // if it's a ipv6 address, the bindingInformation can look like:
66 | //"[3ffe:8311:ffff:f70f:0:5efe:172.30.188.251]:80:hostheader"
67 | if (values.Length > 2)
68 | {
69 | // look for the last delimiter for the hostheader
70 | int lastOne = bindingInformation.LastIndexOf(':');
71 |
72 | // look for the last delimiter for the port
73 | string tempString = bindingInformation.Substring(0, lastOne);
74 | int secondLastOne = tempString.LastIndexOf(':');
75 |
76 | // everything before that colon is the ip address
77 | ipAddress = bindingInformation.Substring(0, secondLastOne);
78 | port = values[values.Length - 2];
79 | hostHeader = values[values.Length - 1];
80 | }
81 | }
82 |
83 | if (port == "80")
84 | {
85 | port = null;
86 | }
87 |
88 | // check if the binding has a hostheader, if it does than just use that
89 | // as the ip address
90 | if (!string.IsNullOrEmpty(hostHeader))
91 | {
92 | ipAddress = hostHeader;
93 | }
94 | else
95 | {
96 | // host header wasnt set, so lets see if there is any specified ip address
97 | // if there is, then just use that as the ip address.
98 | if (string.IsNullOrEmpty(ipAddress))
99 | {
100 | ipAddress = serverName;
101 | }
102 | else
103 | {
104 | if (String.Equals(ipAddress, "*", StringComparison.OrdinalIgnoreCase))
105 | {
106 | ipAddress = serverName;
107 | }
108 | }
109 | }
110 | if (port != null)
111 | {
112 | return bindingProtocol + "://" + ipAddress + ":" + port + "/";
113 | }
114 |
115 | return bindingProtocol + "://" + ipAddress + "/";
116 | }
117 |
118 | ///
119 | /// returns a list of URLs based on the bindings provided and the server name.
120 | ///
121 | ///
122 | /// Arraylist of string[] {bindingProtocol, bindingInformation}
123 | ///
124 | [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
125 | internal static List GetUrlListFromBindings(string serverName, ArrayList bindings, string relativePath)
126 | {
127 | List urls = new List();
128 |
129 | foreach (string[] b in bindings)
130 | {
131 | string url = Helper.GetURLFromBinding(serverName, (string)b[0], (string)b[1]);
132 | try
133 | {
134 | Uri siteURI = new Uri(url);
135 | Uri uri = new Uri(siteURI, relativePath);
136 |
137 | string absoluteURL = uri.AbsoluteUri;
138 | urls.Add(EnsureTrailingSlash(absoluteURL));
139 | }
140 | catch
141 | {
142 | }
143 | }
144 |
145 | return urls;
146 | }
147 | }
148 | }
--------------------------------------------------------------------------------
/Client/NewPHPMGRSNF.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RonaldCarter/PHPManager/f6cc53a7b6bae0c655331582c52ab5093602db97/Client/NewPHPMGRSNF.snk
--------------------------------------------------------------------------------
/Client/PHPManagerClient.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Program
5 | C:\windows\System32\inetsrv\InetMgr.exe
6 | true
7 | localhost
8 |
9 |
--------------------------------------------------------------------------------
/Client/PHPModule.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using System.Diagnostics;
12 | using Microsoft.Web.Management.Client;
13 | using Microsoft.Web.Management.Server;
14 | using Web.Management.PHP.Extensions;
15 | using Web.Management.PHP.Settings;
16 | using Web.Management.PHP.Setup;
17 |
18 | namespace Web.Management.PHP
19 | {
20 |
21 | internal sealed class PHPModule : Module
22 | {
23 | private PHPModuleProxy _proxy;
24 |
25 | internal PHPModuleProxy Proxy
26 | {
27 | get
28 | {
29 | if (_proxy == null)
30 | {
31 | Connection connection = (Connection)GetService(typeof(Connection));
32 | _proxy = (PHPModuleProxy)connection.CreateProxy(this, typeof(PHPModuleProxy));
33 | }
34 |
35 | return _proxy;
36 | }
37 | }
38 |
39 | protected override void Initialize(IServiceProvider serviceProvider, ModuleInfo moduleInfo)
40 | {
41 | base.Initialize(serviceProvider, moduleInfo);
42 |
43 | IControlPanel controlPanel = (IControlPanel)GetService(typeof(IControlPanel));
44 | Debug.Assert(controlPanel != null, "Couldn't get IControlPanel");
45 |
46 | //PHPInfo page
47 | ModulePageInfo modulePageInfo = new ModulePageInfo(this,
48 | typeof(PHPInfoPage), Resources.PHPInfoPageTitle, Resources.PHPInfoPageDescription,
49 | Resources.PHPLogo16, Resources.PHPLogo32, Resources.PHPInfoPageLongDescription);
50 |
51 | controlPanel.RegisterPage(modulePageInfo);
52 |
53 | //PHP Settings page
54 | modulePageInfo = new ModulePageInfo(this,
55 | typeof(AllSettingsPage), Resources.AllSettingsPageTitle, Resources.AllSettingsPageDescription,
56 | Resources.PHPLogo16, Resources.PHPLogo32, Resources.AllSettingsPageLongDescription);
57 |
58 | controlPanel.RegisterPage(modulePageInfo);
59 |
60 | modulePageInfo = new ModulePageInfo(this,
61 | typeof(ErrorReportingPage), Resources.ErrorReportingPageTitle, Resources.ErrorReportingPageDescription,
62 | Resources.PHPLogo16, Resources.PHPLogo32, Resources.ErrorReportingPageLongDescription);
63 |
64 | controlPanel.RegisterPage(modulePageInfo);
65 |
66 | modulePageInfo = new ModulePageInfo(this,
67 | typeof(RuntimeLimitsPage), Resources.RuntimeLimitsPageTitle, Resources.RuntimeLimitsPageDescription,
68 | Resources.PHPLogo16, Resources.PHPLogo32, Resources.RuntimeLimitsPageLongDescription);
69 |
70 | controlPanel.RegisterPage(modulePageInfo);
71 |
72 | //PHP Extensions page
73 | modulePageInfo = new ModulePageInfo(this,
74 | typeof(AllExtensionsPage), Resources.AllExtensionsPageTitle, Resources.AllExtensionsPageDescription,
75 | Resources.PHPLogo16, Resources.PHPLogo32, Resources.AllExtensionsPageLongDescription);
76 |
77 | controlPanel.RegisterPage(modulePageInfo);
78 |
79 |
80 | //PHPPage - PHP feature start page
81 | modulePageInfo = new ModulePageInfo(this,
82 | typeof(PHPPage), Resources.PHPPageTitle, Resources.PHPPageDescription,
83 | Resources.PHPLogo16, Resources.PHPLogo32, Resources.PHPPageLongDescription);
84 |
85 | controlPanel.RegisterPage(ControlPanelCategoryInfo.Iis, modulePageInfo);
86 | controlPanel.RegisterPage(ControlPanelCategoryInfo.ApplicationDevelopment, modulePageInfo);
87 | }
88 |
89 | protected override bool IsPageEnabled(ModulePageInfo pageInfo)
90 | {
91 | Connection connection = (Connection)GetService(typeof(Connection));
92 |
93 | // We want the module configuration to be available on all levels except file.
94 | return (connection.ConfigurationPath.PathType != ConfigurationPathType.File);
95 | }
96 |
97 | }
98 | }
--------------------------------------------------------------------------------
/Client/PHPModuleProxy.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System.Collections;
11 | using Microsoft.Web.Management.Client;
12 | using Web.Management.PHP.Config;
13 |
14 | namespace 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 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 GetAllPHPVersions()
46 | {
47 | object o = Invoke("GetAllPHPVersions");
48 |
49 | if (o != null)
50 | {
51 | RemoteObjectCollection versions = new RemoteObjectCollection();
52 | versions.SetData(o);
53 | return versions;
54 | }
55 |
56 | return null;
57 | }
58 |
59 | internal RemoteObjectCollection GetConfigIssues()
60 | {
61 | object o = Invoke("GetConfigIssues");
62 |
63 | if (o != null)
64 | {
65 | RemoteObjectCollection configIssues = new RemoteObjectCollection();
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 extensions)
126 | {
127 | Invoke("UpdateExtensions", extensions.GetData());
128 | }
129 |
130 | }
131 | }
--------------------------------------------------------------------------------
/Client/PHPPageItemControl.Designer.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 |
11 | namespace Web.Management.PHP {
12 | partial class PHPPageItemControl {
13 | ///
14 | /// Required designer variable.
15 | ///
16 | private System.ComponentModel.IContainer components = null;
17 |
18 | ///
19 | /// Clean up any resources being used.
20 | ///
21 | /// true if managed resources should be disposed; otherwise, false.
22 | protected override void Dispose(bool disposing) {
23 | if (disposing && (components != null)) {
24 | components.Dispose();
25 | }
26 | base.Dispose(disposing);
27 | }
28 |
29 | #region Component Designer generated code
30 |
31 | ///
32 | /// Required method for Designer support - do not modify
33 | /// the contents of this method with the code editor.
34 | ///
35 | private void InitializeComponent() {
36 | this._pictureBox = new System.Windows.Forms.PictureBox();
37 | this._titleLabel = new System.Windows.Forms.LinkLabel();
38 | this._tasksLabel = new System.Windows.Forms.LinkLabel();
39 | this._infoTlp = new System.Windows.Forms.TableLayoutPanel();
40 | this._warningPanel = new System.Windows.Forms.Panel();
41 | this._warningPicture = new System.Windows.Forms.PictureBox();
42 | ((System.ComponentModel.ISupportInitialize)(this._pictureBox)).BeginInit();
43 | this._warningPanel.SuspendLayout();
44 | ((System.ComponentModel.ISupportInitialize)(this._warningPicture)).BeginInit();
45 | this.SuspendLayout();
46 | //
47 | // _pictureBox
48 | //
49 | this._pictureBox.Location = new System.Drawing.Point(24, 10);
50 | this._pictureBox.Name = "_pictureBox";
51 | this._pictureBox.Size = new System.Drawing.Size(32, 32);
52 | this._pictureBox.TabIndex = 0;
53 | this._pictureBox.TabStop = false;
54 | //
55 | // _titleLabel
56 | //
57 | this._titleLabel.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
58 | this._titleLabel.LinkColor = System.Drawing.SystemColors.ControlText;
59 | this._titleLabel.Location = new System.Drawing.Point(62, 4);
60 | this._titleLabel.Name = "_titleLabel";
61 | this._titleLabel.Size = new System.Drawing.Size(442, 32);
62 | this._titleLabel.TabIndex = 0;
63 | this._titleLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
64 | //
65 | // _tasksLabel
66 | //
67 | this._tasksLabel.AutoSize = true;
68 | this._tasksLabel.Location = new System.Drawing.Point(65, 116);
69 | this._tasksLabel.Name = "_tasksLabel";
70 | this._tasksLabel.Size = new System.Drawing.Size(0, 13);
71 | this._tasksLabel.TabIndex = 2;
72 | this._tasksLabel.TabStop = true;
73 | this._tasksLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OnTasksLabelLinkClicked);
74 | //
75 | // _infoTlp
76 | //
77 | this._infoTlp.AutoSize = true;
78 | this._infoTlp.BackColor = System.Drawing.Color.Transparent;
79 | this._infoTlp.ColumnCount = 2;
80 | this._infoTlp.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 200F));
81 | this._infoTlp.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 291F));
82 | this._infoTlp.Location = new System.Drawing.Point(65, 69);
83 | this._infoTlp.Name = "_infoTlp";
84 | this._infoTlp.RowCount = 1;
85 | this._infoTlp.RowStyles.Add(new System.Windows.Forms.RowStyle());
86 | this._infoTlp.Size = new System.Drawing.Size(491, 47);
87 | this._infoTlp.TabIndex = 3;
88 | //
89 | // _warningPanel
90 | //
91 | this._warningPanel.BackColor = System.Drawing.SystemColors.Info;
92 | this._warningPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
93 | this._warningPanel.Controls.Add(this._warningPicture);
94 | this._warningPanel.Location = new System.Drawing.Point(65, 40);
95 | this._warningPanel.Name = "_warningPanel";
96 | this._warningPanel.Size = new System.Drawing.Size(439, 23);
97 | this._warningPanel.TabIndex = 4;
98 | this._warningPanel.Visible = false;
99 | //
100 | // _warningPicture
101 | //
102 | this._warningPicture.Image = global::Web.Management.PHP.Resources.Warning16;
103 | this._warningPicture.Location = new System.Drawing.Point(1, 3);
104 | this._warningPicture.Name = "_warningPicture";
105 | this._warningPicture.Size = new System.Drawing.Size(20, 20);
106 | this._warningPicture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
107 | this._warningPicture.TabIndex = 1;
108 | this._warningPicture.TabStop = false;
109 | //
110 | // PHPPageItemControl
111 | //
112 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
113 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
114 | this.Controls.Add(this._warningPanel);
115 | this.Controls.Add(this._infoTlp);
116 | this.Controls.Add(this._tasksLabel);
117 | this.Controls.Add(this._titleLabel);
118 | this.Controls.Add(this._pictureBox);
119 | this.MinimumSize = new System.Drawing.Size(60, 80);
120 | this.Name = "PHPPageItemControl";
121 | this.Size = new System.Drawing.Size(507, 118);
122 | ((System.ComponentModel.ISupportInitialize)(this._pictureBox)).EndInit();
123 | this._warningPanel.ResumeLayout(false);
124 | ((System.ComponentModel.ISupportInitialize)(this._warningPicture)).EndInit();
125 | this.ResumeLayout(false);
126 | this.PerformLayout();
127 |
128 | }
129 |
130 | #endregion
131 |
132 | private System.Windows.Forms.PictureBox _pictureBox;
133 | private System.Windows.Forms.LinkLabel _titleLabel;
134 | private System.Windows.Forms.LinkLabel _tasksLabel;
135 | private System.Windows.Forms.TableLayoutPanel _infoTlp;
136 | private System.Windows.Forms.Panel _warningPanel;
137 | private System.Windows.Forms.PictureBox _warningPicture;
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/Client/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using System.Reflection;
12 | using System.Runtime.InteropServices;
13 |
14 | // General Information about an assembly is controlled through the following
15 | // set of attributes. Change these attribute values to modify the information
16 | // associated with an assembly.
17 | [assembly: AssemblyTitle("Web.Management.PHP.Client")]
18 | [assembly: AssemblyDescription("Client UI module for PHP Manager for IIS")]
19 | [assembly: AssemblyConfiguration("")]
20 |
21 | // Setting ComVisible to false makes the types in this assembly not visible
22 | // to COM components. If you need to access a type in this assembly from
23 | // COM, set the ComVisible attribute to true on that type.
24 | [assembly: ComVisible(false)]
25 |
26 | // The following GUID is for the ID of the typelib if this project is exposed to COM
27 | [assembly: Guid("9dee647e-7757-4c6c-91e1-96a5d876d3cd")]
--------------------------------------------------------------------------------
/Client/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Web.Management.PHP.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.6.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Client/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Client/RemoteObject.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using System.Collections;
12 | using System.Collections.Generic;
13 |
14 | namespace Web.Management.PHP
15 | {
16 |
17 | public sealed class RemoteObjectCollection : IRemoteObject, ICollection, IList where T : IRemoteObject, new()
18 | {
19 |
20 | private List _list;
21 |
22 | public RemoteObjectCollection(ArrayList sourceList)
23 | {
24 | if (sourceList != null)
25 | {
26 | Initialize(sourceList);
27 | }
28 | else
29 | {
30 | _list = new List();
31 | }
32 | }
33 |
34 | public RemoteObjectCollection()
35 | {
36 | _list = new List();
37 | }
38 |
39 | public int Count
40 | {
41 | get
42 | {
43 | return _list.Count;
44 | }
45 | }
46 |
47 | public bool IsReadOnly
48 | {
49 | get
50 | {
51 | return ((IList)_list).IsReadOnly;
52 | }
53 | }
54 |
55 | public T this[int index]
56 | {
57 | get
58 | {
59 | return (T)_list[index];
60 | }
61 | set
62 | {
63 | _list[index] = value;
64 | }
65 | }
66 |
67 | public void Add(T item)
68 | {
69 | _list.Add(item);
70 | }
71 |
72 | public void Clear()
73 | {
74 | _list.Clear();
75 | }
76 |
77 | public bool Contains(T item)
78 | {
79 | return _list.Contains(item);
80 | }
81 |
82 | public void CopyTo(T[] array, int arrayIndex)
83 | {
84 | _list.CopyTo(array, arrayIndex);
85 | }
86 |
87 | public object GetData()
88 | {
89 | ArrayList items = new ArrayList(_list.Count);
90 | foreach (T item in _list)
91 | {
92 | items.Add(item.GetData());
93 | }
94 |
95 | return items;
96 | }
97 |
98 | public IEnumerator GetEnumerator()
99 | {
100 | return _list.GetEnumerator();
101 | }
102 |
103 | public int IndexOf(T item)
104 | {
105 | return _list.IndexOf(item);
106 | }
107 |
108 | private void Initialize(ArrayList sourceList)
109 | {
110 | _list = new List(sourceList.Count);
111 |
112 | foreach (object o in sourceList)
113 | {
114 | T item = new T();
115 | item.SetData(o);
116 | _list.Add(item);
117 | }
118 | }
119 |
120 | public void Insert(int index, T item)
121 | {
122 | _list.Insert(index, item);
123 | }
124 |
125 | public bool Remove(T item)
126 | {
127 | return _list.Remove(item);
128 | }
129 |
130 | public void RemoveAt(int index)
131 | {
132 | _list.RemoveAt(index);
133 | }
134 |
135 | IEnumerator IEnumerable.GetEnumerator()
136 | {
137 | return GetEnumerator();
138 | }
139 |
140 | public void SetData(object o)
141 | {
142 | Initialize((ArrayList)o);
143 | }
144 |
145 | #region ICollection Members
146 |
147 | void ICollection.CopyTo(Array array, int index)
148 | {
149 | ((ICollection)_list).CopyTo(array, index);
150 | }
151 |
152 | bool ICollection.IsSynchronized
153 | {
154 | get
155 | {
156 | return ((ICollection)_list).IsSynchronized;
157 | }
158 | }
159 |
160 | object ICollection.SyncRoot
161 | {
162 | get
163 | {
164 | return ((ICollection)_list).SyncRoot;
165 | }
166 | }
167 |
168 | #endregion
169 | }
170 |
171 | public interface IRemoteObject
172 | {
173 |
174 | object GetData();
175 |
176 | void SetData(object o);
177 |
178 | }
179 | }
--------------------------------------------------------------------------------
/Client/Resources/Delete16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RonaldCarter/PHPManager/f6cc53a7b6bae0c655331582c52ab5093602db97/Client/Resources/Delete16.png
--------------------------------------------------------------------------------
/Client/Resources/goBack16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RonaldCarter/PHPManager/f6cc53a7b6bae0c655331582c52ab5093602db97/Client/Resources/goBack16.png
--------------------------------------------------------------------------------
/Client/Resources/php-extensions32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RonaldCarter/PHPManager/f6cc53a7b6bae0c655331582c52ab5093602db97/Client/Resources/php-extensions32.png
--------------------------------------------------------------------------------
/Client/Resources/php-logo16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RonaldCarter/PHPManager/f6cc53a7b6bae0c655331582c52ab5093602db97/Client/Resources/php-logo16.png
--------------------------------------------------------------------------------
/Client/Resources/php-logo32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RonaldCarter/PHPManager/f6cc53a7b6bae0c655331582c52ab5093602db97/Client/Resources/php-logo32.png
--------------------------------------------------------------------------------
/Client/Resources/php-settings32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RonaldCarter/PHPManager/f6cc53a7b6bae0c655331582c52ab5093602db97/Client/Resources/php-settings32.png
--------------------------------------------------------------------------------
/Client/Resources/php-setup32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RonaldCarter/PHPManager/f6cc53a7b6bae0c655331582c52ab5093602db97/Client/Resources/php-setup32.png
--------------------------------------------------------------------------------
/Client/Resources/warning16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RonaldCarter/PHPManager/f6cc53a7b6bae0c655331582c52ab5093602db97/Client/Resources/warning16.png
--------------------------------------------------------------------------------
/Client/Settings/RuntimeLimitSettings.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System.ComponentModel;
11 | using Microsoft.Web.Management.Client.Win32;
12 | using Microsoft.Web.Management.Server;
13 |
14 | namespace Web.Management.PHP.Settings
15 | {
16 |
17 | internal sealed class RuntimeLimitSettings : SettingPropertyGridObject
18 | {
19 |
20 | private PropertyBag _bag;
21 |
22 | public RuntimeLimitSettings(ModulePropertiesPage page, bool readOnly, PropertyBag bag): base(page, readOnly)
23 | {
24 | Initialize(bag);
25 | }
26 |
27 | [SettingCategory("RuntimeLimitsResourceLimits")]
28 | [SettingDisplayName("RuntimeLimitsMaxExecutionTime", "max_execution_time")]
29 | [SettingDescription("RuntimeLimitsMaxExecutionTimeDescription")]
30 | [DefaultValue(typeof(string), "30")]
31 | public string MaxExecutionTime
32 | {
33 | get
34 | {
35 | object o = _bag[RuntimeLimitsGlobals.MaxExecutionTime];
36 | if (o == null)
37 | {
38 | o = _bag[RuntimeLimitsGlobals.MaxExecutionTime] = "30";
39 | }
40 |
41 | return (string)o;
42 | }
43 | set
44 | {
45 | _bag[RuntimeLimitsGlobals.MaxExecutionTime] = value;
46 | }
47 | }
48 |
49 | [SettingCategory("RuntimeLimitsResourceLimits")]
50 | [SettingDisplayName("RuntimeLimitsMaxFileUploads", "max_file_uploads")]
51 | [SettingDescription("RuntimeLimitsMaxFileUploadsDescription")]
52 | [DefaultValue(typeof(string), "20")]
53 | public string MaxFileUploads
54 | {
55 | get
56 | {
57 | object o = _bag[RuntimeLimitsGlobals.MaxFileUploads];
58 | if (o == null)
59 | {
60 | o =_bag[RuntimeLimitsGlobals.MaxFileUploads] = "20";
61 | }
62 |
63 | return (string)o;
64 | }
65 | set
66 | {
67 | _bag[RuntimeLimitsGlobals.MaxFileUploads] = value;
68 | }
69 | }
70 |
71 | [SettingCategory("RuntimeLimitsResourceLimits")]
72 | [SettingDisplayName("RuntimeLimitsMaxInputTime", "max_input_time")]
73 | [SettingDescription("RuntimeLimitsMaxInputTimeDescription")]
74 | [DefaultValue(typeof(string), "60")]
75 | public string MaxInputTime
76 | {
77 | get
78 | {
79 | object o = _bag[RuntimeLimitsGlobals.MaxInputTime];
80 | if (o == null)
81 | {
82 | o = _bag[RuntimeLimitsGlobals.MaxInputTime] = "60";
83 | }
84 |
85 | return (string)o;
86 | }
87 | set
88 | {
89 | _bag[RuntimeLimitsGlobals.MaxInputTime] = value;
90 | }
91 | }
92 |
93 | [SettingCategory("RuntimeLimitsResourceLimits")]
94 | [SettingDisplayName("RuntimeLimitsMemoryLimit", "memory_limit")]
95 | [SettingDescription("RuntimeLimitsMemoryLimitDescription")]
96 | [DefaultValue(typeof(string), "128M")]
97 | public string MemoryLimit
98 | {
99 | get
100 | {
101 | object o = _bag[RuntimeLimitsGlobals.MemoryLimit];
102 | if (o == null)
103 | {
104 | o = _bag[RuntimeLimitsGlobals.MemoryLimit] = "128M";
105 | }
106 |
107 | return (string)o;
108 | }
109 | set
110 | {
111 | _bag[RuntimeLimitsGlobals.MemoryLimit] = value;
112 | }
113 | }
114 |
115 | [SettingCategory("RuntimeLimitsDataHandling")]
116 | [SettingDisplayName("RuntimeLimitsPostMaxSize", "post_max_size")]
117 | [SettingDescription("RuntimeLimitsPostMaxSizeDescription")]
118 | [DefaultValue(typeof(string), "8M")]
119 | public string PostMaxSize
120 | {
121 | get
122 | {
123 | object o = _bag[RuntimeLimitsGlobals.PostMaxSize];
124 | if (o == null)
125 | {
126 | o = _bag[RuntimeLimitsGlobals.PostMaxSize] = "8M";
127 | }
128 |
129 | return (string)o;
130 | }
131 | set
132 | {
133 | _bag[RuntimeLimitsGlobals.PostMaxSize] = value;
134 | }
135 | }
136 |
137 | [SettingCategory("RuntimeLimitsDataHandling")]
138 | [SettingDisplayName("RuntimeLimitsUploadMaxFilesize", "upload_max_filesize")]
139 | [SettingDescription("RuntimeLimitsUploadMaxFilesizeDescription")]
140 | [DefaultValue(typeof(string), "2M")]
141 | public string UploadMaxFilesize
142 | {
143 | get
144 | {
145 | object o = _bag[RuntimeLimitsGlobals.UploadMaxFilesize];
146 | if (o == null)
147 | {
148 | o = _bag[RuntimeLimitsGlobals.UploadMaxFilesize] = "2M";
149 | }
150 |
151 | return (string)o;
152 | }
153 | set
154 | {
155 | _bag[RuntimeLimitsGlobals.UploadMaxFilesize] = value;
156 | }
157 | }
158 |
159 | internal void Initialize(PropertyBag bag)
160 | {
161 | _bag = bag;
162 | }
163 | }
164 | }
165 |
--------------------------------------------------------------------------------
/Client/Settings/RuntimeLimitsGlobals.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 |
11 | namespace Web.Management.PHP.Settings
12 | {
13 |
14 | internal static class RuntimeLimitsGlobals
15 | {
16 | public const int MaxExecutionTime = 0;
17 | public const int MaxInputTime = 1;
18 | public const int MemoryLimit = 2;
19 | public const int PostMaxSize = 3;
20 | public const int UploadMaxFilesize = 4;
21 | public const int MaxFileUploads = 5;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Client/Settings/RuntimeLimitsPage.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using System.Collections.Generic;
12 | using Microsoft.Web.Management.Client;
13 | using Microsoft.Web.Management.Client.Win32;
14 | using Microsoft.Web.Management.Server;
15 | using Web.Management.PHP.Config;
16 |
17 | namespace Web.Management.PHP.Settings
18 | {
19 |
20 | [ModulePageIdentifier(Globals.RuntimeLimitsPageIdentifier)]
21 | internal sealed class RuntimeLimitsPage : ModulePropertiesPage, IModuleChildPage
22 | {
23 | // If adding properties here make sure to update the RuntimeLimistGlobal.cs
24 | private readonly string [] _settingNames = {
25 | "max_execution_time",
26 | "max_input_time",
27 | "memory_limit",
28 | "post_max_size",
29 | "upload_max_filesize",
30 | "max_file_uploads"
31 | };
32 |
33 | private PropertyBag _clone;
34 | private PropertyBag _bag;
35 | private PageTaskList _taskList;
36 | private IModulePage _parentPage;
37 |
38 | protected override bool CanApplyChanges
39 | {
40 | get
41 | {
42 | return true;
43 | }
44 | }
45 |
46 | protected override bool ConfigNamesPresent
47 | {
48 | get
49 | {
50 | return true;
51 | }
52 | }
53 |
54 | internal bool IsReadOnly
55 | {
56 | get
57 | {
58 | return Connection.ConfigurationPath.PathType == Microsoft.Web.Management.Server.ConfigurationPathType.Site &&
59 | !Connection.IsUserServerAdministrator;
60 | }
61 | }
62 |
63 | private new PHPModule Module
64 | {
65 | get
66 | {
67 | return (PHPModule)base.Module;
68 | }
69 | }
70 |
71 | public IModulePage ParentPage
72 | {
73 | get
74 | {
75 | return _parentPage;
76 | }
77 | set
78 | {
79 | _parentPage = value;
80 | }
81 | }
82 |
83 | protected override TaskListCollection Tasks
84 | {
85 | get
86 | {
87 | TaskListCollection tasks = base.Tasks;
88 | if (_taskList == null)
89 | {
90 | _taskList = new PageTaskList(this);
91 | }
92 |
93 | tasks.Add(_taskList);
94 |
95 | return tasks;
96 | }
97 | }
98 |
99 | protected override PropertyBag GetProperties()
100 | {
101 | PropertyBag result = new PropertyBag();
102 |
103 | object o = Module.Proxy.GetPHPIniSettings();
104 | PHPIniFile file = new PHPIniFile();
105 | file.SetData(o);
106 |
107 | for (int i = 0; i < _settingNames.Length; i++)
108 | {
109 | PHPIniSetting setting = file.GetSetting(_settingNames[i]);
110 | if (setting != null)
111 | {
112 | result[i] = setting.Value;
113 | }
114 | }
115 |
116 | return result;
117 | }
118 |
119 | private void GoBack()
120 | {
121 | Navigate(typeof(PHPPage));
122 | }
123 |
124 | protected override void ProcessProperties(PropertyBag properties)
125 | {
126 | _bag = properties;
127 | _clone = _bag.Clone();
128 |
129 | RuntimeLimitSettings settings = TargetObject as RuntimeLimitSettings;
130 | if (settings == null)
131 | {
132 | settings = new RuntimeLimitSettings(this, this.IsReadOnly, _clone);
133 | TargetObject = settings;
134 | }
135 | else
136 | {
137 | settings.Initialize(_clone);
138 | }
139 |
140 | ClearDirty();
141 | }
142 |
143 | protected override bool ShowHelp()
144 | {
145 | return ShowOnlineHelp();
146 | }
147 |
148 | protected override bool ShowOnlineHelp()
149 | {
150 | return Helper.Browse(Globals.RuntimeLimitsOnlineHelp);
151 | }
152 |
153 | protected override PropertyBag UpdateProperties(out bool updateSuccessful)
154 | {
155 | updateSuccessful = false;
156 |
157 | RemoteObjectCollection settings = new RemoteObjectCollection();
158 |
159 | for (int i = 0; i < _settingNames.Length; i++)
160 | {
161 | settings.Add(new PHPIniSetting(_settingNames[i], (string)_clone[i], "PHP"));
162 | }
163 |
164 | try
165 | {
166 | Module.Proxy.AddOrUpdateSettings(settings);
167 | _bag = _clone;
168 | updateSuccessful = true;
169 | }
170 | catch(Exception ex)
171 | {
172 | DisplayErrorMessage(ex, Resources.ResourceManager);
173 | }
174 |
175 | return _bag;
176 | }
177 |
178 |
179 | private class PageTaskList : TaskList
180 | {
181 | private RuntimeLimitsPage _page;
182 |
183 | public PageTaskList(RuntimeLimitsPage page)
184 | {
185 | _page = page;
186 | }
187 |
188 | public override System.Collections.ICollection GetTaskItems()
189 | {
190 | List tasks = new List();
191 |
192 | if (_page.IsReadOnly)
193 | {
194 | tasks.Add(new MessageTaskItem(MessageTaskItemType.Information, Resources.AllPagesPageIsReadOnly, "Information"));
195 | }
196 |
197 | tasks.Add(new MethodTaskItem("GoBack", Resources.AllPagesGoBackTask, "Tasks", null, Resources.GoBack16));
198 |
199 | return tasks;
200 | }
201 |
202 | public void GoBack()
203 | {
204 | _page.GoBack();
205 | }
206 | }
207 |
208 | }
209 | }
--------------------------------------------------------------------------------
/Client/Settings/SettingCategoryAttribute.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using System.ComponentModel;
12 | using System.Globalization;
13 |
14 | namespace Web.Management.PHP.Settings
15 | {
16 |
17 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Event)]
18 | internal sealed class SettingCategoryAttribute : CategoryAttribute {
19 |
20 | internal SettingCategoryAttribute(string categoryValue)
21 | : base(categoryValue) {
22 | }
23 |
24 | protected override string GetLocalizedString(string value) {
25 | return Resources.ResourceManager.GetString(value, CultureInfo.CurrentUICulture);
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Client/Settings/SettingDescriptionAttribute.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using System.ComponentModel;
12 |
13 | namespace Web.Management.PHP.Settings
14 | {
15 |
16 | [AttributeUsage(AttributeTargets.Property| AttributeTargets.Event|AttributeTargets.Class)]
17 | internal sealed class SettingDescriptionAttribute : DescriptionAttribute {
18 |
19 | private bool _replaced;
20 |
21 | internal SettingDescriptionAttribute(string description)
22 | : base(description) {
23 | }
24 |
25 | public override string Description {
26 | get {
27 | if (!_replaced) {
28 | _replaced = true;
29 | DescriptionValue = Resources.ResourceManager.GetString(base.Description);
30 | }
31 |
32 | return base.Description;
33 | }
34 | }
35 |
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Client/Settings/SettingDisplayNameAttribute.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 |
12 | namespace Web.Management.PHP.Settings
13 | {
14 |
15 | [AttributeUsage(AttributeTargets.Property|AttributeTargets.Event|AttributeTargets.Class)]
16 | internal sealed class SettingDisplayNameAttribute : Attribute {
17 |
18 | private bool _replaced;
19 | private string _configPropertyName;
20 | private string _friendlyName;
21 |
22 | internal SettingDisplayNameAttribute(string friendlyName) {
23 | _friendlyName = friendlyName;
24 | }
25 |
26 | internal SettingDisplayNameAttribute(string friendlyName, string configPropertyName) {
27 | _friendlyName = friendlyName;
28 | _configPropertyName = configPropertyName;
29 | }
30 |
31 | public string ConfigPropertyName {
32 | get {
33 | return _configPropertyName;
34 | }
35 | }
36 |
37 | public string FriendlyName {
38 | get {
39 | if (!_replaced) {
40 | _replaced = true;
41 | _friendlyName = Resources.ResourceManager.GetString(_friendlyName);
42 | }
43 |
44 | return _friendlyName;
45 | }
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Client/Settings/SettingPropertyGridObject.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using System.Collections;
12 | using System.ComponentModel;
13 | using Microsoft.Web.Management.Client;
14 | using Microsoft.Web.Management.Client.Win32;
15 |
16 | namespace Web.Management.PHP.Settings
17 | {
18 |
19 | internal class SettingPropertyGridObject : PropertyGridObject
20 | {
21 |
22 | public SettingPropertyGridObject(ModulePropertiesPage page)
23 | : this(page, false)
24 | {
25 | }
26 |
27 | public SettingPropertyGridObject(ModulePropertiesPage page, bool readOnly)
28 | : base(page, readOnly)
29 | {
30 | }
31 |
32 | protected override System.ComponentModel.PropertyDescriptorCollection GetProperties(Attribute[] attributes)
33 | {
34 | PropertyDescriptorCollection props = base.GetProperties(attributes);
35 |
36 | Type thisType = GetType();
37 | ArrayList properties = new ArrayList();
38 | foreach (PropertyDescriptor prop in props)
39 | {
40 | AttributeCollection collection = prop.Attributes;
41 |
42 | SettingDisplayNameAttribute displayNameAttribute =
43 | (SettingDisplayNameAttribute)(collection[typeof(SettingDisplayNameAttribute)]);
44 |
45 | if (displayNameAttribute != null)
46 | {
47 | DisplayNameAttribute newDisplayNameAttribute =
48 | GetDisplayNameAttribute(displayNameAttribute.FriendlyName, displayNameAttribute.ConfigPropertyName);
49 |
50 | properties.Add(TypeDescriptor.CreateProperty(thisType, prop, newDisplayNameAttribute));
51 | }
52 | else
53 | {
54 | properties.Add(prop);
55 | }
56 | }
57 |
58 | props = new PropertyDescriptorCollection((PropertyDescriptor[])properties.ToArray(typeof(PropertyDescriptor)));
59 | return props;
60 | }
61 |
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Client/Setup/ChangeVersionDialog.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | //#define VSDesigner
11 |
12 | using System;
13 | using System.ComponentModel;
14 | using System.Windows.Forms;
15 | using Microsoft.Web.Management.Client.Win32;
16 | using Web.Management.PHP.Config;
17 |
18 | namespace Web.Management.PHP.Setup
19 | {
20 |
21 | internal sealed class ChangeVersionDialog :
22 | #if VSDesigner
23 | Form
24 | #else
25 | TaskForm
26 | #endif
27 | {
28 | private PHPModule _module;
29 |
30 | private ManagementPanel _contentPanel;
31 | private Label _selectVersionLabel;
32 | private ComboBox _versionComboBox;
33 |
34 | ///
35 | /// Required designer variable.
36 | ///
37 | private System.ComponentModel.IContainer components = null;
38 |
39 | public ChangeVersionDialog(PHPModule module) : base(module)
40 | {
41 | _module = module;
42 | InitializeComponent();
43 | InitializeUI();
44 | }
45 |
46 | protected override bool CanAccept
47 | {
48 | get
49 | {
50 | return (_versionComboBox.Items.Count > 0);
51 | }
52 | }
53 |
54 | protected override bool CanShowHelp
55 | {
56 | get
57 | {
58 | return true;
59 | }
60 | }
61 |
62 | ///
63 | /// Clean up any resources being used.
64 | ///
65 | /// true if managed resources should be disposed; otherwise, false.
66 | protected override void Dispose(bool disposing)
67 | {
68 | if (disposing && (components != null))
69 | {
70 | components.Dispose();
71 | }
72 | base.Dispose(disposing);
73 | }
74 |
75 | private void InitializeComponent()
76 | {
77 | this._selectVersionLabel = new System.Windows.Forms.Label();
78 | this._versionComboBox = new System.Windows.Forms.ComboBox();
79 | this.SuspendLayout();
80 | //
81 | // _selectVersionLabel
82 | //
83 | this._selectVersionLabel.AutoSize = true;
84 | this._selectVersionLabel.Location = new System.Drawing.Point(0, 13);
85 | this._selectVersionLabel.Name = "_selectVersionLabel";
86 | this._selectVersionLabel.Size = new System.Drawing.Size(102, 13);
87 | this._selectVersionLabel.TabIndex = 0;
88 | this._selectVersionLabel.Text = Resources.ChangeVersionDialogSelectVersion;
89 | //
90 | // _versionComboBox
91 | //
92 | this._versionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
93 | this._versionComboBox.FormattingEnabled = true;
94 | this._versionComboBox.Location = new System.Drawing.Point(3, 30);
95 | this._versionComboBox.Name = "_versionComboBox";
96 | this._versionComboBox.Size = new System.Drawing.Size(326, 21);
97 | this._versionComboBox.TabIndex = 1;
98 | //
99 | // ChangeVersionDialog
100 | //
101 | this.ClientSize = new System.Drawing.Size(364, 142);
102 | this.Controls.Add(this._versionComboBox);
103 | this.Controls.Add(this._selectVersionLabel);
104 | this.Name = "ChangeVersionDialog";
105 | this.ResumeLayout(false);
106 | #if VSDesigner
107 | this.PerformLayout();
108 | #endif
109 | }
110 |
111 | private void InitializeUI()
112 | {
113 | _contentPanel = new ManagementPanel();
114 | _contentPanel.SuspendLayout();
115 |
116 | this._contentPanel.Location = new System.Drawing.Point(0, 0);
117 | this._contentPanel.Dock = DockStyle.Fill;
118 | this._contentPanel.Controls.Add(_selectVersionLabel);
119 | this._contentPanel.Controls.Add(_versionComboBox);
120 |
121 | this._contentPanel.ResumeLayout(false);
122 | this._contentPanel.PerformLayout();
123 |
124 | this.Text = Resources.ChangeVersionDialogTitle;
125 |
126 | SetContent(_contentPanel);
127 | UpdateTaskForm();
128 | }
129 |
130 | protected override void OnAccept()
131 | {
132 | PHPVersion selectedItem = (PHPVersion)_versionComboBox.SelectedItem;
133 |
134 | try
135 | {
136 | _module.Proxy.SelectPHPVersion(selectedItem.HandlerName);
137 | DialogResult = DialogResult.OK;
138 | }
139 | catch (Exception ex)
140 | {
141 | DisplayErrorMessage(ex, Resources.ResourceManager);
142 | }
143 | Close();
144 | }
145 |
146 | private void OnGetVersionsDoWork(object sender, DoWorkEventArgs e)
147 | {
148 | e.Result = _module.Proxy.GetAllPHPVersions();
149 | }
150 |
151 | private void OnGetVersionsDoWorkCompleted(object sender, RunWorkerCompletedEventArgs e)
152 | {
153 | _versionComboBox.BeginUpdate();
154 | _versionComboBox.SuspendLayout();
155 |
156 | try
157 | {
158 | RemoteObjectCollection phpVersions = e.Result as RemoteObjectCollection;
159 | foreach (PHPVersion phpVersion in phpVersions)
160 | {
161 | phpVersion.Version = String.Format("{0} ({1})", phpVersion.Version, phpVersion.ScriptProcessor);
162 | _versionComboBox.Items.Add(phpVersion);
163 | }
164 | _versionComboBox.DisplayMember = "Version";
165 | _versionComboBox.SelectedIndex = 0;
166 | if (_versionComboBox.Items.Count > 0)
167 | {
168 | UpdateTaskForm();
169 | }
170 | }
171 | catch (Exception ex)
172 | {
173 | DisplayErrorMessage(ex, Resources.ResourceManager);
174 | }
175 | finally
176 | {
177 | _versionComboBox.ResumeLayout();
178 | _versionComboBox.EndUpdate();
179 | }
180 | }
181 |
182 | protected override void OnLoad(EventArgs e)
183 | {
184 | base.OnLoad(e);
185 |
186 | StartAsyncTask(OnGetVersionsDoWork, OnGetVersionsDoWorkCompleted);
187 | }
188 |
189 | protected override void ShowHelp()
190 | {
191 | Helper.Browse(Globals.ChangeVersionOnlineHelp);
192 | }
193 | }
194 | }
195 |
--------------------------------------------------------------------------------
/Client/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Client/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 RonaldCarter
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/NewPHPMGRSNF.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RonaldCarter/PHPManager/f6cc53a7b6bae0c655331582c52ab5093602db97/NewPHPMGRSNF.snk
--------------------------------------------------------------------------------
/PHPManager.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.26430.14
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{218B1547-6672-43D9-9907-F8312AEFA27B}"
7 | ProjectSection(SolutionItems) = preProject
8 | SharedAssembyInfo.cs = SharedAssembyInfo.cs
9 | EndProjectSection
10 | EndProject
11 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PHPManager", "Server\PHPManager.csproj", "{BEA18085-3850-46AA-822E-61D06CAB84E3}"
12 | EndProject
13 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PHPManagerClient", "Client\PHPManagerClient.csproj", "{61C46EF8-DB5C-4BD8-B757-E4A10E8203F8}"
14 | ProjectSection(ProjectDependencies) = postProject
15 | {BEA18085-3850-46AA-822E-61D06CAB84E3} = {BEA18085-3850-46AA-822E-61D06CAB84E3}
16 | EndProjectSection
17 | EndProject
18 | Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "PHPManagerSetup", "Setup\PHPManagerSetup.vdproj", "{595F0AF4-A239-4AB4-B862-29754AC75232}"
19 | ProjectSection(ProjectDependencies) = postProject
20 | {BEA18085-3850-46AA-822E-61D06CAB84E3} = {BEA18085-3850-46AA-822E-61D06CAB84E3}
21 | {8BEC09DE-2794-4F7B-B091-C74CD934BE7F} = {8BEC09DE-2794-4F7B-B091-C74CD934BE7F}
22 | {7714BEF4-AFA2-4951-A6E3-61793BCCF3F8} = {7714BEF4-AFA2-4951-A6E3-61793BCCF3F8}
23 | {61C46EF8-DB5C-4BD8-B757-E4A10E8203F8} = {61C46EF8-DB5C-4BD8-B757-E4A10E8203F8}
24 | EndProjectSection
25 | EndProject
26 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PHPManagerSetupHelper", "Setup\PHPManagerSetupHelper\PHPManagerSetupHelper.csproj", "{8BEC09DE-2794-4F7B-B091-C74CD934BE7F}"
27 | ProjectSection(ProjectDependencies) = postProject
28 | {BEA18085-3850-46AA-822E-61D06CAB84E3} = {BEA18085-3850-46AA-822E-61D06CAB84E3}
29 | {7714BEF4-AFA2-4951-A6E3-61793BCCF3F8} = {7714BEF4-AFA2-4951-A6E3-61793BCCF3F8}
30 | {61C46EF8-DB5C-4BD8-B757-E4A10E8203F8} = {61C46EF8-DB5C-4BD8-B757-E4A10E8203F8}
31 | EndProjectSection
32 | EndProject
33 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PHPManagerPowershell", "Powershell\PHPManagerPowershell.csproj", "{7714BEF4-AFA2-4951-A6E3-61793BCCF3F8}"
34 | ProjectSection(ProjectDependencies) = postProject
35 | {61C46EF8-DB5C-4BD8-B757-E4A10E8203F8} = {61C46EF8-DB5C-4BD8-B757-E4A10E8203F8}
36 | EndProjectSection
37 | EndProject
38 | Global
39 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
40 | Debug|Any CPU = Debug|Any CPU
41 | Release|Any CPU = Release|Any CPU
42 | EndGlobalSection
43 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
44 | {BEA18085-3850-46AA-822E-61D06CAB84E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45 | {BEA18085-3850-46AA-822E-61D06CAB84E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
46 | {BEA18085-3850-46AA-822E-61D06CAB84E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
47 | {BEA18085-3850-46AA-822E-61D06CAB84E3}.Release|Any CPU.Build.0 = Release|Any CPU
48 | {61C46EF8-DB5C-4BD8-B757-E4A10E8203F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
49 | {61C46EF8-DB5C-4BD8-B757-E4A10E8203F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
50 | {61C46EF8-DB5C-4BD8-B757-E4A10E8203F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
51 | {61C46EF8-DB5C-4BD8-B757-E4A10E8203F8}.Release|Any CPU.Build.0 = Release|Any CPU
52 | {595F0AF4-A239-4AB4-B862-29754AC75232}.Debug|Any CPU.ActiveCfg = Debug
53 | {595F0AF4-A239-4AB4-B862-29754AC75232}.Debug|Any CPU.Build.0 = Debug
54 | {595F0AF4-A239-4AB4-B862-29754AC75232}.Release|Any CPU.ActiveCfg = Release
55 | {595F0AF4-A239-4AB4-B862-29754AC75232}.Release|Any CPU.Build.0 = Release
56 | {8BEC09DE-2794-4F7B-B091-C74CD934BE7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
57 | {8BEC09DE-2794-4F7B-B091-C74CD934BE7F}.Debug|Any CPU.Build.0 = Debug|Any CPU
58 | {8BEC09DE-2794-4F7B-B091-C74CD934BE7F}.Release|Any CPU.ActiveCfg = Release|Any CPU
59 | {8BEC09DE-2794-4F7B-B091-C74CD934BE7F}.Release|Any CPU.Build.0 = Release|Any CPU
60 | {7714BEF4-AFA2-4951-A6E3-61793BCCF3F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
61 | {7714BEF4-AFA2-4951-A6E3-61793BCCF3F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
62 | {7714BEF4-AFA2-4951-A6E3-61793BCCF3F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
63 | {7714BEF4-AFA2-4951-A6E3-61793BCCF3F8}.Release|Any CPU.Build.0 = Release|Any CPU
64 | EndGlobalSection
65 | GlobalSection(SolutionProperties) = preSolution
66 | HideSolutionNode = FALSE
67 | EndGlobalSection
68 | GlobalSection(ExtensibilityGlobals) = postSolution
69 | SolutionGuid = {66C83FDA-65A5-4EB1-B832-F282C7B60093}
70 | EndGlobalSection
71 | GlobalSection(SubversionScc) = preSolution
72 | Svn-Managed = True
73 | Manager = AnkhSVN - Subversion Support for Visual Studio
74 | EndGlobalSection
75 | EndGlobal
76 |
--------------------------------------------------------------------------------
/Powershell/BaseCmdlet.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using System.IO;
12 | using System.Management.Automation;
13 | using System.Security.Principal;
14 |
15 | namespace Web.Management.PHP.Powershell
16 | {
17 |
18 | public abstract class BaseCmdlet : PSCmdlet
19 | {
20 | private string _siteName;
21 | private string _virtualPath;
22 |
23 | [Parameter(ValueFromPipeline = false)]
24 | public string SiteName
25 | {
26 | set
27 | {
28 | _siteName = value;
29 | }
30 | get
31 | {
32 | return _siteName;
33 | }
34 | }
35 |
36 | [Parameter(ValueFromPipeline = false)]
37 | public string VirtualPath
38 | {
39 | set
40 | {
41 | _virtualPath = value;
42 | }
43 | get
44 | {
45 | return _virtualPath;
46 | }
47 | }
48 |
49 | protected abstract void DoProcessing();
50 |
51 | protected void EnsureAdminUser()
52 | {
53 | WindowsIdentity identity = WindowsIdentity.GetCurrent();
54 | WindowsPrincipal principal = new WindowsPrincipal(identity);
55 | SecurityIdentifier sidAdmin = new SecurityIdentifier(WellKnownSidType.BuiltinAdministratorsSid, null);
56 | if (!principal.IsInRole(sidAdmin))
57 | {
58 | UnauthorizedAccessException exception = new UnauthorizedAccessException(Resources.UserIsNotAdminError);
59 | ReportTerminatingError(exception, "UnathorizedAccess", ErrorCategory.PermissionDenied);
60 | }
61 | }
62 |
63 | protected static WildcardPattern PrepareWildcardPattern(string pattern)
64 | {
65 | WildcardOptions options = WildcardOptions.IgnoreCase | WildcardOptions.Compiled;
66 | WildcardPattern wildcard = null;
67 |
68 | if (!String.IsNullOrEmpty(pattern))
69 | {
70 | wildcard = new WildcardPattern(pattern, options);
71 | }
72 | else
73 | {
74 | wildcard = new WildcardPattern("*", options);
75 | }
76 |
77 | return wildcard;
78 | }
79 |
80 | protected override void ProcessRecord()
81 | {
82 | EnsureAdminUser();
83 |
84 | try
85 | {
86 | DoProcessing();
87 | }
88 | catch (FileNotFoundException ex)
89 | {
90 | ReportTerminatingError(ex, "FileNotFound", ErrorCategory.ObjectNotFound);
91 | }
92 | catch (InvalidOperationException ex)
93 | {
94 | ReportTerminatingError(ex, "InvalidOperation", ErrorCategory.InvalidOperation);
95 | }
96 | }
97 |
98 | protected void ReportNonTerminatingError(Exception exception, string errorId, ErrorCategory errorCategory)
99 | {
100 | ErrorRecord errorRecord = new ErrorRecord(exception, errorId, errorCategory, null);
101 | WriteError(errorRecord);
102 | }
103 |
104 | protected void ReportTerminatingError(Exception exception, string errorId, ErrorCategory errorCategory)
105 | {
106 | ErrorRecord errorRecord = new ErrorRecord(exception, errorId, errorCategory, null);
107 | ThrowTerminatingError(errorRecord);
108 | }
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/Powershell/Documentation/Remove-WarningStuff.ps1:
--------------------------------------------------------------------------------
1 | ##
2 | ## This script is used to remove the unnecessary elements from the powershell documentation file,
3 | ## generated by CmdLet Editor Tool (http://blogs.msdn.com/b/powershell/archive/2007/09/01/new-and-improved-cmdlet-help-editor-tool.aspx)
4 | ## Run this tool after modifying the documentation with this tool and prior to checkin in the updated doc file.
5 | ##
6 |
7 |
8 | param([string]$FilePath = "")
9 |
10 | if ($filePath -eq "")
11 | {
12 | Write-Host "Usage: Remove-WarningStuff.ps1 -FilePath C:\directory\file.xml"
13 | }
14 |
15 | [xml]$FileXml = Get-Content $filePath
16 |
17 | $NamespaceMgr = new-object System.Xml.XmlNamespaceManager($FileXml.PSBase.NameTable)
18 | $NamespaceMgr.AddNamespace("a", $FileXml.helpItems.xmlns)
19 | $NamespaceMgr.AddNamespace("command", "http://schemas.microsoft.com/maml/dev/command/2004/10")
20 | $NamespaceMgr.AddNamespace("maml", "http://schemas.microsoft.com/maml/2004/10")
21 |
22 | $entries = $FileXml.SelectNodes('/a:helpItems/command:command/command:syntax/command:syntaxItem/command:parameter[maml:name="WarningAction"]', $NamespaceMgr)
23 | foreach($entry in $entries)
24 | {
25 | [void]$entry.ParentNode.RemoveChild($entry)
26 | }
27 | Write-Host 'Removed all occurances of "WarningAction" parameter in syntax descriptions.'
28 |
29 | $entries = $FileXml.SelectNodes('/a:helpItems/command:command/command:syntax/command:syntaxItem/command:parameter[maml:name="WarningVariable"]', $NamespaceMgr)
30 | foreach($entry in $entries)
31 | {
32 | [void]$entry.ParentNode.RemoveChild($entry)
33 | }
34 | Write-Host 'Removed all occurances of "WarningVariable" parameter in syntax descriptions.'
35 |
36 | $entries = $FileXml.SelectNodes('/a:helpItems/command:command/command:parameters/command:parameter[maml:name="WarningAction"]', $NamespaceMgr)
37 | foreach($entry in $entries)
38 | {
39 | [void]$entry.ParentNode.RemoveChild($entry)
40 | }
41 | Write-Host 'Removed all occurances of "WarningAction" parameter in parameters descriptions.'
42 |
43 | $entries = $FileXml.SelectNodes('/a:helpItems/command:command/command:parameters/command:parameter[maml:name="WarningVariable"]', $NamespaceMgr)
44 | foreach($entry in $entries)
45 | {
46 | [void]$entry.ParentNode.RemoveChild($entry)
47 | }
48 | Write-Host 'Removed all occurances of "WarningVariable" parameter in parameters descriptions.'
49 |
50 | $filename = Split-Path -Path $FilePath -leaf
51 |
52 | $FileXml.Save("$pwd\CleanedUp_$filename")
53 |
54 |
55 |
--------------------------------------------------------------------------------
/Powershell/Documentation/copyhelp.bat:
--------------------------------------------------------------------------------
1 | copy CleanedUp_Web.Management.PHP.PowerShell.dll-Help.xml C:\windows\assembly\GAC_MSIL\Web.Management.PHP.PowerShell\1.2.0.0__8175de49a9aec91d\Web.Management.PHP.PowerShell.dll-Help.xml
--------------------------------------------------------------------------------
/Powershell/GetPHPConfigurationCmdlet.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using System.Management.Automation;
12 | using Microsoft.Web.Administration;
13 | using Web.Management.PHP.Config;
14 |
15 | namespace Web.Management.PHP.Powershell
16 | {
17 |
18 | [Cmdlet(VerbsCommon.Get, "PHPConfiguration")]
19 | [OutputType(typeof(PHPConfigurationItem))]
20 | public sealed class GetPHPConfigurationCmdlet : BaseCmdlet
21 | {
22 | protected override void DoProcessing()
23 | {
24 | using (ServerManager serverManager = new ServerManager())
25 | {
26 | ServerManagerWrapper serverManagerWrapper = new ServerManagerWrapper(serverManager, this.SiteName, this.VirtualPath);
27 | PHPConfigHelper configHelper = new PHPConfigHelper(serverManagerWrapper);
28 | PHPConfigInfo configInfo = configHelper.GetPHPConfigInfo();
29 | if (configInfo.RegistrationType == PHPRegistrationType.FastCgi)
30 | {
31 | PHPConfigurationItem configurationItem = new PHPConfigurationItem(configInfo);
32 | WriteObject(configurationItem);
33 | }
34 | else
35 | {
36 | throw new InvalidOperationException(Resources.PHPIsNotRegisteredError);
37 | }
38 | }
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Powershell/GetPHPExtensionCmdlet.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System.Management.Automation;
11 | using Microsoft.Web.Administration;
12 | using Web.Management.PHP.Config;
13 |
14 | namespace Web.Management.PHP.Powershell
15 | {
16 |
17 | [Cmdlet(VerbsCommon.Get, "PHPExtension")]
18 | [OutputType(typeof(PHPExtensionItem))]
19 | public sealed class GetPHPExtensionCmdlet : BaseCmdlet
20 | {
21 | private string _name;
22 | private PHPExtensionStatus _status;
23 |
24 | [Parameter(ValueFromPipelineByPropertyName = true, Position = 0)]
25 | public string Name
26 | {
27 | get
28 | {
29 | return _name;
30 | }
31 | set
32 | {
33 | _name = value;
34 | }
35 | }
36 |
37 | [Parameter(ValueFromPipeline = false, Position = 1)]
38 | public PHPExtensionStatus Status
39 | {
40 | get
41 | {
42 | return _status;
43 | }
44 | set
45 | {
46 | _status = value;
47 | }
48 | }
49 |
50 | protected override void DoProcessing()
51 | {
52 | using (ServerManager serverManager = new ServerManager())
53 | {
54 | ServerManagerWrapper serverManagerWrapper = new ServerManagerWrapper(serverManager, this.SiteName, this.VirtualPath);
55 | PHPConfigHelper configHelper = new PHPConfigHelper(serverManagerWrapper);
56 | PHPIniFile phpIniFile = configHelper.GetPHPIniFile();
57 |
58 | WildcardPattern wildcard = PrepareWildcardPattern(Name);
59 |
60 | foreach (PHPIniExtension extension in phpIniFile.Extensions)
61 | {
62 | if (!wildcard.IsMatch(extension.Name))
63 | {
64 | continue;
65 | }
66 | if (Status == PHPExtensionStatus.Disabled && extension.Enabled)
67 | {
68 | continue;
69 | }
70 | if (Status == PHPExtensionStatus.Enabled && !extension.Enabled)
71 | {
72 | continue;
73 | }
74 |
75 | PHPExtensionItem extensionItem = new PHPExtensionItem(extension);
76 |
77 | WriteObject(extensionItem);
78 | }
79 | }
80 | }
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/Powershell/GetPHPSettingCmdlet.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System.Management.Automation;
11 | using Microsoft.Web.Administration;
12 | using Web.Management.PHP.Config;
13 |
14 | namespace Web.Management.PHP.Powershell
15 | {
16 |
17 | [Cmdlet(VerbsCommon.Get, "PHPSetting")]
18 | [OutputType(typeof(PHPSettingItem))]
19 | public sealed class GetPHPSettingCmdlet : BaseCmdlet
20 | {
21 | private string _name;
22 | private string _section;
23 |
24 | [Parameter(Position = 0)]
25 | public string Name
26 | {
27 | get
28 | {
29 | return _name;
30 | }
31 | set
32 | {
33 | _name = value;
34 | }
35 | }
36 |
37 | [Parameter]
38 | public string Section
39 | {
40 | get
41 | {
42 | return _section;
43 | }
44 | set
45 | {
46 | _section = value;
47 | }
48 | }
49 |
50 | protected override void DoProcessing()
51 | {
52 | using (ServerManager serverManager = new ServerManager())
53 | {
54 | ServerManagerWrapper serverManagerWrapper = new ServerManagerWrapper(serverManager, this.SiteName, this.VirtualPath);
55 | PHPConfigHelper configHelper = new PHPConfigHelper(serverManagerWrapper);
56 | PHPIniFile phpIniFile = configHelper.GetPHPIniFile();
57 |
58 | WildcardPattern nameWildcard = PrepareWildcardPattern(Name);
59 | WildcardPattern sectionWildcard = PrepareWildcardPattern(Section);
60 |
61 | foreach (PHPIniSetting setting in phpIniFile.Settings)
62 | {
63 | if (!nameWildcard.IsMatch(setting.Name))
64 | {
65 | continue;
66 | }
67 | if (!sectionWildcard.IsMatch(setting.Section))
68 | {
69 | continue;
70 | }
71 |
72 | PHPSettingItem settingItem = new PHPSettingItem(setting);
73 | WriteObject(settingItem);
74 | }
75 | }
76 | }
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/Powershell/GetPHPVersionCmdlet.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System.Management.Automation;
11 | using Microsoft.Web.Administration;
12 | using Web.Management.PHP.Config;
13 |
14 | namespace Web.Management.PHP.Powershell
15 | {
16 |
17 | [Cmdlet(VerbsCommon.Get, "PHPVersion")]
18 | public sealed class GetPHPVersionCmdlet : BaseCmdlet
19 | {
20 | private string _handlerName;
21 | private string _version;
22 |
23 | [Parameter(ValueFromPipelineByPropertyName = true, Position = 0)]
24 | public string HandlerName
25 | {
26 | get
27 | {
28 | return _handlerName;
29 | }
30 | set
31 | {
32 | _handlerName = value;
33 | }
34 | }
35 |
36 | [Parameter(ValueFromPipeline = false, Position = 1)]
37 | public string Version
38 | {
39 | get
40 | {
41 | return _version;
42 | }
43 | set
44 | {
45 | _version = value;
46 | }
47 | }
48 |
49 | protected override void DoProcessing()
50 | {
51 | using (ServerManager serverManager = new ServerManager())
52 | {
53 | ServerManagerWrapper serverManagerWrapper = new ServerManagerWrapper(serverManager, this.SiteName, this.VirtualPath);
54 | PHPConfigHelper configHelper = new PHPConfigHelper(serverManagerWrapper);
55 | RemoteObjectCollection phpVersions = configHelper.GetAllPHPVersions();
56 |
57 | WildcardPattern nameWildcard = PrepareWildcardPattern(HandlerName);
58 | WildcardPattern versionWildcard = PrepareWildcardPattern(Version);
59 |
60 | bool isActive = true;
61 | foreach (PHPVersion phpVersion in phpVersions)
62 | {
63 | if (!nameWildcard.IsMatch(phpVersion.HandlerName))
64 | {
65 | isActive = false;
66 | continue;
67 | }
68 | if (!versionWildcard.IsMatch(phpVersion.Version))
69 | {
70 | isActive = false;
71 | continue;
72 | }
73 |
74 | PHPVersionItem versionItem = new PHPVersionItem(phpVersion, isActive);
75 | WriteObject(versionItem);
76 | isActive = false;
77 | }
78 | }
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/Powershell/Helper.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using Web.Management.PHP.Config;
12 |
13 | namespace Web.Management.PHP.Powershell
14 | {
15 |
16 | internal static class Helper
17 | {
18 |
19 | public static PHPIniExtension FindExtension(RemoteObjectCollection extensions, string name)
20 | {
21 | PHPIniExtension result = null;
22 |
23 | foreach (PHPIniExtension extension in extensions)
24 | {
25 | if (String.Equals(extension.Name, name, StringComparison.OrdinalIgnoreCase))
26 | {
27 | result = extension;
28 | break;
29 | }
30 | }
31 |
32 | return result;
33 | }
34 |
35 | public static PHPIniSetting FindSetting(RemoteObjectCollection settings, string name)
36 | {
37 | PHPIniSetting result = null;
38 |
39 | foreach (PHPIniSetting setting in settings)
40 | {
41 | if (String.Equals(setting.Name, name, StringComparison.OrdinalIgnoreCase))
42 | {
43 | result = setting;
44 | break;
45 | }
46 | }
47 |
48 | return result;
49 | }
50 |
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/Powershell/Installer.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 |
11 | using System.ComponentModel;
12 | using System.Management.Automation;
13 |
14 | namespace Web.Management.PHP.Powershell
15 | {
16 |
17 | [RunInstaller(true)]
18 | public class Installer : PSSnapIn
19 | {
20 |
21 | public override string Description
22 | {
23 | get
24 | {
25 | return Resources.SnapInDescription;
26 | }
27 | }
28 |
29 | public override string Name
30 | {
31 | get
32 | {
33 | return "PHPManagerSnapin";
34 | }
35 | }
36 |
37 | public override string Vendor
38 | {
39 | get
40 | {
41 | return Resources.SnapInVendor;
42 | }
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/Powershell/NewPHPMGRSNF.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RonaldCarter/PHPManager/f6cc53a7b6bae0c655331582c52ab5093602db97/Powershell/NewPHPMGRSNF.snk
--------------------------------------------------------------------------------
/Powershell/NewPHPSettingCmdlet.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using System.Management.Automation;
12 | using Microsoft.Web.Administration;
13 | using Web.Management.PHP.Config;
14 |
15 | namespace Web.Management.PHP.Powershell
16 | {
17 | [Cmdlet(VerbsCommon.New, "PHPSetting",
18 | SupportsShouldProcess = true,
19 | ConfirmImpact = ConfirmImpact.Medium)]
20 | public sealed class NewPHPSettingCmdlet : BaseCmdlet
21 | {
22 | private string _name;
23 | private string _value;
24 | private string _section = "PHP";
25 |
26 | [Parameter(Mandatory = true,
27 | Position = 0)]
28 | public string Name
29 | {
30 | get
31 | {
32 | return _name;
33 | }
34 | set
35 | {
36 | _name = value;
37 | }
38 | }
39 |
40 | [Parameter(Mandatory = true, Position = 1)]
41 | public string Value
42 | {
43 | get
44 | {
45 | return _value;
46 | }
47 | set
48 | {
49 | _value = value;
50 | }
51 | }
52 |
53 | [Parameter(Mandatory = false, Position = 2)]
54 | public string Section
55 | {
56 | get
57 | {
58 | return _section;
59 | }
60 | set
61 | {
62 | _section = value;
63 | }
64 | }
65 |
66 | protected override void DoProcessing()
67 | {
68 | using (ServerManager serverManager = new ServerManager())
69 | {
70 | ServerManagerWrapper serverManagerWrapper = new ServerManagerWrapper(serverManager, this.SiteName, this.VirtualPath);
71 | PHPConfigHelper configHelper = new PHPConfigHelper(serverManagerWrapper);
72 | PHPIniFile phpIniFile = configHelper.GetPHPIniFile();
73 |
74 | PHPIniSetting setting = Helper.FindSetting(phpIniFile.Settings, Name);
75 | if (setting == null)
76 | {
77 | if (ShouldProcess(Name))
78 | {
79 | RemoteObjectCollection settings = new RemoteObjectCollection();
80 | settings.Add(new PHPIniSetting(Name, Value, Section));
81 | configHelper.AddOrUpdatePHPIniSettings(settings);
82 | }
83 | }
84 | else
85 | {
86 | ArgumentException ex = new ArgumentException(String.Format(Resources.SettingAlreadyExistsError, Name));
87 | ReportNonTerminatingError(ex, "InvalidArgument", ErrorCategory.InvalidArgument);
88 | }
89 | }
90 | }
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/Powershell/NewPHPVersionCmdlet.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using System.IO;
12 | using System.Management.Automation;
13 | using Microsoft.Web.Administration;
14 | using Web.Management.PHP.Config;
15 |
16 | namespace Web.Management.PHP.Powershell
17 | {
18 | [Cmdlet(VerbsCommon.New, "PHPVersion")]
19 | public sealed class NewPHPVersionCmdlet : BaseCmdlet
20 | {
21 | private string _scriptProcessor;
22 |
23 | [Parameter(Mandatory = true, Position = 0)]
24 | public string ScriptProcessor
25 | {
26 | get
27 | {
28 | return _scriptProcessor;
29 | }
30 | set
31 | {
32 | _scriptProcessor = value;
33 | }
34 | }
35 |
36 | protected override void DoProcessing()
37 | {
38 | try
39 | {
40 | using (ServerManager serverManager = new ServerManager())
41 | {
42 | ServerManagerWrapper serverManagerWrapper = new ServerManagerWrapper(serverManager, this.SiteName, this.VirtualPath);
43 | PHPConfigHelper _configHelper = new PHPConfigHelper(serverManagerWrapper);
44 | string phpCgiExePath = PrepareFullScriptProcessorPath(ScriptProcessor);
45 | _configHelper.RegisterPHPWithIIS(phpCgiExePath);
46 | }
47 | }
48 | catch (DirectoryNotFoundException ex)
49 | {
50 | ReportTerminatingError(ex, "DirectoryNotFound", ErrorCategory.ObjectNotFound);
51 | }
52 | }
53 |
54 | private string PrepareFullScriptProcessorPath(string scriptProcessor)
55 | {
56 | string fullPath = Path.GetFullPath(scriptProcessor);
57 | if (!fullPath.EndsWith("php-cgi.exe", StringComparison.OrdinalIgnoreCase))
58 | {
59 | fullPath = Path.Combine(fullPath, "php-cgi.exe");
60 | }
61 | return fullPath;
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/Powershell/PHPConfigurationItem.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using Web.Management.PHP.Config;
11 |
12 | namespace Web.Management.PHP.Powershell
13 | {
14 | public enum HandlerRegistrationType { Local, Inherited };
15 |
16 | public sealed class PHPConfigurationItem
17 | {
18 | private PHPConfigInfo _configInfo;
19 |
20 | public PHPConfigurationItem(PHPConfigInfo configInfo)
21 | {
22 | _configInfo = configInfo;
23 | }
24 |
25 | public string HandlerName
26 | {
27 | get
28 | {
29 | return _configInfo.HandlerName;
30 | }
31 | }
32 |
33 | public string Version
34 | {
35 | get
36 | {
37 | return _configInfo.Version;
38 | }
39 | }
40 |
41 | public string ScriptProcessor
42 | {
43 | get
44 | {
45 | return _configInfo.Executable;
46 | }
47 | }
48 |
49 | public HandlerRegistrationType HandlerType
50 | {
51 | get
52 | {
53 | return _configInfo.HandlerIsLocal ? HandlerRegistrationType.Local : HandlerRegistrationType.Inherited;
54 | }
55 | }
56 |
57 | public string ErrorLog
58 | {
59 | get
60 | {
61 | return _configInfo.ErrorLog;
62 | }
63 | }
64 |
65 | public string PHPIniFilePath
66 | {
67 | get
68 | {
69 | return _configInfo.PHPIniFilePath;
70 | }
71 | }
72 |
73 | public int InstalledExtensionsCount
74 | {
75 | get
76 | {
77 | return _configInfo.InstalledExtCount;
78 | }
79 | }
80 |
81 | public int EnabledExtensionsCount
82 | {
83 | get
84 | {
85 | return _configInfo.EnabledExtCount;
86 | }
87 | }
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/Powershell/PHPExtensionItem.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using Web.Management.PHP.Config;
11 |
12 | namespace Web.Management.PHP.Powershell
13 | {
14 |
15 | public enum PHPExtensionStatus { Any, Enabled, Disabled };
16 |
17 | public sealed class PHPExtensionItem
18 | {
19 | private PHPIniExtension _extension;
20 |
21 | public PHPExtensionItem(PHPIniExtension extension)
22 | {
23 | _extension = extension;
24 | }
25 |
26 | public string Name
27 | {
28 | get
29 | {
30 | return _extension.Name;
31 | }
32 | }
33 |
34 | public PHPExtensionStatus Status
35 | {
36 | get
37 | {
38 | return _extension.Enabled ? PHPExtensionStatus.Enabled : PHPExtensionStatus.Disabled;
39 | }
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Powershell/PHPManagerPowershell.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 9.0.30729
7 | 2.0
8 | {7714BEF4-AFA2-4951-A6E3-61793BCCF3F8}
9 | Library
10 | Properties
11 | Web.Management.PHP.Powershell
12 | Web.Management.PHP.PowerShell
13 | v4.5
14 | 512
15 | true
16 | NewPHPMGRSNF.snk
17 | false
18 |
19 |
20 |
21 |
22 | 3.5
23 |
24 |
25 |
26 | true
27 | full
28 | false
29 | ..\bin\Debug\
30 | DEBUG;TRACE
31 | prompt
32 | 4
33 | false
34 | true
35 |
36 |
37 | pdbonly
38 | true
39 | ..\bin\Release\
40 | TRACE
41 | prompt
42 | 4
43 | false
44 | false
45 | true
46 |
47 |
48 |
49 | ..\packages\Microsoft.Web.Administration.7.0.0.0\lib\net20\Microsoft.Web.Administration.dll
50 | True
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 | SharedAssembyInfo.cs
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 | Component
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 | True
83 | True
84 | Settings.settings
85 |
86 |
87 |
88 | True
89 | True
90 | Resources.resx
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 | SettingsSingleFileGenerator
103 | Settings.Designer.cs
104 |
105 |
106 |
107 |
108 | ResXFileCodeGenerator
109 | Resources.Designer.cs
110 |
111 |
112 |
113 |
114 | {BEA18085-3850-46AA-822E-61D06CAB84E3}
115 | PHPManager
116 |
117 |
118 |
119 |
120 |
121 |
122 |
129 |
130 | if $(ConfigurationName) == Debug goto :debug
131 |
132 | :debug
133 | CALL "%25VS140COMNTOOLS%25\vsvars32.bat" > NULL
134 | "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\sn.exe" -Vr $(TargetDir)$(TargetFileName)
135 | gacutil.exe /if "$(TargetPath)"
136 | InstallUtil $(TargetPath)
137 | copy $(ProjectDir)Documentation\Web.Management.PHP.PowerShell.dll-Help.xml $(TargetDir) /Y
138 |
139 | :exit
140 |
141 |
--------------------------------------------------------------------------------
/Powershell/PHPSettingItem.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using Web.Management.PHP.Config;
12 |
13 | namespace Web.Management.PHP.Powershell
14 | {
15 | public sealed class PHPSettingItem
16 | {
17 | private PHPIniSetting _setting;
18 |
19 | public PHPSettingItem(PHPIniSetting setting)
20 | {
21 | _setting = setting;
22 | }
23 |
24 | public string Name
25 | {
26 | get
27 | {
28 | return _setting.Name;
29 | }
30 | }
31 |
32 | public string Value
33 | {
34 | get
35 | {
36 | if (String.IsNullOrEmpty(_setting.Value))
37 | {
38 | return Resources.NotSetValue;
39 | }
40 | else
41 | {
42 | return _setting.Value;
43 | }
44 | }
45 | }
46 |
47 | public string Section
48 | {
49 | get
50 | {
51 | return _setting.Section;
52 | }
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/Powershell/PHPVersionItem.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using Web.Management.PHP.Config;
11 |
12 | namespace Web.Management.PHP.Powershell
13 | {
14 |
15 | public sealed class PHPVersionItem
16 | {
17 | PHPVersion _phpVersion;
18 | bool _active;
19 |
20 | public PHPVersionItem(PHPVersion phpVersion, bool active)
21 | {
22 | _phpVersion = phpVersion;
23 | _active = active;
24 | }
25 |
26 | public string HandlerName
27 | {
28 | get
29 | {
30 | return _phpVersion.HandlerName;
31 | }
32 | }
33 |
34 | public string Version
35 | {
36 | get
37 | {
38 | return _phpVersion.Version;
39 | }
40 | }
41 |
42 | public string ScriptProcessor
43 | {
44 | get
45 | {
46 | return _phpVersion.ScriptProcessor;
47 | }
48 | }
49 |
50 | public bool Active
51 | {
52 | get
53 | {
54 | return _active;
55 | }
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/Powershell/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System.Reflection;
11 | using System.Runtime.InteropServices;
12 |
13 | // General Information about an assembly is controlled through the following
14 | // set of attributes. Change these attribute values to modify the information
15 | // associated with an assembly.
16 | [assembly: AssemblyTitle("Web.Management.PHP.Powershell")]
17 | [assembly: AssemblyDescription("Powershell snapin for managing PHP installations on IIS 7")]
18 | [assembly: AssemblyConfiguration("")]
19 |
20 | // Setting ComVisible to false makes the types in this assembly not visible
21 | // to COM components. If you need to access a type in this assembly from
22 | // COM, set the ComVisible attribute to true on that type.
23 | [assembly: ComVisible(false)]
24 |
25 | // The following GUID is for the ID of the typelib if this project is exposed to COM
26 | [assembly: Guid("ef62a138-5379-4345-8507-7e200f8b9a71")]
--------------------------------------------------------------------------------
/Powershell/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Web.Management.PHP.Powershell.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.6.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Powershell/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Powershell/RemovePHPSettingCmdlet.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using System.Management.Automation;
12 | using Microsoft.Web.Administration;
13 | using Web.Management.PHP.Config;
14 |
15 | namespace Web.Management.PHP.Powershell
16 | {
17 |
18 | [Cmdlet(VerbsCommon.Remove, "PHPSetting",
19 | SupportsShouldProcess = true,
20 | ConfirmImpact = ConfirmImpact.Medium)]
21 | public sealed class RemovePHPSettingCmdlet : BaseCmdlet
22 | {
23 | private string _name;
24 | private bool _force;
25 |
26 | [Parameter(Mandatory = false)]
27 | public SwitchParameter Force
28 | {
29 | get {
30 | return _force;
31 | }
32 | set {
33 | _force = value;
34 | }
35 | }
36 |
37 | [Parameter(Mandatory = true,
38 | Position = 0)]
39 | public string Name
40 | {
41 | get
42 | {
43 | return _name;
44 | }
45 | set
46 | {
47 | _name = value;
48 | }
49 | }
50 |
51 | protected override void DoProcessing()
52 | {
53 | using (ServerManager serverManager = new ServerManager())
54 | {
55 | ServerManagerWrapper serverManagerWrapper = new ServerManagerWrapper(serverManager, this.SiteName, this.VirtualPath);
56 | PHPConfigHelper configHelper = new PHPConfigHelper(serverManagerWrapper);
57 | PHPIniFile phpIniFile = configHelper.GetPHPIniFile();
58 |
59 | PHPIniSetting setting = Helper.FindSetting(phpIniFile.Settings, Name);
60 | if (setting != null)
61 | {
62 | if (ShouldProcess(Name))
63 | {
64 | string warningMessage = String.Format(Resources.DeleteSettingWarningMessage, setting.Name, setting.Value);
65 | if (Force || ShouldContinue(warningMessage, Resources.DeleteSettingWarningCaption))
66 | {
67 | configHelper.RemovePHPIniSetting(setting);
68 | }
69 | }
70 | }
71 | else
72 | {
73 | ArgumentException ex = new ArgumentException(String.Format(Resources.SettingDoesNotExistError, Name));
74 | ReportNonTerminatingError(ex, "InvalidArgument", ErrorCategory.ObjectNotFound);
75 | }
76 | }
77 | }
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/Powershell/SetPHPExtensionCmdlet.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using System.Diagnostics;
12 | using System.IO;
13 | using System.Management.Automation;
14 | using Microsoft.Web.Administration;
15 | using Web.Management.PHP.Config;
16 |
17 | namespace Web.Management.PHP.Powershell
18 | {
19 |
20 | [Cmdlet(VerbsCommon.Set, "PHPExtension",
21 | SupportsShouldProcess = true,
22 | ConfirmImpact = ConfirmImpact.Medium)]
23 | public sealed class SetPHPExtensionCmdlet : BaseCmdlet
24 | {
25 |
26 | private string[] _name;
27 | private PHPExtensionStatus _status = PHPExtensionStatus.Any;
28 |
29 | private ServerManager _serverManager;
30 | private PHPConfigHelper _configHelper;
31 | private PHPIniFile _phpIniFile;
32 | private RemoteObjectCollection _extensions;
33 |
34 | [Parameter( Mandatory = true,
35 | ValueFromPipelineByPropertyName = true,
36 | Position = 0)]
37 | public string[] Name
38 | {
39 | get
40 | {
41 | return _name;
42 | }
43 | set
44 | {
45 | _name = value;
46 | }
47 | }
48 |
49 | [Parameter(Mandatory = true, Position = 1)]
50 | public PHPExtensionStatus Status
51 | {
52 | get
53 | {
54 | return _status;
55 | }
56 | set
57 | {
58 | _status = value;
59 | }
60 | }
61 |
62 | protected override void BeginProcessing()
63 | {
64 | EnsureAdminUser();
65 |
66 | try
67 | {
68 | _serverManager = new ServerManager();
69 | ServerManagerWrapper serverManagerWrapper = new ServerManagerWrapper(_serverManager, this.SiteName, this.VirtualPath);
70 | _configHelper = new PHPConfigHelper(serverManagerWrapper);
71 | _phpIniFile = _configHelper.GetPHPIniFile();
72 | _extensions = new RemoteObjectCollection();
73 | }
74 | catch (FileNotFoundException ex)
75 | {
76 | DisposeServerManager();
77 | ReportTerminatingError(ex, "FileNotFound", ErrorCategory.ObjectNotFound);
78 | }
79 | catch (InvalidOperationException ex)
80 | {
81 | DisposeServerManager();
82 | ReportTerminatingError(ex, "InvalidOperation", ErrorCategory.InvalidOperation);
83 | }
84 | }
85 |
86 | private void DisposeServerManager()
87 | {
88 | if (_serverManager != null)
89 | {
90 | _serverManager.Dispose();
91 | _serverManager = null;
92 | }
93 | }
94 |
95 | protected override void DoProcessing()
96 | {
97 | Debug.Assert(_phpIniFile != null);
98 | Debug.Assert(_extensions != null);
99 |
100 | foreach (string extensionName in Name)
101 | {
102 | PHPIniExtension extension = Helper.FindExtension(_phpIniFile.Extensions, extensionName);
103 | if (extension != null)
104 | {
105 | if ((extension.Enabled && Status == PHPExtensionStatus.Disabled) ||
106 | (!extension.Enabled && Status == PHPExtensionStatus.Enabled))
107 | {
108 | if (ShouldProcess(extensionName))
109 | {
110 | extension = new PHPIniExtension(extensionName, (Status == PHPExtensionStatus.Enabled) ? true : false);
111 | _extensions.Add(extension);
112 | }
113 | }
114 | }
115 | else
116 | {
117 | ArgumentException ex = new ArgumentException(String.Format(Resources.ExtensionDoesNotExistError, extensionName));
118 | ReportNonTerminatingError(ex, "InvalidArgument", ErrorCategory.ObjectNotFound);
119 | return;
120 | }
121 | }
122 | }
123 |
124 | protected override void EndProcessing()
125 | {
126 | Debug.Assert(_extensions != null);
127 | Debug.Assert(_configHelper != null);
128 | Debug.Assert(_serverManager != null);
129 |
130 | if (_extensions.Count > 0)
131 | {
132 | _configHelper.UpdateExtensions(_extensions);
133 | }
134 |
135 | DisposeServerManager();
136 | }
137 | }
138 | }
139 |
--------------------------------------------------------------------------------
/Powershell/SetPHPSettingCmdlet.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using System.Management.Automation;
12 | using Microsoft.Web.Administration;
13 | using Web.Management.PHP.Config;
14 |
15 | namespace Web.Management.PHP.Powershell
16 | {
17 |
18 | [Cmdlet(VerbsCommon.Set, "PHPSetting",
19 | SupportsShouldProcess = true,
20 | ConfirmImpact = ConfirmImpact.Medium)]
21 | public sealed class SetPHPSettingCmdlet : BaseCmdlet
22 | {
23 | private string _name;
24 | private string _value;
25 |
26 | [Parameter(Mandatory = true,
27 | Position = 0)]
28 | public string Name
29 | {
30 | get
31 | {
32 | return _name;
33 | }
34 | set
35 | {
36 | _name = value;
37 | }
38 | }
39 |
40 | [Parameter(Mandatory = true, Position = 1)]
41 | public string Value
42 | {
43 | get
44 | {
45 | return _value;
46 | }
47 | set
48 | {
49 | _value = value;
50 | }
51 | }
52 |
53 | protected override void DoProcessing()
54 | {
55 | using (ServerManager serverManager = new ServerManager())
56 | {
57 | ServerManagerWrapper serverManagerWrapper = new ServerManagerWrapper(serverManager, this.SiteName, this.VirtualPath);
58 | PHPConfigHelper configHelper = new PHPConfigHelper(serverManagerWrapper);
59 | PHPIniFile phpIniFile = configHelper.GetPHPIniFile();
60 |
61 | PHPIniSetting setting = Helper.FindSetting(phpIniFile.Settings, Name);
62 | if (setting != null)
63 | {
64 | if (ShouldProcess(Name))
65 | {
66 | RemoteObjectCollection settings = new RemoteObjectCollection();
67 | settings.Add(new PHPIniSetting(Name, Value, setting.Section));
68 | configHelper.AddOrUpdatePHPIniSettings(settings);
69 | }
70 | }
71 | else
72 | {
73 | ArgumentException ex = new ArgumentException(String.Format(Resources.SettingDoesNotExistError, Name));
74 | ReportNonTerminatingError(ex, "InvalidArgument", ErrorCategory.ObjectNotFound);
75 | }
76 | }
77 | }
78 | }
79 | }
--------------------------------------------------------------------------------
/Powershell/SetPHPVersionCmdlet.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using System.Management.Automation;
12 | using Microsoft.Web.Administration;
13 | using Web.Management.PHP.Config;
14 |
15 | namespace Web.Management.PHP.Powershell
16 | {
17 | [Cmdlet(VerbsCommon.Set, "PHPVersion",
18 | SupportsShouldProcess = true,
19 | ConfirmImpact = ConfirmImpact.Medium)]
20 | public sealed class SetPHPVersionCmdlet : BaseCmdlet
21 | {
22 | private string _handlerName;
23 |
24 | [Parameter(Mandatory = true,
25 | ValueFromPipelineByPropertyName = true,
26 | Position = 0)]
27 | public string HandlerName
28 | {
29 | get
30 | {
31 | return _handlerName;
32 | }
33 | set
34 | {
35 | _handlerName = value;
36 | }
37 | }
38 |
39 | protected override void DoProcessing()
40 | {
41 | using (ServerManager serverManager = new ServerManager())
42 | {
43 | ServerManagerWrapper serverManagerWrapper = new ServerManagerWrapper(serverManager, this.SiteName, this.VirtualPath);
44 | PHPConfigHelper configHelper = new PHPConfigHelper(serverManagerWrapper);
45 | if (configHelper.GetPHPHandlerByName(HandlerName) != null)
46 | {
47 | if (ShouldProcess(HandlerName))
48 | {
49 | configHelper.SelectPHPHandler(HandlerName);
50 | }
51 | }
52 | else
53 | {
54 | ArgumentException ex = new ArgumentException(String.Format(Resources.HandlerDoesNotExistError, HandlerName));
55 | ReportNonTerminatingError(ex, "InvalidArgument", ErrorCategory.ObjectNotFound);
56 | }
57 | }
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Powershell/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Powershell/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # PHPManager
2 | PHP Manager for IIS
3 |
4 | This is my attempt to update PHP Manager for IIS to support IIS 10 and to also update it to a newer version of .NET
5 |
6 | Forum is now available via https://groups.google.com/forum/#!forum/php-manager-for-iis/
7 |
--------------------------------------------------------------------------------
/Server/.refsignored:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RonaldCarter/PHPManager/f6cc53a7b6bae0c655331582c52ab5093602db97/Server/.refsignored
--------------------------------------------------------------------------------
/Server/Config/IConfigurationWrapper.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using Microsoft.Web.Administration;
11 |
12 | namespace Web.Management.PHP.Config
13 | {
14 |
15 | public interface IConfigurationWrapper
16 | {
17 |
18 | void CommitChanges();
19 |
20 | Configuration GetAppHostConfiguration();
21 |
22 | DefaultDocument.DefaultDocumentSection GetDefaultDocumentSection();
23 |
24 | Handlers.HandlersSection GetHandlersSection();
25 |
26 | bool IsServerConfigurationPath();
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Server/Config/ManagementUnitWrapper.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using Microsoft.Web.Administration;
11 | using Microsoft.Web.Management.Server;
12 |
13 | namespace Web.Management.PHP.Config
14 | {
15 |
16 | internal sealed class ManagementUnitWrapper : IConfigurationWrapper
17 | {
18 | private ManagementUnit _managementUnit;
19 |
20 | public ManagementUnitWrapper(ManagementUnit managementUnit)
21 | {
22 | _managementUnit = managementUnit;
23 | }
24 |
25 | #region IConfigurationWrapper Members
26 |
27 | public void CommitChanges()
28 | {
29 | _managementUnit.Update();
30 | }
31 |
32 | public Configuration GetAppHostConfiguration()
33 | {
34 | return _managementUnit.ServerManager.GetApplicationHostConfiguration();
35 | }
36 |
37 | public DefaultDocument.DefaultDocumentSection GetDefaultDocumentSection()
38 | {
39 | ManagementConfiguration config = _managementUnit.Configuration;
40 | return (DefaultDocument.DefaultDocumentSection)config.GetSection("system.webServer/defaultDocument", typeof(DefaultDocument.DefaultDocumentSection));
41 | }
42 |
43 | public Handlers.HandlersSection GetHandlersSection()
44 | {
45 | ManagementConfiguration config = _managementUnit.Configuration;
46 | return (Handlers.HandlersSection)config.GetSection("system.webServer/handlers", typeof(Handlers.HandlersSection));
47 | }
48 |
49 | public bool IsServerConfigurationPath()
50 | {
51 | return (_managementUnit.ConfigurationPath.PathType == ConfigurationPathType.Server);
52 | }
53 |
54 | #endregion
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/Server/Config/ServerManagerWrapper.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using Microsoft.Web.Administration;
12 |
13 | namespace Web.Management.PHP.Config
14 | {
15 |
16 | public sealed class ServerManagerWrapper : IConfigurationWrapper
17 | {
18 | private ServerManager _serverManager;
19 | private string _siteName;
20 | private string _virtualPath;
21 |
22 | public ServerManagerWrapper(ServerManager serverManager, string siteName, string virtualPath)
23 | {
24 | _serverManager = serverManager;
25 | _siteName = siteName;
26 | _virtualPath = virtualPath;
27 | }
28 |
29 | public string SiteName
30 | {
31 | get
32 | {
33 | return _siteName;
34 | }
35 | }
36 |
37 | public string VirtualPath
38 | {
39 | get
40 | {
41 | return _virtualPath;
42 | }
43 | }
44 |
45 | public void CommitChanges()
46 | {
47 | _serverManager.CommitChanges();
48 | }
49 |
50 | public Configuration GetAppHostConfiguration()
51 | {
52 | return _serverManager.GetApplicationHostConfiguration();
53 | }
54 |
55 | private Configuration GetConfiguration()
56 | {
57 | if (String.IsNullOrEmpty(_siteName) && String.IsNullOrEmpty(_virtualPath))
58 | {
59 | return _serverManager.GetApplicationHostConfiguration();
60 | }
61 |
62 | string siteName = String.IsNullOrEmpty(_siteName) ? "Default Web Site" : _siteName;
63 |
64 | if (String.IsNullOrEmpty(_virtualPath))
65 | {
66 | return _serverManager.GetWebConfiguration(siteName);
67 | }
68 | else
69 | {
70 | return _serverManager.GetWebConfiguration(siteName, _virtualPath);
71 | }
72 | }
73 |
74 | public DefaultDocument.DefaultDocumentSection GetDefaultDocumentSection()
75 | {
76 | Configuration config = GetConfiguration();
77 | return (DefaultDocument.DefaultDocumentSection)config.GetSection("system.webServer/defaultDocument", typeof(DefaultDocument.DefaultDocumentSection));
78 | }
79 |
80 | public Handlers.HandlersSection GetHandlersSection()
81 | {
82 | Configuration config = GetConfiguration();
83 | return (Handlers.HandlersSection)config.GetSection("system.webServer/handlers", typeof(Handlers.HandlersSection));
84 | }
85 |
86 | public bool IsServerConfigurationPath()
87 | {
88 | return (String.IsNullOrEmpty(_siteName) && String.IsNullOrEmpty(_virtualPath));
89 | }
90 |
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/Server/DefaultDocument/DefaultDocumentSection.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using Microsoft.Web.Administration;
11 |
12 | namespace Web.Management.PHP.DefaultDocument
13 | {
14 |
15 | public sealed class DefaultDocumentSection : ConfigurationSection
16 | {
17 | private FilesCollection _files;
18 |
19 | public FilesCollection Files
20 | {
21 | get
22 | {
23 | if (this._files == null)
24 | {
25 | ConfigurationElement files = base.GetChildElement("files");
26 | this._files = (FilesCollection)files.GetCollection(typeof(FilesCollection));
27 | }
28 | return this._files;
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Server/DefaultDocument/FileElement.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using Microsoft.Web.Administration;
11 |
12 | namespace Web.Management.PHP.DefaultDocument
13 | {
14 |
15 | public sealed class FileElement : ConfigurationElement
16 | {
17 |
18 | public string Value
19 | {
20 | get
21 | {
22 | return (string)base["value"];
23 | }
24 | set
25 | {
26 | base["value"] = value;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Server/DefaultDocument/FilesCollection.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using Microsoft.Web.Administration;
12 |
13 | namespace Web.Management.PHP.DefaultDocument
14 | {
15 |
16 | public sealed class FilesCollection : ConfigurationElementCollectionBase
17 | {
18 |
19 | public new FileElement this[string value]
20 | {
21 | get
22 | {
23 | for (int i = 0; (i < this.Count); i = (i + 1))
24 | {
25 | FileElement element = base[i];
26 | if ((string.Equals(element.Value, value, StringComparison.OrdinalIgnoreCase) == true))
27 | {
28 | return element;
29 | }
30 | }
31 | return null;
32 | }
33 | }
34 |
35 | public FileElement AddCopy(FileElement file)
36 | {
37 | FileElement element = CreateElement();
38 | CopyAttributes(file, element);
39 | return Add(element);
40 | }
41 |
42 | public FileElement AddCopyAt(int index, FileElement file)
43 | {
44 | FileElement element = CreateElement();
45 | CopyAttributes(file, element);
46 | return AddAt(index, element);
47 | }
48 |
49 | private static void CopyAttributes(ConfigurationElement source, ConfigurationElement destination)
50 | {
51 | foreach (ConfigurationAttribute attribute in source.Attributes)
52 | {
53 | if (!attribute.IsInheritedFromDefaultValue)
54 | {
55 | destination[attribute.Name] = attribute.Value;
56 | }
57 | }
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/Server/FastCgi/ApplicationCollection.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using Microsoft.Web.Administration;
12 |
13 | namespace Web.Management.PHP.FastCgi
14 | {
15 |
16 | public sealed class FastCgiApplicationCollection : ConfigurationElementCollectionBase
17 | {
18 |
19 | protected override ApplicationElement CreateNewElement(string elementTagName)
20 | {
21 | return new ApplicationElement();
22 | }
23 |
24 | public ApplicationElement GetApplication(string fullPath, string arguments)
25 | {
26 | for (int i = 0; i < Count; i++)
27 | {
28 | ApplicationElement element = base[i];
29 | if (String.Equals(fullPath, element.FullPath, StringComparison.OrdinalIgnoreCase) &&
30 | String.Equals(arguments, element.Arguments, StringComparison.OrdinalIgnoreCase))
31 | {
32 | return element;
33 | }
34 | }
35 | return null;
36 | }
37 |
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Server/FastCgi/EnvironmentVariableElement.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using Microsoft.Web.Administration;
11 |
12 | namespace Web.Management.PHP.FastCgi
13 | {
14 |
15 | public sealed class EnvironmentVariableElement : ConfigurationElement
16 | {
17 |
18 | public string Name
19 | {
20 | get
21 | {
22 | return (string)base["name"];
23 | }
24 | set
25 | {
26 | base["name"] = value;
27 | }
28 | }
29 |
30 | public string Value
31 | {
32 | get
33 | {
34 | return (string)base["value"];
35 | }
36 | set
37 | {
38 | base["value"] = value;
39 | }
40 | }
41 |
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Server/FastCgi/EnvironmentVariablesCollection.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using Microsoft.Web.Administration;
12 |
13 | namespace Web.Management.PHP.FastCgi
14 | {
15 |
16 | public sealed class EnvironmentVariablesCollection : ConfigurationElementCollectionBase
17 | {
18 |
19 | public new EnvironmentVariableElement this[string name]
20 | {
21 | get
22 | {
23 | for (int i = 0; (i < this.Count); i = (i + 1))
24 | {
25 | EnvironmentVariableElement element = base[i];
26 | if ((string.Equals(element.Name, name, StringComparison.OrdinalIgnoreCase) == true))
27 | {
28 | return element;
29 | }
30 | }
31 | return null;
32 | }
33 | }
34 |
35 | public EnvironmentVariableElement Add(string name, string value)
36 | {
37 | EnvironmentVariableElement element = this.CreateElement();
38 | element.Name = name;
39 | element.Value = value;
40 |
41 | return base.Add(element);
42 | }
43 |
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/Server/FastCgi/FastCgiSection.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using Microsoft.Web.Administration;
11 |
12 | namespace Web.Management.PHP.FastCgi
13 | {
14 |
15 | public sealed class FastCgiSection : ConfigurationSection
16 | {
17 | private FastCgiApplicationCollection _applications;
18 |
19 | public FastCgiSection() {
20 | }
21 |
22 | public FastCgiApplicationCollection Applications
23 | {
24 | get
25 | {
26 | if (this._applications == null)
27 | {
28 | this._applications = (FastCgiApplicationCollection)base.GetCollection(typeof(FastCgiApplicationCollection));
29 | }
30 | return this._applications;
31 | }
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Server/FastCgi/Protocol.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 |
11 | namespace Web.Management.PHP.FastCgi
12 | {
13 |
14 | public enum Protocol
15 | {
16 | NamedPipe = 0,
17 | Tcp = 1
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Server/FastCgi/StderrMode.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | namespace Web.Management.PHP.FastCgi
11 | {
12 |
13 | public enum StderrMode
14 | {
15 | ReturnStdErrIn500 = 0,
16 | ReturnGeneric500 = 1,
17 | IgnoreAndReturn200 = 2,
18 | TerminateProcess = 3
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Server/Handlers/HandlerElement.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using Microsoft.Web.Administration;
12 |
13 | namespace Web.Management.PHP.Handlers
14 | {
15 |
16 | public sealed class HandlerElement : ConfigurationElement
17 | {
18 | private string _executable;
19 | private string _arguments;
20 |
21 | public bool AllowPathInfo
22 | {
23 | get
24 | {
25 | return (bool)base["allowPathInfo"];
26 | }
27 | set
28 | {
29 | base["allowPathInfo"] = value;
30 | }
31 | }
32 |
33 | public string Arguments
34 | {
35 | get
36 | {
37 | if (_arguments == null)
38 | {
39 | string rawExecutable = SplitScriptProcessor(ScriptProcessor, out _arguments);
40 | _executable = Environment.ExpandEnvironmentVariables(rawExecutable);
41 | }
42 | return _arguments;
43 | }
44 | }
45 |
46 | public string Executable
47 | {
48 | get
49 | {
50 | if (_executable == null)
51 | {
52 | string rawExecutable = SplitScriptProcessor(ScriptProcessor, out _arguments);
53 | _executable = Environment.ExpandEnvironmentVariables(rawExecutable);
54 | }
55 | return _executable;
56 | }
57 | }
58 |
59 | public string Modules
60 | {
61 | get
62 | {
63 | return (string)base["modules"];
64 | }
65 | set
66 | {
67 | base["modules"] = value;
68 | }
69 | }
70 |
71 | public string Name
72 | {
73 | get
74 | {
75 | return (string)base["name"];
76 | }
77 | set
78 | {
79 | base["name"] = value;
80 | }
81 | }
82 |
83 | public string Path
84 | {
85 | get
86 | {
87 | return (string)base["path"];
88 | }
89 | set
90 | {
91 | base["path"] = value;
92 | }
93 | }
94 |
95 | public string PreCondition
96 | {
97 | get
98 | {
99 | return (string)base["preCondition"];
100 | }
101 | set
102 | {
103 | base["preCondition"] = value;
104 | }
105 | }
106 |
107 | public RequireAccess RequireAccess
108 | {
109 | get
110 | {
111 | return (RequireAccess)base["requireAccess"];
112 | }
113 | set
114 | {
115 | base["requireAccess"] = (int)value;
116 | }
117 | }
118 |
119 | public ResourceType ResourceType
120 | {
121 | get
122 | {
123 | return (ResourceType)base["resourceType"];
124 | }
125 | set
126 | {
127 | base["resourceType"] = (int)value;
128 | }
129 | }
130 |
131 | public string ScriptProcessor
132 | {
133 | get
134 | {
135 | return (string)base["scriptProcessor"];
136 | }
137 | set
138 | {
139 | base["scriptProcessor"] = value;
140 | _executable = null;
141 | _arguments = null;
142 | }
143 | }
144 |
145 | public string Type
146 | {
147 | get
148 | {
149 | return (string)base["type"];
150 | }
151 | set
152 | {
153 | base["type"] = value;
154 | }
155 | }
156 |
157 | public string Verb
158 | {
159 | get
160 | {
161 | return (string)base["verb"];
162 | }
163 | set
164 | {
165 | base["verb"] = value;
166 | }
167 | }
168 |
169 | private static string SplitScriptProcessor(string scriptProcessor, out string arguments)
170 | {
171 | string[] s = scriptProcessor.Split(new char[] { '|' }, StringSplitOptions.None);
172 | if (s.Length > 1)
173 | {
174 | arguments = s[1];
175 | }
176 | else
177 | {
178 | arguments = String.Empty;
179 | }
180 | return s[0];
181 | }
182 | }
183 | }
184 |
--------------------------------------------------------------------------------
/Server/Handlers/HandlersCollection.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using Microsoft.Web.Administration;
12 |
13 | namespace Web.Management.PHP.Handlers
14 | {
15 |
16 | public sealed class HandlersCollection : ConfigurationElementCollectionBase
17 | {
18 |
19 | public new HandlerElement this[string name]
20 | {
21 | get
22 | {
23 | for (int i = 0; (i < this.Count); i = (i + 1))
24 | {
25 | HandlerElement element = base[i];
26 | if ((string.Equals(element.Name, name, StringComparison.OrdinalIgnoreCase) == true))
27 | {
28 | return element;
29 | }
30 | }
31 | return null;
32 | }
33 | }
34 |
35 | public HandlerElement AddCopy(HandlerElement handler)
36 | {
37 | HandlerElement element = CreateElement();
38 | CopyAttributes(handler, element);
39 | return Add(element);
40 | }
41 |
42 | public HandlerElement AddCopyAt(int index, HandlerElement handler)
43 | {
44 | HandlerElement element = CreateElement();
45 | CopyAttributes(handler, element);
46 | return AddAt(index, element);
47 | }
48 |
49 | private static void CopyAttributes(ConfigurationElement source, ConfigurationElement destination)
50 | {
51 | foreach (ConfigurationAttribute attribute in source.Attributes)
52 | {
53 | if (!attribute.IsInheritedFromDefaultValue)
54 | {
55 | destination[attribute.Name] = attribute.Value;
56 | }
57 | }
58 | }
59 |
60 | public HandlerElement GetActiveHandler(string path)
61 | {
62 | for (int i = 0; i < Count; i++)
63 | {
64 | HandlerElement element = base[i];
65 | if (String.Equals(path, element.Path, StringComparison.OrdinalIgnoreCase))
66 | {
67 | return element;
68 | }
69 | }
70 | return null;
71 | }
72 |
73 | public HandlerElement GetHandlerByNameAndPath(string name, string path)
74 | {
75 | for (int i = 0; i < Count; i++)
76 | {
77 | HandlerElement element = base[i];
78 | if (String.Equals(name, element.Name, StringComparison.OrdinalIgnoreCase) &&
79 | String.Equals(path, element.Path, StringComparison.OrdinalIgnoreCase))
80 | {
81 | return element;
82 | }
83 | }
84 | return null;
85 | }
86 |
87 | public HandlerElement GetHandler(string path, string scriptProcessor)
88 | {
89 | for (int i = 0; i < Count; i++)
90 | {
91 | HandlerElement element = base[i];
92 | if (String.Equals(path, element.Path, StringComparison.OrdinalIgnoreCase) &&
93 | String.Equals(scriptProcessor, element.ScriptProcessor, StringComparison.OrdinalIgnoreCase))
94 | {
95 | return element;
96 | }
97 | }
98 | return null;
99 | }
100 |
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/Server/Handlers/HandlersSection.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using Microsoft.Web.Administration;
11 |
12 | namespace Web.Management.PHP.Handlers
13 | {
14 |
15 | public sealed class HandlersSection : ConfigurationSection
16 | {
17 | private HandlersCollection _handlers;
18 |
19 | public HandlersCollection Handlers
20 | {
21 | get
22 | {
23 | if (this._handlers == null)
24 | {
25 | this._handlers = (HandlersCollection)base.GetCollection(typeof(HandlersCollection));
26 | }
27 | return this._handlers;
28 | }
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Server/Handlers/RequireAccess.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | namespace Web.Management.PHP.Handlers
11 | {
12 |
13 | public enum RequireAccess
14 | {
15 | None = 0,
16 | Read = 1,
17 | Write = 2,
18 | Script = 3,
19 | Execute = 4
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Server/Handlers/ResourceType.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | namespace Web.Management.PHP.Handlers
11 | {
12 |
13 | public enum ResourceType
14 | {
15 | File = 0,
16 | Directory = 1,
17 | Either = 2,
18 | Unspecified = 3
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Server/NewPHPMGRSNF.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RonaldCarter/PHPManager/f6cc53a7b6bae0c655331582c52ab5093602db97/Server/NewPHPMGRSNF.snk
--------------------------------------------------------------------------------
/Server/PHPManager.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 9.0.30729
7 | 2.0
8 | {BEA18085-3850-46AA-822E-61D06CAB84E3}
9 | Library
10 | Properties
11 | Web.Management.PHP
12 | Web.Management.PHP
13 | v4.5
14 | 512
15 | true
16 | NewPHPMGRSNF.snk
17 | false
18 |
19 |
20 |
21 |
22 | 3.5
23 |
24 |
25 |
26 | true
27 | full
28 | false
29 | ..\bin\Debug\
30 | DEBUG;TRACE
31 | prompt
32 | 4
33 | false
34 | false
35 | true
36 | MixedMinimumRules.ruleset
37 |
38 |
39 | pdbonly
40 | true
41 | ..\bin\Release\
42 | TRACE
43 | prompt
44 | 4
45 | false
46 | true
47 | false
48 |
49 |
50 |
51 | ..\packages\Microsoft.Web.Administration.7.0.0.0\lib\net20\Microsoft.Web.Administration.dll
52 | True
53 |
54 |
55 | False
56 | C:\Windows\System32\inetsrv\Microsoft.Web.Management.dll
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | Config\PHPConfigInfo.cs
67 |
68 |
69 | Config\PHPConfigIssue.cs
70 |
71 |
72 | Config\PHPIniFile.cs
73 |
74 |
75 | Config\PHPRegistrationType.cs
76 |
77 |
78 | Config\PHPVersion.cs
79 |
80 |
81 | RemoteObject.cs
82 |
83 |
84 | SharedAssembyInfo.cs
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | True
110 | True
111 | Settings.settings
112 |
113 |
114 | True
115 | True
116 | Resources.resx
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 | SettingsSingleFileGenerator
125 | Settings.Designer.cs
126 |
127 |
128 |
129 |
130 | ResXFileCodeGenerator
131 | Resources.Designer.cs
132 |
133 |
134 |
135 |
142 |
143 | if $(ConfigurationName) == Debug goto :debug
144 |
145 | :debug
146 | CALL "%25VS140COMNTOOLS%25\vsvars32.bat" > NULL
147 | "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\sn.exe" -Vr $(TargetDir)$(TargetFileName)
148 | gacutil.exe /if "$(TargetPath)"
149 |
150 | :exit
151 |
152 |
153 |
--------------------------------------------------------------------------------
/Server/PHPProvider.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using System.Reflection;
12 | using Microsoft.Web.Management.Server;
13 |
14 | namespace Web.Management.PHP
15 | {
16 |
17 | internal sealed class PHPProvider : ModuleProvider
18 | {
19 |
20 | public override string FriendlyName
21 | {
22 | get
23 | {
24 | return Resources.PHPManagerFriendlyName;
25 | }
26 | }
27 |
28 | public override Type ServiceType
29 | {
30 | get {
31 | return typeof(PHPService);
32 | }
33 | }
34 |
35 | public override ModuleDefinition GetModuleDefinition(IManagementContext context)
36 | {
37 | Assembly assembly = Assembly.GetExecutingAssembly();
38 | AssemblyName assemblyName = assembly.GetName();
39 | string assemblyFullName = assemblyName.FullName;
40 | string clientAssemblyFullName = assemblyFullName.Replace(assemblyName.Name, "Web.Management.PHP.Client");
41 |
42 | return new ModuleDefinition(Name, "Web.Management.PHP.PHPModule, " + clientAssemblyFullName);
43 | }
44 |
45 | public override bool SupportsScope(ManagementScope scope)
46 | {
47 | return (scope == ManagementScope.Site) ||
48 | (scope == ManagementScope.Server);
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/Server/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System.Reflection;
11 | using System.Runtime.InteropServices;
12 |
13 | // General Information about an assembly is controlled through the following
14 | // set of attributes. Change these attribute values to modify the information
15 | // associated with an assembly.
16 | [assembly: AssemblyTitle("Web.Management.PHP")]
17 | [assembly: AssemblyDescription("Server UI module for PHP Manager for IIS")]
18 | [assembly: AssemblyConfiguration("")]
19 |
20 | // Setting ComVisible to false makes the types in this assembly not visible
21 | // to COM components. If you need to access a type in this assembly from
22 | // COM, set the ComVisible attribute to true on that type.
23 | [assembly: ComVisible(false)]
24 |
25 | // The following GUID is for the ID of the typelib if this project is exposed to COM
26 | [assembly: Guid("a70483a6-1713-4467-985c-033682bf41e9")]
--------------------------------------------------------------------------------
/Server/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Web.Management.PHP.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.6.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Server/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Server/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Web.Management.PHP {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Web.Management.PHP.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized string similar to Cannot find a php.ini file associated with PHP executable {0}..
65 | ///
66 | internal static string CannotFindPhpIniForExecutableError {
67 | get {
68 | return ResourceManager.GetString("CannotFindPhpIniForExecutableError", resourceCulture);
69 | }
70 | }
71 |
72 | ///
73 | /// Looks up a localized string similar to Cannot register PHP because FastCGI module is not enabled in IIS..
74 | ///
75 | internal static string FastCgiNotEnabledError {
76 | get {
77 | return ResourceManager.GetString("FastCgiNotEnabledError", resourceCulture);
78 | }
79 | }
80 |
81 | ///
82 | /// Looks up a localized string similar to The folder {0} does not contain "ext" folder with PHP extensions..
83 | ///
84 | internal static string FolderDoesNotHaveExtDirError {
85 | get {
86 | return ResourceManager.GetString("FolderDoesNotHaveExtDirError", resourceCulture);
87 | }
88 | }
89 |
90 | ///
91 | /// Looks up a localized string similar to There is no php executable file (php-cgi.exe) at the specified location {0}..
92 | ///
93 | internal static string PhpCgiExeDoesNotExistError {
94 | get {
95 | return ResourceManager.GetString("PhpCgiExeDoesNotExistError", resourceCulture);
96 | }
97 | }
98 |
99 | ///
100 | /// Looks up a localized string similar to The provided php executable path {0} is invalid..
101 | ///
102 | internal static string PhpCgiExePathInvalidError {
103 | get {
104 | return ResourceManager.GetString("PhpCgiExePathInvalidError", resourceCulture);
105 | }
106 | }
107 |
108 | ///
109 | /// Looks up a localized string similar to Cannot file php.ini or php.ini-recommended or php.ini-production in {0}..
110 | ///
111 | internal static string PhpIniFilesDoNotExistError {
112 | get {
113 | return ResourceManager.GetString("PhpIniFilesDoNotExistError", resourceCulture);
114 | }
115 | }
116 |
117 | ///
118 | /// Looks up a localized string similar to PHP Manager for IIS.
119 | ///
120 | internal static string PHPManagerFriendlyName {
121 | get {
122 | return ResourceManager.GetString("PHPManagerFriendlyName", resourceCulture);
123 | }
124 | }
125 |
126 | ///
127 | /// Looks up a localized string similar to Cannot perform the action because PHP is not registered properly..
128 | ///
129 | internal static string PhpNotRegisteredError {
130 | get {
131 | return ResourceManager.GetString("PhpNotRegisteredError", resourceCulture);
132 | }
133 | }
134 | }
135 | }
136 |
--------------------------------------------------------------------------------
/Server/Settings.cs:
--------------------------------------------------------------------------------
1 | namespace Web.Management.PHP.Properties {
2 |
3 |
4 | // This class allows you to handle specific events on the settings class:
5 | // The SettingChanging event is raised before a setting's value is changed.
6 | // The PropertyChanged event is raised after a setting's value is changed.
7 | // The SettingsLoaded event is raised after the setting values are loaded.
8 | // The SettingsSaving event is raised before the setting values are saved.
9 | internal sealed partial class Settings {
10 |
11 | public Settings() {
12 | // // To add event handlers for saving and changing settings, uncomment the lines below:
13 | //
14 | // this.SettingChanging += this.SettingChangingEventHandler;
15 | //
16 | // this.SettingsSaving += this.SettingsSavingEventHandler;
17 | //
18 | }
19 |
20 | private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
21 | // Add code to handle the SettingChangingEvent event here.
22 | }
23 |
24 | private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
25 | // Add code to handle the SettingsSaving event here.
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Server/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Setup/PHPManagerSetupHelper/InstallUtil.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System;
11 | using Microsoft.Web.Administration;
12 |
13 | namespace Web.Management.PHP.Setup
14 | {
15 |
16 | public static class InstallUtil
17 | {
18 |
19 | public static void AddUIModuleProvider(string name, string type)
20 | {
21 | using (ServerManager mgr = new ServerManager())
22 | {
23 |
24 | // First register the Module Provider
25 | Configuration adminConfig = mgr.GetAdministrationConfiguration();
26 |
27 | ConfigurationSection moduleProvidersSection = adminConfig.GetSection("moduleProviders");
28 | ConfigurationElementCollection moduleProviders = moduleProvidersSection.GetCollection();
29 | if (FindByAttribute(moduleProviders, "name", name) == null)
30 | {
31 | ConfigurationElement moduleProvider = moduleProviders.CreateElement();
32 | moduleProvider.SetAttributeValue("name", name);
33 | moduleProvider.SetAttributeValue("type", type);
34 | moduleProviders.Add(moduleProvider);
35 | }
36 |
37 | // Now register it so that all Sites have access to this module
38 | ConfigurationSection modulesSection = adminConfig.GetSection("modules");
39 | ConfigurationElementCollection modules = modulesSection.GetCollection();
40 | if (FindByAttribute(modules, "name", name) == null)
41 | {
42 | ConfigurationElement module = modules.CreateElement();
43 | module.SetAttributeValue("name", name);
44 | modules.Add(module);
45 | }
46 |
47 | mgr.CommitChanges();
48 | }
49 | }
50 |
51 | ///
52 | /// Helper method to find an element based on an attribute
53 | ///
54 | private static ConfigurationElement FindByAttribute(ConfigurationElementCollection collection, string attributeName, string value)
55 | {
56 | foreach (ConfigurationElement element in collection)
57 | {
58 | if (String.Equals((string)element.GetAttribute(attributeName).Value, value, StringComparison.OrdinalIgnoreCase))
59 | {
60 | return element;
61 | }
62 | }
63 |
64 | return null;
65 | }
66 |
67 | ///
68 | /// Removes the specified UI Module by name
69 | ///
70 | public static void RemoveUIModuleProvider(string name)
71 | {
72 | using (ServerManager mgr = new ServerManager())
73 | {
74 | // First remove it from the sites
75 | Configuration adminConfig = mgr.GetAdministrationConfiguration();
76 | ConfigurationSection modulesSection = adminConfig.GetSection("modules");
77 | ConfigurationElementCollection modules = modulesSection.GetCollection();
78 | ConfigurationElement module = FindByAttribute(modules, "name", name);
79 | if (module != null)
80 | {
81 | modules.Remove(module);
82 | }
83 |
84 | // now remove the ModuleProvider
85 | ConfigurationSection moduleProvidersSection = adminConfig.GetSection("moduleProviders");
86 | ConfigurationElementCollection moduleProviders = moduleProvidersSection.GetCollection();
87 | ConfigurationElement moduleProvider = FindByAttribute(moduleProviders, "name", name);
88 | if (moduleProvider != null)
89 | {
90 | moduleProviders.Remove(moduleProvider);
91 | }
92 |
93 | mgr.CommitChanges();
94 | }
95 | }
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/Setup/PHPManagerSetupHelper/NewPHPMGRSNF.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RonaldCarter/PHPManager/f6cc53a7b6bae0c655331582c52ab5093602db97/Setup/PHPManagerSetupHelper/NewPHPMGRSNF.snk
--------------------------------------------------------------------------------
/Setup/PHPManagerSetupHelper/PHPManagerSetupHelper.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 9.0.30729
7 | 2.0
8 | {8BEC09DE-2794-4F7B-B091-C74CD934BE7F}
9 | Library
10 | Properties
11 | Web.Management.PHP.Setup
12 | Web.Management.PHP.Setup
13 | v4.5
14 | 512
15 | true
16 | NewPHPMGRSNF.snk
17 | false
18 |
19 |
20 |
21 |
22 | 3.5
23 |
24 |
25 |
26 | true
27 | full
28 | false
29 | ..\..\bin\Debug\
30 | DEBUG;TRACE
31 | prompt
32 | 4
33 | AnyCPU
34 | false
35 | true
36 |
37 |
38 | pdbonly
39 | true
40 | ..\..\bin\Release\
41 | TRACE
42 | prompt
43 | 4
44 | AnyCPU
45 | false
46 | false
47 | true
48 |
49 |
50 |
51 | ..\..\packages\Microsoft.Web.Administration.7.0.0.0\lib\net20\Microsoft.Web.Administration.dll
52 | True
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 | SharedAssembyInfo.cs
65 |
66 |
67 |
68 | True
69 | True
70 | Resources.resx
71 |
72 |
73 | True
74 | True
75 | Settings.settings
76 |
77 |
78 | Component
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 | SettingsSingleFileGenerator
88 | Settings.Designer.cs
89 |
90 |
91 |
92 |
93 | ResXFileCodeGenerator
94 | Resources.Designer.cs
95 |
96 |
97 |
98 |
105 |
--------------------------------------------------------------------------------
/Setup/PHPManagerSetupHelper/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("PHPManagerSetupHelper")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 |
11 | // Setting ComVisible to false makes the types in this assembly not visible
12 | // to COM components. If you need to access a type in this assembly from
13 | // COM, set the ComVisible attribute to true on that type.
14 | [assembly: ComVisible(false)]
15 |
16 | // The following GUID is for the ID of the typelib if this project is exposed to COM
17 | [assembly: Guid("e00f42cd-b76d-4522-ad94-b433584ecfe8")]
--------------------------------------------------------------------------------
/Setup/PHPManagerSetupHelper/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Web.Management.PHP.Setup.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Web.Management.PHP.Setup.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Setup/PHPManagerSetupHelper/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 | text/microsoft-resx
91 |
92 |
93 | 1.3
94 |
95 |
96 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
97 |
98 |
99 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
100 |
101 |
--------------------------------------------------------------------------------
/Setup/PHPManagerSetupHelper/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Web.Management.PHP.Setup.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.6.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Setup/PHPManagerSetupHelper/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Setup/PHPManagerSetupHelper/SetupAction.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System.ComponentModel;
11 | using System.Configuration.Install;
12 | using System.Reflection;
13 |
14 | namespace Web.Management.PHP.Setup
15 | {
16 |
17 | [RunInstaller(true)]
18 | public class SetupAction : Installer
19 | {
20 |
21 | public override void Install(System.Collections.IDictionary stateSaver)
22 | {
23 | base.Install(stateSaver);
24 |
25 | Assembly assembly = Assembly.GetExecutingAssembly();
26 | AssemblyName assemblyName = assembly.GetName();
27 | string assemblyFullName = assemblyName.FullName;
28 | string clientAssemblyFullName = assemblyFullName.Replace(assemblyName.Name, "Web.Management.PHP");
29 |
30 | InstallUtil.RemoveUIModuleProvider("PHP"); // This is necessary for the upgrade scenario
31 | InstallUtil.AddUIModuleProvider("PHP", "Web.Management.PHP.PHPProvider, " + clientAssemblyFullName);
32 | }
33 |
34 | public override void Uninstall(System.Collections.IDictionary savedState)
35 | {
36 | base.Uninstall(savedState);
37 |
38 | InstallUtil.RemoveUIModuleProvider("PHP");
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Setup/PHPManagerSetupHelper/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Setup/PHPManagerSetupHelper/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Setup/php-logo16.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RonaldCarter/PHPManager/f6cc53a7b6bae0c655331582c52ab5093602db97/Setup/php-logo16.ico
--------------------------------------------------------------------------------
/SharedAssembyInfo.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
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 | //
8 | //-----------------------------------------------------------------------
9 |
10 | using System.Reflection;
11 |
12 | // General Information about an assembly is controlled through the following
13 | // set of attributes. Change these attribute values to modify the information
14 | // associated with an assembly.
15 | [assembly: AssemblyCompany("PHP Manager Project")]
16 | [assembly: AssemblyProduct("PHP Manager for IIS")]
17 | [assembly: AssemblyCopyright("Copyright © PHP Manager Project 2011")]
18 | [assembly: AssemblyTrademark("")]
19 | [assembly: AssemblyCulture("")]
20 |
21 | // Version information for an assembly consists of the following four values:
22 | //
23 | // Major Version
24 | // Minor Version
25 | // Build Number
26 | // Revision
27 | //
28 | // You can specify all the values or you can default the Build and Revision Numbers
29 | // by using the '*' as shown below:
30 | // [assembly: AssemblyVersion("1.0.*")]
31 | [assembly: AssemblyVersion("1.3.0.0")]
32 | [assembly: AssemblyFileVersion("1.3.0.0")]
--------------------------------------------------------------------------------
/bin/Release/PHPManagerForIIS.msi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RonaldCarter/PHPManager/f6cc53a7b6bae0c655331582c52ab5093602db97/bin/Release/PHPManagerForIIS.msi
--------------------------------------------------------------------------------