function getURL() { global $HTTP_HOST; global $REQUEST_URI; return "http://{$HTTP_HOST}{$REQUEST_URI}"; } function getURLData($type) { $URL = getURL(); $urlPacket = parse_url($URL); return $urlPacket[$type]; } function currentPage() { $match = array(); $path = getURLData('path'); $page = preg_match('/[.]*[^\\/]*$/', $path, $match); $pageref = $match[0]; return preg_replace('/.php/', '', $pageref); } $root = "C:/Program Files/Apache Group/Apache2/htdocs/iwfms/"; include_once $root . 'includes/configuration/database.php'; include_once $root . 'includes/configuration/core_includes.php'; // set date and time stuff $today = gmdate("d-m-y"); $mysql_today = gmdate("Y-m-d"); $time = date("H:i"); $time_full = date("H:i:s"); $year = date("Y"); $modified = time::ts_unix_mysql(time::timestamp());
$stoptime = time::stoptiming(); performance::message("Stop Prolog Planner parsing"); if ($model['workflowCaching']) { saveCachePlans($planGraphList, $keyinserted, $modelId); } else { savePlans($planGraphList, $keyinserted, true); } $newstoptime = time::stoptiming() - $stoptime; performance::message("Database updating"); echo '<br><Br>'; systemMessages::message("Plan generation complete!"); systemMessages::message("Number of plans:" . sizeof($planGraphList)); } } else { $workFlowvalues = array(); $workFlowvalues['timestamp'] = $modified = time::ts_unix_mysql(time::timestamp()); //Create a new workflow item $keyinserted = dbs::irrecord('workflow', $workFlowvalues, false); $planGraphList = dbs::selrecord('plan', 'workflowcachingstore', "modelId={$modelId}", 0, 3); savePlans($planGraphList, $keyinserted, false); echo '<br><Br>'; systemMessages::message("Plan generation using caching feature complete!"); systemMessages::message("Number of plans:" . sizeof($planGraphList)); } function savePlans($planGraphList, $workflowKey, $seralise) { $planValues = array(); $dbValues = array(); for ($index = 0; $index < sizeof($planGraphList); $index++) { if ($seralise) { $plan = addslashes(serialize($planGraphList[$index]));