public function getCurrentVersion($useFirst = true) { $rtn = $useFirst ? $rtn = $this->firstVersion : null; try { $this->initDbo(); $dh = CalemFactory::getDbHandler(); if (!$dh->tableExists($this->dbo, 'version')) { return $rtn; } $row = $this->dbo->fetchById(VERSION_ID); if ($this->logger->isInfoEnabled()) { $this->logger->info('Version row=' . var_export($row, true)); } $rtn = CalemVersion::decode($row); } catch (CalemDboDataNotFoundException $dn) { require_once _CALEM_DIR_ . 'server/include/util/CalemDebug.php'; $this->logger->warn('Data not found: ' . CalemDebug::toStackTrace($dn)); } return $rtn; }
/** * Handling the Soap BulkFetch Request * There are multiple queries in the request. * There's only one parameter that's an object and it includes all the queries. * Each entry of the param object is a query object with fields: table, type, sql and countSql. * */ public function BulkFetch() { $param = $this->getParamValue(0); if ($this->logger->isDebugEnabled()) { $this->logger->debug("Invoking the BulkFetch, param=" . var_export($param, true)); } //Processing the tables global $_CALEM_conf; $result = array(); foreach ($param as $key => $query) { $serverTime = gmdate($_CALEM_conf['calem_server_time_format']); try { $resp = call_user_func(array($this, 'handle_' . $query->type), $query, $serverTime); $resp['ftId'] = $key; //This is the full table id to map back. $result[] = $resp; } catch (Exception $e) { require_once _CALEM_DIR_ . 'server/include/util/CalemDebug.php'; $this->logger->error("Exception in BulkFetch. Error msg=" . CalemDebug::toStackTrace($e)); } } return $result; }
if (!$lang) { $lang = $_CALEM_conf['client_language']; } if ($action == 'LoginAction') { setCookie('CALEM_LANG', $_REQUEST[CALEM_PARAM_LANG], time() + $_CALEM_conf['setting_cookie_expire']); $login_username = $_REQUEST['username']; $login_password = $_REQUEST['password']; require_once _CALEM_DIR_ . 'server/modules/admin/soap/CalemLoginSo.php'; $ex = ''; try { $loginSo = new CalemLoginSo(); $loginSo->initByWeb(); list($succ, $ses) = $loginSo->doLogin($login_username, $login_password); } catch (Exception $e) { require_once _CALEM_DIR_ . 'server/include/util/CalemDebug.php'; $logger->error("Exception in processing login. Error msg=" . CalemDebug::toStackTrace($e)); } $loginErrorText = CalemMsg::getMsg('SF_InvalidLogin'); } else { $loginErrorText = CalemMsg::getMsg("login_reqd"); } if (!$succ) { require _CALEM_DIR_ . $_CALEM_conf['noses_allowed_actions']['LoginAction']; //Close down logger CalemExit::exitCalem(); } //Set the sid $sid = $ses->getSid(); } $hasCookie = false; if (!$sid) {
/** * Rollback a transaction * The transaction chain is managed here so that rollback will clear the * transaction chain here. */ public function rollback() { //Adding the method in. if ($this->logger->isDebugEnabled()) { $debug = debug_backtrace(); $caller = CalemDebug::getCaller($debug); } else { $caller = '0'; } //rollback will be performed anyway if ($this->logger->isDebugEnabled()) { $callers = implode(',', $this->stack); $this->logger->debug("Rollback called by " . $caller . ", transaction stack=" . $callers); } //Reset the transaction stack $this->stack = array(); //Rollback parent::rollback(); }