示例#1
0
 public static function getHandler(CalemVersion $new, CalemVersion $curr)
 {
     include _CALEM_DIR_ . 'server/upgrade/upgrade_map.php';
     @(include _CALEM_DIR_ . 'server/upgrade/upgrade_map.custom.custom.php');
     $entry = $_CALEM_upgrade[$new->getVid()];
     if (!$entry) {
         return null;
     }
     $hi = $entry['from'][$curr->getVid()];
     if (!$hi) {
         return null;
     }
     $path = _CALEM_DIR_ . $hi['path'] . '/';
     require_once $path . $hi['class'] . '.php';
     $obj = new $hi['class']();
     $obj->init($new, $curr);
     return $obj;
 }
示例#2
0
 public function startUpgrade(CalemVersion $vNew, CalemVersion $vOld)
 {
     $this->initDbo();
     $this->dboLog->setChangeBulk(array('vid' => $vNew->getVid(), 'ver_note' => $vNew->getNote(), 'prev_vid' => $vOld->getVid(), 'prev_ver_note' => $vOld->getNote(), 'prev_props' => $vOld->getProps(), 'status_id' => $this->conf['upgrade_status']['started'], 'start_time' => CalemText::getServerDatetime()));
     return $this->dboLog->insert();
 }