PageRenderTime 40ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/stable-1.1.1/Server/FastCgi/ApplicationElement.cs

#
C# | 250 lines | 214 code | 20 blank | 16 comment | 2 complexity | c836e12aa43a7bdde1774a4f38bfe320 MD5 | raw file
Possible License(s): CC-BY-SA-3.0
  1. //-----------------------------------------------------------------------
  2. // <copyright>
  3. // Copyright (C) Ruslan Yakushev for the PHP Manager for IIS project.
  4. //
  5. // This file is subject to the terms and conditions of the Microsoft Public License (MS-PL).
  6. // See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL for more details.
  7. // </copyright>
  8. //-----------------------------------------------------------------------
  9. using Microsoft.Web.Administration;
  10. namespace Web.Management.PHP.FastCgi
  11. {
  12. internal class ApplicationElement : ConfigurationElement
  13. {
  14. private EnvironmentVariablesCollection _environmentVars;
  15. public int ActivityTimeout
  16. {
  17. get
  18. {
  19. return (int)base["activityTimeout"];
  20. }
  21. set
  22. {
  23. base["activityTimeout"] = value;
  24. }
  25. }
  26. public string Arguments
  27. {
  28. get
  29. {
  30. return (string)base["arguments"];
  31. }
  32. set
  33. {
  34. base["arguments"] = value;
  35. }
  36. }
  37. public EnvironmentVariablesCollection EnvironmentVariables
  38. {
  39. get
  40. {
  41. if (this._environmentVars == null)
  42. {
  43. ConfigurationElement environmentVars = base.GetChildElement("environmentVariables");
  44. this._environmentVars = (EnvironmentVariablesCollection)environmentVars.GetCollection(typeof(EnvironmentVariablesCollection));
  45. }
  46. return this._environmentVars;
  47. }
  48. }
  49. public bool FlushNamedPipe
  50. {
  51. get
  52. {
  53. return (bool)base["flushNamedPipe"];
  54. }
  55. set
  56. {
  57. base["flushNamedPipe"] = value;
  58. }
  59. }
  60. public string FullPath
  61. {
  62. get
  63. {
  64. return (string)base["fullPath"];
  65. }
  66. set
  67. {
  68. base["fullPath"] = value;
  69. }
  70. }
  71. public int IdleTimeout
  72. {
  73. get
  74. {
  75. return (int)base["idleTimeout"];
  76. }
  77. set
  78. {
  79. base["idleTimeout"] = value;
  80. }
  81. }
  82. public long InstanceMaxRequests
  83. {
  84. get
  85. {
  86. return (long)base["instanceMaxRequests"];
  87. }
  88. set
  89. {
  90. base["instanceMaxRequests"] = value;
  91. }
  92. }
  93. public int MaxInstances
  94. {
  95. get
  96. {
  97. return (int)base["maxInstances"];
  98. }
  99. set
  100. {
  101. base["maxInstances"] = value;
  102. }
  103. }
  104. public string MonitorChangesTo
  105. {
  106. get
  107. {
  108. return (string)base["monitorChangesTo"];
  109. }
  110. set
  111. {
  112. base["monitorChangesTo"] = value;
  113. }
  114. }
  115. public Protocol Protocol
  116. {
  117. get
  118. {
  119. return ((Protocol)base["protocol"]);
  120. }
  121. set
  122. {
  123. base["protocol"] = (int)value;
  124. }
  125. }
  126. public int QueueLength
  127. {
  128. get
  129. {
  130. return (int)base["queueLength"];
  131. }
  132. set
  133. {
  134. base["queueLength"] = value;
  135. }
  136. }
  137. public int RapidFailsPerMinute
  138. {
  139. get
  140. {
  141. return (int)base["rapidFailsPerMinute"];
  142. }
  143. set
  144. {
  145. base["rapidFailsPerMinute"] = value;
  146. }
  147. }
  148. public int RequestTimeout
  149. {
  150. get
  151. {
  152. return (int)base["requestTimeout"];
  153. }
  154. set
  155. {
  156. base["requestTimeout"] = value;
  157. }
  158. }
  159. // When FastCGI update is not installed then this property does not exist
  160. // We need to handle this case and eat the exception
  161. public int SignalBeforeTerminateSeconds
  162. {
  163. get
  164. {
  165. int result = 0;
  166. try
  167. {
  168. result = (int)base["signalBeforeTerminateSeconds"];
  169. }
  170. catch
  171. {
  172. // Do nothing here
  173. }
  174. return result;
  175. }
  176. set
  177. {
  178. try
  179. {
  180. base["signalBeforeTerminateSeconds"] = value;
  181. }
  182. catch
  183. {
  184. // Do nothing here
  185. }
  186. }
  187. }
  188. // When FastCGI update is not installed then this property does not exist
  189. // We need to handle this case and eat the exception
  190. public StderrMode StderrMode
  191. {
  192. get
  193. {
  194. StderrMode result = StderrMode.IgnoreAndReturn200;
  195. try
  196. {
  197. result = ((StderrMode)base["stderrMode"]);
  198. }
  199. catch
  200. {
  201. // Do nothing here
  202. }
  203. return result;
  204. }
  205. set
  206. {
  207. try
  208. {
  209. base["stderrMode"] = (int)value;
  210. }
  211. catch
  212. {
  213. // Do nothing here
  214. }
  215. }
  216. }
  217. public bool MonitorChangesToExists()
  218. {
  219. try
  220. {
  221. object o = base["monitorChangesTo"];
  222. return true;
  223. }
  224. catch
  225. {
  226. return false;
  227. }
  228. }
  229. }
  230. }