Changes between Version 57 and Version 58 of Docs/Prog/Manual/ApplicationLibraries/lib825db


Ignore:
Timestamp:
02/19/26 15:28:51 (5 days ago)
Author:
Don Wilson
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Docs/Prog/Manual/ApplicationLibraries/lib825db

    v57 v58  
    174174
    175175//appinfo.h//
    176 {{{
    177 #define APP_NAME                                "SO123456"
    178 #define APP_DIR                                 "so123456"
    179 #define APP_VER                                 "01.00.00"
    180 
    181 #define APPS                                    "/mnt/nand/apps/"
    182 #define APP_DATA_DIR                    APPS APP_DIR "/"
    183 
    184 #define REPORTS_SYMLINK                 "/usr/share/apache2/default-site/htdocs/reports/custom/" APP_NAME
     176{{{#!c++
     177const char* const APPDATA_DIRNAME = "so123456";
     178const char* const HTTP_CUSTOM_REPORTS_PATH = "/usr/share/apache2/default-site/htdocs/reports/custom/";
    185179}}}
    186180
     
    192186
    193187if(dynamic_cast<CDBMySQL*>(appDB)) {
    194         string reportsPath = APP_DATA_DIR;
    195         reportsPath += "reports";
     188        string reportsPath = appDataPath + "reports";
    196189        DEBUG_MSG("Check for report dir [%s]\n", reportsPath.c_str());
    197190        if(stat(reportsPath.c_str(), &st) == 0) {
     
    201194                // If link is not there create the link to the reports directory.
    202195                // When reports.php runs it will check for these files to add links to the reports
    203                 if(stat(REPORTS_SYMLINK, &st) != 0) {
    204                         DEBUG_MSG("Symlink [%s] not found - creating it\n", REPORTS_SYMLINK);
     196                string symlink = HTTP_CUSTOM_REPORTS_PATH;
     197                symlink += APPDATA_DIRNAME;
     198                if(stat(symlink.c_str(), &st) != 0) {
     199                        DEBUG_MSG("Symlink [%s] not found - creating it\n", symlink.c_str());
    205200                        char cmd[400];
    206                         sprintf_s(cmd, "ln -s %s %s", reportsPath.c_str(), REPORTS_SYMLINK);
     201                        sprintf_s(cmd, "ln -s %s %s", reportsPath.c_str(), symlink.c_str());
    207202                        DEBUG_MSG("cmd [%s]\n", cmd);
    208203                        if(system(cmd) != 0) {