MCPcopy Create free account
hub / github.com/Icinga/icinga2 / HandleLegacyDefines

Function HandleLegacyDefines

icinga-app/icinga.cpp:83–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83static void HandleLegacyDefines()
84{
85#ifdef _WIN32
86 String dataPrefix = Utility::GetIcingaDataPath();
87#endif /* _WIN32 */
88
89 Value localStateDir = Configuration::LocalStateDir;
90
91 if (!localStateDir.IsEmpty()) {
92 Log(LogWarning, "icinga-app")
93 << "Please do not set the deprecated 'LocalStateDir' constant,"
94 << " use the 'DataDir', 'LogDir', 'CacheDir' and 'SpoolDir' constants instead!"
95 << " For compatibility reasons, these are now set based on the 'LocalStateDir' constant.";
96
97#ifdef _WIN32
98 Configuration::DataDir = localStateDir + "\\lib\\icinga2";
99 Configuration::LogDir = localStateDir + "\\log\\icinga2";
100 Configuration::CacheDir = localStateDir + "\\cache\\icinga2";
101 Configuration::SpoolDir = localStateDir + "\\spool\\icinga2";
102 } else {
103 Configuration::LocalStateDir = dataPrefix + "\\var";
104#else /* _WIN32 */
105 Configuration::DataDir = localStateDir + "/lib/icinga2";
106 Configuration::LogDir = localStateDir + "/log/icinga2";
107 Configuration::CacheDir = localStateDir + "/cache/icinga2";
108 Configuration::SpoolDir = localStateDir + "/spool/icinga2";
109 } else {
110 Configuration::LocalStateDir = ICINGA_LOCALSTATEDIR;
111#endif /* _WIN32 */
112 }
113
114 Value sysconfDir = Configuration::SysconfDir;
115 if (!sysconfDir.IsEmpty()) {

Callers 1

icinga.cppFile · 0.85

Calls 3

GetIcingaDataPathFunction · 0.85
LogClass · 0.85
IsEmptyMethod · 0.45

Tested by

no test coverage detected