From: Simon H. <sim...@us...> - 2010-11-01 18:18:38
|
Update of /cvsroot/stack/stack-dev/lib/deployment In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv12921/lib/deployment Modified Files: Deployment.php Log Message: Stable interim commit towards deployment updating. Index: Deployment.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/deployment/Deployment.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Deployment.php 30 Sep 2010 16:56:21 -0000 1.12 --- Deployment.php 1 Nov 2010 18:18:30 -0000 1.13 *************** *** 54,58 **** $this->engineID = $engineid; ! $this->logger->debug("minstrels: ".$this->engineID); } --- 54,58 ---- $this->engineID = $engineid; ! $this->logger->debug("engine id in Deployment constructor: ".$this->engineID); } *************** *** 61,65 **** //$xhtml = "<form method='POST' action='?id=".$this->version."'> $xhtml = "<input type='submit' name='submit' value='add'> ! <input type='text' name='add' value='1' size='3' maxlength='3'/> " . get_string('FE_deployQuestion_newversions', 'stack'); //" <input type='checkbox' name='autoprime' ".(isset($_POST['autoprime'])?'checked="checked"':"")."> ".get_string('FE_deployQuestion_autoprime', 'stack'); /*" <input type='submit' onclick='return confirm(\"" . --- 61,65 ---- //$xhtml = "<form method='POST' action='?id=".$this->version."'> $xhtml = "<input type='submit' name='submit' value='add'> ! <input type='text' name='add' value='1' size='3' maxlength='3'/> " . get_string('FE_deployQuestion_newRandomInstances', 'stack'); //" <input type='checkbox' name='autoprime' ".(isset($_POST['autoprime'])?'checked="checked"':"")."> ".get_string('FE_deployQuestion_autoprime', 'stack'); /*" <input type='submit' onclick='return confirm(\"" . *************** *** 82,86 **** if(!empty($this->engineID)) { ! $this->logger->debug('we is in moodle checking your engine ids'); $db = new MoodleDB(); $db->connect(); --- 82,86 ---- if(!empty($this->engineID)) { ! $this->logger->debug('In moodle, checking your engine ids'); $db = new MoodleDB(); $db->connect(); *************** *** 130,133 **** --- 130,150 ---- + // update request (the caching part - Moddle Question Bank handled elsewhere) + if (isset($param['operation']) && $param['operation'] == 'update' && is_numeric($param['prior'])) { + // take id, prior, number, category and update + + // undeploy all old + $toDrop = new Deployment($param['prior']); + $this->logger->debug('trying to drop version'.$param['version'].' during update'); + $toDrop->drop($param['engine']); + + // Do new deploy last in case of timeout? + // create new deployment + if (!$this->isSingleton()) { // should auto-deploy in constructor + $msg = get_string('FE_deployQuestion_attemptingDeploy', 'stack', $param['number']); + $initialStates = $this->cache->deployCache($this->version, $param['number']); + } + } + // prime requests if (isset ($param['operation']) && $param['operation'] == 'prime' && is_numeric($param['instance'])) { *************** *** 348,351 **** --- 365,372 ---- return $this->line; } + + function getEngineID() { + return $this->engineID; + } } ?> \ No newline at end of file |