// set the include path properly for PHPIDS
set_include_path(
get_include_path()
. PATH_SEPARATOR
. ‘phpids/lib/’
);
if (!session_id()) {
session_start();
}
require_once ‘IDS/Init.php’;
try {
$request = array(
‘REQUEST’ => $_REQUEST,
‘GET’ => $_GET,
‘POST’ => $_POST,
‘COOKIE’ => $_COOKIE
);
$init = IDS_Init::init(dirname(__FILE__) . ‘/phpids/lib/IDS/Config/Config.ini.php’);
$f=$init->config['General']['base_path'] = dirname(__FILE__) . ‘/phpids/lib/IDS/’;
echo $f;
$init->config['General']['use_base_path'] = true;
$init->config['Caching']['caching'] = ‘file’;
$ids = new IDS_Monitor($request, $init);
$result = $ids->run();
if (!$result->isEmpty()) {
require_once ‘IDS/Log/File.php’;
require_once ‘IDS/Log/Email.php’;
require_once ‘IDS/Log/Composite.php’;
$compositeLog = new IDS_Log_Composite();
$compositeLog->addLogger(IDS_Log_Email::getInstance($init),IDS_Log_File::getInstance($init));
$compositeLog->execute($result);
}
} catch (Exception $e) {
//this shouldn’t happen and if it does you don’t want the notification public.
}
?>