本文整理汇总了PHP中LoggerManager::fatal方法的典型用法代码示例。如果您正苦于以下问题:PHP LoggerManager::fatal方法的具体用法?PHP LoggerManager::fatal怎么用?PHP LoggerManager::fatal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LoggerManager
的用法示例。
在下文中一共展示了LoggerManager::fatal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reportException
protected function reportException($message, $e)
{
$this->logger->fatal("{$message}: " . get_class($e));
if ($this->logger->wouldLog('error')) {
$this->logger->error($e->getMessage());
}
}
示例2: parseSQL
/**
* Parse SQL with types from sql in the form of "INSERT INTO testPreparedStatement(id, name) VALUES(?int, ?varchar)"
* @param string $sql
* @param array $lobs names of clob and blob fields from query
* @return boolean
*/
protected function parseSQL($sql, array $lobs = array())
{
if (empty($this->DBM)) {
$this->log->error("Prepare failed: Database object missing");
return false;
}
if (empty($sql)) {
$this->log->error("Prepare failed: empty SQL statement");
return false;
}
$this->sqlText = $sql;
$this->log->info("Parse Query: {$sql}");
// Build fieldDefs array and replace ?SugarDataType placeholders with a single ?placeholder
$cleanedSql = "";
$nextParam = strpos($sql, "?");
if ($nextParam == 0) {
$cleanedSql = $sql;
} else {
// parse the sql string looking for params
$row = 0;
while ($nextParam > 0) {
$cleanedSql .= substr($sql, 0, $nextParam + 1);
// we want the ?
$sql = substr($sql, $nextParam + 1);
// strip leading chars
// scan for termination of SugarDataType
$sugarDataType = "";
for ($i = 0; $i < strlen($sql) and strpos(",) ", substr($sql, $i, 1)) === false; $i++) {
if (strpos(",) ", substr($sql, $i, 1)) == false) {
$sugarDataType .= substr($sql, $i, 1);
}
}
if ($sugarDataType === "") {
// no type, default to varchar
$sugarDataType = 'varchar';
}
// insert the fieldDef
$this->fieldDefs[$row]['type'] = $sugarDataType;
if ($this->DBM->isTextType($sugarDataType)) {
if (empty($lobs)) {
$this->log->fatal('Name of lob field is not specified: ' . $this->sqlText);
return false;
}
$this->lobFields[$row] = array_shift($lobs);
}
$sql = substr($sql, $i);
// strip off the SugarDataType
$nextParam = strpos($sql, "?");
// look for another param
$row++;
}
// add the remaining sql
$cleanedSql .= $sql;
}
$this->parsedSQL = $cleanedSql;
return true;
}