Roxen.git / server / base_server / roxenloader.pike

version» Context lines:

Roxen.git/server/base_server/roxenloader.pike:41:   // Disabled since it isn't compatible enough - has to be enabled on a   // per-connection basis through the charset argument. /mast   //#define ENABLE_MYSQL_UNICODE_MODE      int remove_dumped;   string configuration_dir;   int once_mode;      #define werror roxen_perror    + #ifdef DEBUG + #define REPORT_DEBUG(X ...) report_debug(X) + #else + #define REPORT_DEBUG(X ...) + #endif +    constant cvs_version="$Id$";      int pid = getpid();   Stdio.File stderr = Stdio.File("stderr");      #if !constant(uname)   #ifdef __NT__   mapping uname()   {    return ([
Roxen.git/server/base_server/roxenloader.pike:1832:   {    string ver = r_read_bytes(combine_path(package_dir, "VERSION"));    if (ver && (ver != "")) {    report_debug("Adding package %s (Version %s).\n",    roxen_path (package_dir), ver - "\n");    } else {    report_debug("Adding package %s.\n",    roxen_path (package_dir));    }    package_directories += ({ package_dir }); -  -  string real_pkg_dir = roxen_path (package_dir); +  string real_pkg_dir = lfile_path(package_dir);    string sub_dir = combine_path(real_pkg_dir, "pike-modules");    if (Stdio.is_dir(sub_dir)) { -  +  REPORT_DEBUG(" Pike modules: %O\n", sub_dir);    master()->add_module_path(sub_dir);    }    if (Stdio.is_dir(sub_dir = combine_path(real_pkg_dir, "include/"))) { -  +  REPORT_DEBUG(" Pike includes: %O\n", sub_dir);    master()->add_include_path(sub_dir);    } -  + #ifdef RUN_SELF_TEST +  sub_dir = combine_path(real_pkg_dir, "test/pike-modules"); +  if (Stdio.is_dir(sub_dir)) { +  REPORT_DEBUG(" Pike modules: %O\n", sub_dir); +  master()->add_module_path(sub_dir); +  } +  if (Stdio.is_dir(sub_dir = combine_path(real_pkg_dir, "test/include/"))) { +  REPORT_DEBUG(" Pike includes: %O\n", sub_dir); +  master()->add_include_path(sub_dir); +  } + #endif    -  package_module_path += ({ combine_path(package_dir, "modules/") }); -  if (r_is_dir(sub_dir = combine_path(package_dir, "roxen-modules/"))) { +  if (Stdio.is_dir(sub_dir = combine_path(real_pkg_dir, "roxen-modules/"))) { +  REPORT_DEBUG(" Roxen modules: %O\n", sub_dir);    package_module_path += ({ sub_dir }); -  +  } else { +  sub_dir = combine_path(real_pkg_dir, "modules/"); +  REPORT_DEBUG(" Roxen modules: %O\n", sub_dir); +  package_module_path += ({ sub_dir });    } -  if (r_is_dir(sub_dir = combine_path(package_dir, "fonts/"))) { +  if (Stdio.is_dir(sub_dir = combine_path(real_pkg_dir, "fonts/"))) { +  REPORT_DEBUG(" Fonts: %O\n", sub_dir);    default_roxen_font_path += ({ sub_dir });    } -  + #ifdef RUN_SELF_TEST +  if (Stdio.is_dir(sub_dir = combine_path(real_pkg_dir, "test/roxen-modules/"))) { +  REPORT_DEBUG(" Roxen modules: %O\n", sub_dir); +  package_module_path += ({ sub_dir }); +  } else if (Stdio.is_dir(sub_dir = combine_path(real_pkg_dir, "test/modules/"))) { +  REPORT_DEBUG(" Roxen modules: %O\n", sub_dir); +  package_module_path += ({ sub_dir });    } -  + #endif + }         //! @appears lopen   object|void lopen(string filename, string mode, int|void perm)   {    if( filename[0] != '/' ) {    foreach(package_directories, string dir) {    Stdio.File o;    if (o = open(combine_path(roxen_path(dir), filename), mode, perm))    return o;    }    } -  return open( filename, mode, perm ); +  return open( roxen_path(filename), mode, perm );   }      //! @appears lfile_stat   object(Stdio.Stat) lfile_stat(string filename)   {    if (filename[0] != '/') {    foreach(package_directories, string dir) {    Stdio.Stat res;    if (res = file_stat(combine_path(roxen_path(dir), filename)))    return res;    }    } -  return file_stat(filename); +  return file_stat(roxen_path(filename));   }      //! @appears lfile_path   string lfile_path(string filename)   {    if (filename[0] != '/') {    foreach(package_directories, string dir) {    string path = combine_path(roxen_path(dir), filename);    if (file_stat(path)) return path;    }    } -  return file_stat(filename) && filename; +  return file_stat(roxen_path(filename)) && roxen_path(filename);   }    -  + array(string) lget_dir(string path) + { +  if (path[0] != '/') { +  array(string) res = UNDEFINED; +  foreach(package_directories, string dir) { +  array(string) paths = +  get_dir(combine_path(roxen_path(dir), path)); +  if (paths) res += paths; +  } +  if (res) return Array.uniq(res); +  } +  return get_dir(roxen_path(path)); + } +    // Make a $PATH-style string   string make_path(string ... from)   {    return map(from, lambda(string a, string b) {    return (a[0]=='/')?combine_path("/",a):combine_path(b,a);    //return combine_path(b,a);    }, server_dir)*":";   }      //! @appears isodate
Roxen.git/server/base_server/roxenloader.pike:3845:    add_constant("roxen_version", roxen_version);    add_constant("roxen_dist_version", dist_version);    add_constant("roxen_dist_os", dist_os);    add_constant("roxen_release", release || roxen_release);    add_constant("roxen_is_cms", roxen_is_cms);    add_constant("roxen_product_name", roxen_product_name);    add_constant("roxen_product_code", roxen_product_code);    add_constant("lopen", lopen);    add_constant("lfile_stat", lfile_stat);    add_constant("lfile_path", lfile_path); +  add_constant("lget_dir", lget_dir);    add_constant("report_notice", report_notice);    add_constant("report_debug", report_debug);    add_constant("report_warning",report_warning);    add_constant("report_error", report_error);    add_constant("report_fatal", report_fatal);    add_constant("report_notice_for", report_notice_for);    add_constant("report_warning_for", report_warning_for);    add_constant("report_error_for", report_error_for);    add_constant("report_fatal_for", report_fatal_for);    add_constant("report_warning_sparsely", report_warning_sparsely);