PageRenderTime 36ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/src/runtime/base/runtime_option.h

https://github.com/tmjnaid/hiphop-php
C Header | 318 lines | 251 code | 37 blank | 30 comment | 0 complexity | a27ea5f2a201f35658b4648a4c474b3c MD5 | raw file
  1. /*
  2. +----------------------------------------------------------------------+
  3. | HipHop for PHP |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 2010 Facebook, Inc. (http://www.facebook.com) |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. */
  16. #ifndef __RUNTIME_OPTION_H__
  17. #define __RUNTIME_OPTION_H__
  18. #include <runtime/base/server/virtual_host.h>
  19. #include <runtime/base/server/satellite_server.h>
  20. #include <runtime/base/server/files_match.h>
  21. namespace HPHP {
  22. ///////////////////////////////////////////////////////////////////////////////
  23. /**
  24. * Configurable options set from command line or configurable file at startup
  25. * time.
  26. */
  27. class RuntimeOption {
  28. public:
  29. static void Load(Hdf &config);
  30. static const char *ExecutionMode;
  31. static std::string BuildId;
  32. static std::string PidFile;
  33. static std::string LogFile;
  34. static std::string LogAggregatorFile;
  35. static std::string LogAggregatorDatabase;
  36. static int LogAggregatorSleepSeconds;
  37. static bool AlwaysLogUnhandledExceptions;
  38. static bool InjectedStackTrace;
  39. static bool NoSilencer;
  40. static bool EnableApplicationLog;
  41. static bool CallUserHandlerOnFatals;
  42. static int RuntimeErrorReportingLevel;
  43. static bool NoInfiniteLoopDetection;
  44. static bool NoInfiniteRecursionDetection;
  45. static bool ThrowBadTypeExceptions;
  46. static bool ThrowTooManyArguments;
  47. static bool WarnTooManyArguments;
  48. static bool ThrowMissingArguments;
  49. static bool ThrowInvalidArguments;
  50. static bool FatalOnWeirdForEach;
  51. static bool AssertActive;
  52. static bool AssertWarning;
  53. static int NoticeFrequency; // output 1 out of NoticeFrequency notices
  54. static int WarningFrequency;
  55. static int64 SerializationSizeLimit;
  56. static int64 StringOffsetLimit;
  57. static std::string AccessLogDefaultFormat;
  58. static std::vector<std::pair<std::string, std::string> > AccessLogs;
  59. static std::string AdminLogFormat;
  60. static std::string AdminLogFile;
  61. static std::string Tier;
  62. static std::string Host;
  63. static std::string DefaultServerNameSuffix;
  64. static std::string ServerIP;
  65. static std::string ServerPrimaryIP;
  66. static int ServerPort;
  67. static int ServerThreadCount;
  68. static int PageletServerThreadCount;
  69. static int FiberCount;
  70. static int RequestTimeoutSeconds;
  71. static int RequestMemoryMaxBytes;
  72. static int ImageMemoryMaxBytes;
  73. static int ResponseQueueCount;
  74. static int ServerGracefulShutdownWait;
  75. static int ServerDanglingWait;
  76. static bool ServerHarshShutdown;
  77. static bool ServerEvilShutdown;
  78. static int GzipCompressionLevel;
  79. static std::string ForceCompressionURL;
  80. static std::string ForceCompressionCookie;
  81. static std::string ForceCompressionParam;
  82. static bool EnableMagicQuotesGpc;
  83. static bool EnableKeepAlive;
  84. static int ConnectionTimeoutSeconds;
  85. static bool EnableOutputBuffering;
  86. static std::string OutputHandler;
  87. static bool ImplicitFlush;
  88. static bool EnableEarlyFlush;
  89. static bool ForceChunkedEncoding;
  90. static int MaxPostSize;
  91. static bool AlwaysPopulateRawPostData;
  92. static int UploadMaxFileSize;
  93. static std::string UploadTmpDir;
  94. static bool EnableFileUploads;
  95. static bool EnableUploadProgress;
  96. static int Rfc1867Freq;
  97. static std::string Rfc1867Prefix;
  98. static std::string Rfc1867Name;
  99. static bool LibEventSyncSend;
  100. static bool ExpiresActive;
  101. static int ExpiresDefault;
  102. static std::string DefaultCharsetName;
  103. static bool ForceServerNameToHeader;
  104. static VirtualHostPtrVec VirtualHosts;
  105. static IpBlockMapPtr IpBlocks;
  106. static SatelliteServerInfoPtrVec SatelliteServerInfos;
  107. // If a request has a body over this limit, switch to on-demand reading.
  108. // -1 for no limit.
  109. static int RequestBodyReadLimit;
  110. static bool EnableSSL;
  111. static int SSLPort;
  112. static std::string SSLCertificateFile;
  113. static std::string SSLCertificateKeyFile;
  114. static int XboxServerThreadCount;
  115. static int XboxServerPort;
  116. static int XboxDefaultLocalTimeoutMilliSeconds;
  117. static int XboxDefaultRemoteTimeoutSeconds;
  118. static int XboxServerInfoMaxRequest;
  119. static int XboxServerInfoDuration;
  120. static std::string XboxServerInfoWarmupDoc;
  121. static std::string XboxServerInfoReqInitFunc;
  122. static std::string XboxServerInfoReqInitDoc;
  123. static std::string XboxProcessMessageFunc;
  124. static std::string XboxPassword;
  125. static std::string SourceRoot;
  126. static std::vector<std::string> IncludeSearchPaths;
  127. static std::string FileCache;
  128. static std::string DefaultDocument;
  129. static std::string ErrorDocument404;
  130. static std::string ErrorDocument500;
  131. static std::string FatalErrorMessage;
  132. static std::string FontPath;
  133. static bool EnableStaticContentCache;
  134. static bool EnableStaticContentFromDisk;
  135. static bool EnableOnDemandUncompress;
  136. static bool EnableStaticContentMMap;
  137. static std::string RTTIDirectory;
  138. static bool EnableCliRTTI;
  139. static std::string StartupDocument;
  140. static std::string WarmupDocument;
  141. static std::string RequestInitFunction;
  142. static std::string RequestInitDocument;
  143. static std::vector<std::string> ThreadDocuments;
  144. static bool SafeFileAccess;
  145. static std::vector<std::string> AllowedDirectories;
  146. static std::set<std::string> AllowedFiles;
  147. static hphp_string_imap<std::string> StaticFileExtensions;
  148. static std::set<std::string> ForbiddenFileExtensions;
  149. static std::set<std::string> StaticFileGenerators;
  150. static FilesMatchPtrVec FilesMatches;
  151. static std::string TakeoverFilename;
  152. static int AdminServerPort;
  153. static int AdminThreadCount;
  154. static std::string AdminPassword;
  155. static std::string ProxyOrigin;
  156. static int ProxyRetry;
  157. static bool UseServeURLs;
  158. static std::set<std::string> ServeURLs;
  159. static bool UseProxyURLs;
  160. static int ProxyPercentage;
  161. static std::set<std::string> ProxyURLs;
  162. static std::vector<std::string> ProxyPatterns;
  163. static bool MySQLReadOnly;
  164. static bool MySQLLocalize; // whether to localize MySQL query results
  165. static int MySQLConnectTimeout;
  166. static int MySQLReadTimeout;
  167. static int MySQLWaitTimeout;
  168. static int MySQLSlowQueryThreshold;
  169. static bool MySQLKillOnTimeout;
  170. static int HttpDefaultTimeout;
  171. static int HttpSlowQueryThreshold;
  172. static bool TranslateLeakStackTrace;
  173. static bool NativeStackTrace;
  174. static bool FullBacktrace;
  175. static bool ServerStackTrace;
  176. static bool ServerErrorMessage;
  177. static bool TranslateSource;
  178. static bool RecordInput;
  179. static bool ClearInputOnSuccess;
  180. static std::string ProfilerOutputDir;
  181. static std::string CoreDumpEmail;
  182. static bool CoreDumpReport;
  183. static bool LocalMemcache;
  184. static bool MemcacheReadOnly;
  185. static bool EnableStats;
  186. static bool EnableWebStats;
  187. static bool EnableMemoryStats;
  188. static bool EnableMallocStats;
  189. static bool EnableAPCStats;
  190. static bool EnableAPCKeyStats;
  191. static bool EnableMemcacheStats;
  192. static bool EnableMemcacheKeyStats;
  193. static bool EnableSQLStats;
  194. static bool EnableSQLTableStats;
  195. static std::string StatsXSL;
  196. static std::string StatsXSLProxy;
  197. static int StatsSlotDuration;
  198. static int StatsMaxSlot;
  199. static bool EnableAPCSizeStats;
  200. static bool EnableAPCSizeDetail;
  201. static bool EnableAPCFetchStats;
  202. static bool APCSizeCountPrime;
  203. static int64 MaxRSS;
  204. static int64 MaxRSSPollingCycle;
  205. static int64 DropCacheCycle;
  206. static int64 MaxSQLRowCount;
  207. static int64 MaxMemcacheKeyCount;
  208. static int SocketDefaultTimeout;
  209. static bool EnableMemoryManager;
  210. static bool CheckMemory;
  211. static bool UseHphpArray;
  212. static bool UseSmallArray;
  213. static bool UseDirectCopy;
  214. static bool EnableApc;
  215. static bool EnableConstLoad;
  216. static bool ApcUseSharedMemory;
  217. static int ApcSharedMemorySize;
  218. static std::string ApcPrimeLibrary;
  219. static int ApcLoadThread;
  220. static std::set<std::string> ApcCompletionKeys;
  221. enum ApcTableTypes {
  222. ApcHashTable,
  223. ApcLfuTable,
  224. ApcConcurrentTable
  225. };
  226. static ApcTableTypes ApcTableType;
  227. enum ApcTableLockTypes {
  228. ApcMutex,
  229. ApcReadWriteLock
  230. };
  231. static ApcTableLockTypes ApcTableLockType;
  232. static time_t ApcKeyMaturityThreshold;
  233. static size_t ApcMaximumCapacity;
  234. static int ApcKeyFrequencyUpdatePeriod;
  235. static bool ApcExpireOnSets;
  236. static int ApcPurgeFrequency;
  237. static bool EnableDnsCache;
  238. static int DnsCacheTTL;
  239. static time_t DnsCacheKeyMaturityThreshold;
  240. static size_t DnsCacheMaximumCapacity;
  241. static int DnsCacheKeyFrequencyUpdatePeriod;
  242. static std::map<std::string, std::string> ServerVariables;
  243. static std::map<std::string, std::string> EnvVariables;
  244. // The file name that is used by LightProcess to bind the socket
  245. // is the following prefix followed by the pid of the hphp process.
  246. static std::string LightProcessFilePrefix;
  247. static int LightProcessCount;
  248. // Eval options
  249. static bool EnableXHP;
  250. static bool EnableStrict;
  251. static int StrictLevel;
  252. static bool StrictFatal;
  253. static bool RecordCodeCoverage;
  254. static std::string CodeCoverageOutputFile;
  255. // Sandbox options
  256. static bool SandboxMode;
  257. static std::string SandboxPattern;
  258. static std::string SandboxHome;
  259. static std::string SandboxFallback;
  260. static std::string SandboxConfFile;
  261. static std::map<std::string, std::string> SandboxServerVariables;
  262. // Debugger options
  263. static bool EnableDebugger;
  264. static bool EnableDebuggerServer;
  265. static int DebuggerServerPort;
  266. static int DebuggerDefaultRpcPort;
  267. static std::string DebuggerDefaultRpcAuth;
  268. static int DebuggerDefaultRpcTimeout;
  269. static std::string DebuggerDefaultSandboxPath;
  270. static std::string DebuggerStartupDocument;
  271. // Mail options
  272. static std::string SendmailPath;
  273. static std::string MailForceExtraParameters;
  274. // preg stack depth options
  275. static int PregBacktraceLimit;
  276. static int PregRecursionLimit;
  277. static bool FastMethodCall;
  278. };
  279. ///////////////////////////////////////////////////////////////////////////////
  280. }
  281. #endif // __RUNTIME_OPTION_H__