static function SendQueue($sType, $aParams) { global $oDb; $time = time(); switch ($sType) { case 'subscribe': $res = $oDb->execute('INSERT INTO ' . TABLE_ENOTIFY_SUBSCRIBE . ' (user_id, created) VALUES(' . $aParams['user_id'] . ', ' . $time . ') '); if (empty($res)) { func::log('Ошибка sql-запроса CMail::SendQueue(' . $sType . ', uid=' . $aParams['user_id'] . '); '); return false; } return true; break; } return false; }
protected function log($sMessage) { func::log($sMessage, 'bill.log'); }
function error($sText, $nBacktraceLevel = 1) { $msg = $this->_pdo->errorInfo(); $msg = "[{$sText}] ( " . (@$msg[0] . '.' . @$msg[1]) . ' : ' . (isset($msg[2]) ? $msg[2] : '') . ' )'; $aBacktrace = debug_backtrace(); if (isset($aBacktrace[$nBacktraceLevel])) { $msg .= "<br /> {$aBacktrace[$nBacktraceLevel]['file']} [{$aBacktrace[$nBacktraceLevel]['line']}]"; } trigger_error($msg, E_USER_ERROR); func::log($msg); }
/** * Получение натроек услуги * @param integer $nSvcID ID услуги * @return array */ function getServiceSettings($nSvcID) { static $cache; if (isset($cache[$nSvcID])) { return $cache[$nSvcID]; } $aResult = false; do { $aService = $this->db->one_array('SELECT id, type, keyword, settings, description FROM ' . TABLE_SERVICES . ' WHERE id = ' . $nSvcID); if (empty($aService)) { func::log('Ошибка получения информации об услуге #' . $nSvcID); $aResult = false; break; } $aSettings = !empty($aService['settings']) && is_string($aService['settings']) ? unserialize($aService['settings']) : array(); unset($aService['settings']); $aResult = array_merge($aService, $aSettings); if (isset($aResult['price'])) { $aResult['price'] = floatval($aResult['price']); } } while (false); return $cache[$nSvcID] = $aResult; }
/** * Trigger a PEAR error * * To improve performances, the PEAR.php file is included dynamically. * The file is so included only when an error is triggered. So, in most * cases, the file isn't included and perfs are much better. * * @param string $msg error message * @param int $code error code * @access public */ function raiseError($msg, $code) { func::log($code . ': ' . $msg); }