getMessage(); die(); } } $include_path = get_include_path(); $include_path_tokens = explode(PATH_SEPARATOR, $include_path); foreach ($include_path_tokens as $prefix) { $path[0] = $prefix . DIRECTORY_SEPARATOR . $class_name . '.interface.php'; $path[1] = $prefix . DIRECTORY_SEPARATOR . $class_name . '.class.php'; foreach ($path as $thisPath) { if (file_exists($thisPath)) { require_once $thisPath; return; } } } }); /** * Define remaining app-wide constants */ define('ZAP_MOMENT', date("Y-m-d-H_i_s")); define('ZAP_VERSION', '0.9.0'); define('ZAP_SESSION_NAME', 'ZAP'); // Only start session in web mode (not CLI) if (php_sapi_name() !== 'cli') { Session::start(ZAP_SESSION_NAME); } /** * returns string of path of template file * @return string */ function getZAPTemplate($tplname) { if (!defined('ZAP_APP_BASE_DIR')) { throw new Exception(ERROR_PREFIX . 'No base directory defined?!'); } $tplfile = $tplname . '.tpl'; $tplfilepath = ZAP_APP_BASE_DIR . DIRECTORY_SEPARATOR . ZAP_TPL_DIR . DIRECTORY_SEPARATOR . $tplfile; if (file_exists($tplfilepath)) { return $tplfilepath; } else { throw new Exception(ERROR_PREFIX . 'No template'); } } ?>