In the event of a config file being changed, this function allows the config to be reloaded, thereby changing the website content without a restart. The function is called once for each changed config file.
| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hdsApp::ReloadConfig | (const char*,) |
Declared in file: hzDissemino.h
Defined in file : hdsConfig.cpp
Function Logic:
Function body:
hzEcode hdsApp::ReloadConfig (const char* cfgfile)
{
// Category: Project Level Config Read Functions
//
// In the event of a config file being changed, this function allows the config to be reloaded, thereby changing the website content without a restart. The
// function is called once for each changed config file.
_hzfunc("hdsApp::reloadProject") ;
hzDocXml doc ; // XML document for reading and loading configs
hzXmlNode* pRoot ; // Root node of document
hzString fpath ; // Full file path of changed config file
hzEcode rc = E_OK ; // Return code
fpath = m_Configdir + "/" + cfgfile ;
m_pLog->Log("NOTE: Reloading Config %s\n", *fpath) ;
rc = doc.Load(fpath) ;
if (rc != E_OK)
{
m_pLog->Log("NOTE: Config %s did not load\n", *fpath) ;
m_pLog->Log(doc.Error()) ;
return rc ;
}
m_pLog->Log("Loaded Config %s\n", *fpath) ;
pRoot = doc.GetRoot() ;
if (!pRoot)
{
m_pLog->Log("NOTE: Config %s Document has no root\n", *fpath) ;
return E_NODATA ;
}
m_pLog->Log("Parsed Config %s\n", *fpath) ;
rc = _readInclFile(pRoot) ;
if (rc == E_OK)
m_pLog->Log("NOTE: Accepted Config %s\n", *fpath) ;
return rc ;
}