• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List

E:/E/GEAMP/www/openbiz/openbiz/bin/sysheader_inc.php

00001 <?php
00017 include_once "sysclass_inc.php";
00018 
00019 if (isset($_SERVER['SERVER_NAME'])) { define('CLI', 0); define('nl', "<br/>"); }
00020 else { define('CLI', 1); define('nl', "\n"); }
00021 
00022 /****************************************************************************
00023    openbiz core path
00024  ****************************************************************************/
00025 //define('OPENBIZ_HOME', 'absolute_dir/Openbiz');
00026 if(!defined('OPENBIZ_HOME')) define('OPENBIZ_HOME',dirname(dirname(__FILE__)));
00027 if(!defined('OPENBIZ_BIN'))  define('OPENBIZ_BIN',OPENBIZ_HOME."/bin/");
00028 if(!defined('OPENBIZ_META')) define('OPENBIZ_META',OPENBIZ_HOME."/metadata/");
00029 
00030 /****************************************************************************
00031    third party library path
00032  ****************************************************************************/
00033 // Smarty package
00034 if(!defined('SMARTY_DIR')) define('SMARTY_DIR',OPENBIZ_HOME."/others/Smarty/libs/");
00035 
00036 /****************************************************************************
00037    application services
00038  ****************************************************************************/
00039 if(!defined('AUTH_SERVICE'))     define('AUTH_SERVICE',        "service.authService");
00040 if(!defined('ACCESS_SERVICE'))   define('ACCESS_SERVICE',      "service.accessService");
00041 if(!defined('ACL_SERVICE'))      define('ACL_SERVICE', "service.aclService");
00042 if(!defined('PROFILE_SERVICE'))  define('PROFILE_SERVICE',     "service.profileService");
00043 if(!defined('LOG_SERVICE'))      define('LOG_SERVICE',         "service.logService");
00044 if(!defined('EXCEL_SERVICE'))    define('EXCEL_SERVICE',       "service.excelService");
00045 if(!defined('PDF_SERVICE'))      define('PDF_SERVICE',         "service.pdfService");
00046 if(!defined('IO_SERVICE'))       define('IO_SERVICE',          "service.ioService");
00047 if(!defined('EMAIL_SERVICE'))    define('EMAIL_SERVICE',       "service.emailService");
00048 if(!defined('DOTRIGGER_SERVICE')) define('DOTRIGGER_SERVICE', "service.doTriggerService");
00049 if(!defined('GENID_SERVICE'))    define('GENID_SERVICE',       "service.genIdService");
00050 if(!defined('VALIDATE_SERVICE')) define('VALIDATE_SERVICE', "service.validateService");
00051 if(!defined('QUERY_SERVICE'))       define('QUERY_SERVICE',    "service.queryService");
00052 if(!defined('SECURITY_SERVICE')) define('SECURITY_SERVICE', "service.securityService");
00053 if(!defined('EVENTLOG_SERVICE')) define('EVENTLOG_SERVICE', "service.eventlogService");
00054 if(!defined('CACHE_SERVICE'))       define('CACHE_SERVICE',    "service.cacheService");
00055 if(!defined('CRYPT_SERVICE'))       define('CRYPT_SERVICE',    "service.cryptService");
00056 if(!defined('LOCALEINFO_SERVICE')) define('LOCALEINFO_SERVICE', "service.localeInfoService");
00057 
00058 /* whether print debug infomation or not */
00059 if(!defined('DEBUG')) define("DEBUG", 1);
00060 if(!defined('PROFILING')) define("PROFILING", 1);
00061 
00062 /* check whether user logged in */
00063 if(!defined('CHECKUSER')) define("CHECKUSER", "N");
00064 /* session timeout seconds */
00065 if(!defined('TIMEOUT')) define("TIMEOUT", -1);  // -1 means never timeout.
00066 
00067 //include system message file
00068 include_once(OPENBIZ_HOME."/messages/system.msg");
00069 
00070 // defined Zend framework library home as ZEND_FRWK_HOME
00071 define('ZEND_FRWK_HOME', OPENBIZ_HOME."/others/");
00072 
00073 /* Popup Suffix for Modal or Popup Windows */
00074 define('Popup_Suffix', "_popupx_");
00075 
00076 // add zend framework to include path
00077 set_include_path(get_include_path() . PATH_SEPARATOR . ZEND_FRWK_HOME);
00078 
00079 /* global variables */
00080 include_once("BizSystem.php");
00081 $g_BizSystem = BizSystem::instance();
00082 
00083 // error handling 
00084 error_reporting(E_ALL ^ (E_NOTICE | E_STRICT));
00085 
00086 // if use user defined error handling function, all errors are reported to the function
00087 $default_error_handler = set_error_handler("userErrorHandler");
00088 $default_exception_handler = set_exception_handler('userExceptionHandler');
00089 
00090 // set DOCUMENT_ROOT
00091 setDocumentRoot();
00092 
00100 function __autoload_openbiz($className)
00101 {
00102     /*$filePath = BizSystem::getLibFileWithPath($className);
00103     if ($filePath)
00104     {
00105         include_once($filePath);
00106         return;
00107     }*/
00108     BizSystem::loadClass($className);
00109 }
00110 if(!function_exists("__autoload"))
00111 {
00112        spl_autoload_register("__autoload_openbiz");     
00113 }
00114 
00120 function userErrorHandler ($errno, $errmsg, $filename, $linenum, $vars)
00121 {
00122     include_once(OPENBIZ_BIN.'ErrorHandler.php');
00123     OB_ErrorHandler::ErrorHandler($errno, $errmsg, $filename, $linenum, $vars);
00124 }
00125 
00131 function userExceptionHandler ($exc)
00132 {
00133     include_once(OPENBIZ_BIN.'ErrorHandler.php');
00134     OB_ErrorHandler::ExceptionHandler($exc);
00135 }
00136 /*
00137  * Set DOCUMENT_ROOT in case the server doesn't have DOCUMENT_ROOT setting (e.g. IIS). 
00138  * Reference from http://fyneworks.blogspot.com/2007/08/php-documentroot-in-iis-windows-servers.html
00139  */
00140 function setDocumentRoot()
00141 {
00142     if(!isset($_SERVER['DOCUMENT_ROOT'])){ if(isset($_SERVER['SCRIPT_FILENAME'])){
00143     $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
00144     }; };
00145     if(!isset($_SERVER['DOCUMENT_ROOT'])){ if(isset($_SERVER['PATH_TRANSLATED'])){
00146     $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
00147     }; };
00148 }
00149 ?>

Generated on Thu Apr 19 2012 17:09:14 for openbiz by  doxygen 1.7.2