private function Send($to, $arr, $templeteId) { global $CONFIG; if ($CONFIG['solution_configuration'] == "debug") { return true; } //return true; $this->resetSDK(); $result = $this->rest->sendTemplateSMS($to, $arr, $templeteId); if ($result->statusCode != 0) { $str = "error code :" . $result->statusCode . " "; $str .= "error msg :" . $result->statusMsg . " "; $res = outResult($result->statusCode, $result->statusMsg); outputXml($res); logger_mgr::logError("sms :{$str}"); //echo $str; //TODO 添加错误处理逻辑 return false; } else { $str = "Sendind TemplateSMS success! "; // 获取返回信息 $smsmessage = $result->TemplateSMS; $str .= "dateCreated:" . $smsmessage->dateCreated . " "; $str .= "smsMessageSid:" . $smsmessage->smsMessageSid . ""; //TODO 添加成功处理逻辑 logger_mgr::logInfo("sms :{$str}"); //echo $str; return true; } return false; }
<?php require '../include/common.inc.php'; include ROOT . '/classes/datamgr/banner.cls.php'; $last_time = $_REQUEST["last_time"]; $result = $bannerMgr->getBannerListByCondition("index_banner_%", $last_time); outputXml($result);
/** * Scan dump directory for dump files (if any) and * create dcatap.rdf in the same directory * * @param array $options command line options to override defaults */ function run(array $options) { // Load config variables and i18n a data blob if (!isset($options['config'])) { $options['config'] = 'config.json'; } if (!is_file($options['config'])) { throw new Exception($options['config'] . " does not seem to exist"); } $data = makeDataBlob($options['config']); // Load directories from config/options and test for existence if (!isset($options['dumpDir'])) { $options['dumpDir'] = $data['config']['directory']; } if (!is_dir($options['dumpDir']) or !is_readable($options['dumpDir'])) { throw new Exception($options['dumpDir'] . " is not a valid readable directory"); } if (!isset($options['outputDir'])) { $options['outputDir'] = $data['config']['directory']; } if (!is_dir($options['outputDir']) or !is_writable($options['outputDir'])) { throw new Exception($options['outputDir'] . " is not a valid writable directory"); } // add dump data to data blob $data['dumps'] = scanDump($options['dumpDir'], $data); // create xml string from data blob $xml = outputXml($data); file_put_contents($options['outputDir'] . "/dcatap.rdf", $xml); }
/** * execute sql statement * @param string $sql: sql statement * @param string $type: default '', option: CACHE | UNBUFFERED * @param int $expires: Cache lifetime, second for unit * @param string $dbname: db name * @return resource */ function query($sql) { global $CONFIG; if (!($query = @sqlsrv_query($this->conn, $sql))) { logger_mgr::logError("sql error :{$sql}"); if ($this->in_trans) { $this->rollback_trans(); } if ($CONFIG['solution_configuration'] == "debug") { $res = outResult(-1435, "Sql Error:" . $sql); outputXml($res); } else { $res = outResult(-1435, "Sql Error"); outputXml($res); } $this->halt($msg, $sql); } logger_mgr::logDebug("sql :{$sql}"); $this->querynum++; return $query; }
public function DetailApi($dbMgr, $id, $lang) { if ($this->XmlData["ismutillang"] == "1") { $sql = "select * from " . $this->XmlData["tablename"] . " m\n\t\tinner join " . $this->XmlData["tablename"] . "_lang ml on m.id=ml.oid and code='{$lang}' where id={$id}"; $query = $dbMgr->query($sql); $result = $dbMgr->fetch_array_all($query); } else { $sql = "select * from " . $this->XmlData["tablename"] . " where id={$id}"; $query = $dbMgr->query($sql); $result = $dbMgr->fetch_array_all($query); } outputXml($result); }