本文整理汇总了PHP中log::exception方法的典型用法代码示例。如果您正苦于以下问题:PHP log::exception方法的具体用法?PHP log::exception怎么用?PHP log::exception使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类log
的用法示例。
在下文中一共展示了log::exception方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: query
function query($sql, $is_read = true)
{
$result = mysql_query($sql, self::$conn[$this->i]);
config('log|mysql_sql', 'log') && log::sql($sql, $is_read);
if ($result) {
return $result;
}
$info = $sql . ' {' . mysql_error() . '}';
config('exception|sql_error', 'log') && log::exception('mysql', $info);
config('param|debug', 'db') && exit($info);
}
示例2: render
/**
* Renders template using provided data.
*
* This method is managing exceptions thrown inside to bubble up to current
* level of output buffering at least.
*
* @param string $template template name to render
* @param variable_space|array $data data to use on rendering template
* @return string rendered template
*/
public static function render($template = null, $data = null)
{
$oblevel = ob_get_level();
try {
if ($data === null || is_array($data)) {
$data = variable_space::fromArray((array) $data);
}
// @todo consider selecting engine depending on current configuration instead of using current view's one
return static::engine()->render($template, $data);
} catch (\Exception $e) {
while ($oblevel < ob_get_level()) {
ob_end_clean();
}
static::error(log::exception('[%s:%s in %s@%d]', get_class($e), $e->getMessage(), $e->getFile(), $e->getLine()));
return '';
}
}
示例3: act_smtp
private function act_smtp()
{
$response = str_replace("\r\n", "", fgets($this->sock, 512));
if (!preg_match("/^[23]/", $response)) {
fwrite($this->sock, "QUIT\r\n");
fgets($this->sock, 512);
log::exception('mail', 'remote host returned-' . $response);
return false;
}
return true;
}
示例4: execute
public function execute($_options = null)
{
$nabaztag = $this->getEqLogic();
$parameters = $this->getConfiguration('parameters');
$type = $this->getConfiguration('request');
switch ($this->subType) {
case 'message':
$parameters = urlencode(str_replace('#message#', $_options['message'], $parameters));
break;
case 'slider':
$parameters = str_replace('#slider#', $_options['slider'], $parameters);
break;
}
if ($type == 'urlList') {
$parameters = urlencode($parameters);
$request = 'http://' . $nabaztag->getConfiguration('addr') . '/ojn/FR/api_stream.jsp?sn=' . $nabaztag->getConfiguration('mac') . '&token=' . $nabaztag->getConfiguration('token') . '&' . $type . '=' . $parameters;
} else {
$request = 'http://' . $nabaztag->getConfiguration('addr') . '/ojn/FR/api.jsp?sn=' . $nabaztag->getConfiguration('mac') . '&token=' . $nabaztag->getConfiguration('token') . '&' . $type . '=' . $parameters;
}
log::add('nabaztag', 'debug', $request);
try {
$request = new com_http($request);
$result = $request->exec(0.1, 1);
log::add('nabaztag', 'debug', print_r($result, true));
$xml = new SimpleXMLElement($result);
$json = json_decode(json_encode($xml), TRUE);
} catch (Exception $e) {
log::add('nabaztag', 'debug', log::exception($e));
}
if (isset($json) && is_array($json) && isset($json['message']) && ($json['message'] == 'PREMIUM_ONLY' || $json['message'] == 'PLUGINNOTAVAILABLE')) {
throw new Exception($json['message'] . ' : ' . $json['comment']);
}
}