本文整理汇总了PHP中logger::error_fatal方法的典型用法代码示例。如果您正苦于以下问题:PHP logger::error_fatal方法的具体用法?PHP logger::error_fatal怎么用?PHP logger::error_fatal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类logger
的用法示例。
在下文中一共展示了logger::error_fatal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getmypid
$pid_contacts = pcntl_fork();
if (!$pid_contacts) {
/*
We are the fork!
* Validate configuration provided
* Establish a connection to the CardDAV backend
* Listen on the message queue for incomming contact lookup requests
* Pull contact name from CardDAV
* Save into cache (just an array) for next time.
*/
$pid_child = getmypid();
$log->info("[contacts] Launched CardDAV contacts/address book lookup worker fork");
$log->debug("[child {$pid_child}] is contacts worker ");
// verify installed modules
if (!class_exists('XMLWriter')) {
$log->error_fatal("PHP XMLWriter module must be installed to enable CardDAV functionality");
}
// verify configuration
if (!$config["SMStoXMPP"]["contacts_url"]) {
$log->error_fatal("[contacts] No contacts_url provided to query for CardDAV contacts.");
}
if (!$config["SMStoXMPP"]["contacts_store"]) {
$log->error_fatal("[contacts] No contacts_store provided to store downloaded contacts to avoid large re-syncs");
} else {
if (!file_exists($config["SMStoXMPP"]["contacts_store"])) {
// attempt to create the directory, we may just be missing the top level dir and have rights to create
if (mkdir($config["SMStoXMPP"]["contacts_store"])) {
@chmod($config["SMStoXMPP"]["contacts_store"], 0770);
@chown($config["SMStoXMPP"]["contacts_store"], $config["SMStoXMPP"]["app_user"]);
@chgrp($config["SMStoXMPP"]["contacts_store"], $config["SMStoXMPP"]["app_group"]);
} else {
示例2: header
$log->debug("[listener] Debug URL: {$_SERVER['REQUEST_URI']}");
/*
Determine Device
SMStoXMPP supports a number of different devices and types, we need to discover
which one is providing information to this page and then fetch and process the
information accordingly.
*/
$device = null;
if (isset($_GET["device"])) {
$device = $_GET["device"];
}
// other ID fields for other gateways?
if (!$device) {
header('HTTP/1.1 500 Internal Server Error');
$log->error_fatal("[listener] No destination device was specified - make sure you're setting the ?device=myphone option.");
}
/*
Launch gateway/device logic
All the gateway/device logic is broken into include files that are only loaded into
the particular worker fork which is using that gateway. If we can't load it for some
reason we should fail with an error to all the apps.
*/
if (!$config[$device]) {
header('HTTP/1.1 500 Internal Server Error');
$log->error_fatal("[listener] An invalid destination device was requested - make sure you are using the correct ?device=example tag");
}
if (!$config[$device]["gw_type"]) {
header('HTTP/1.1 500 Internal Server Error');
$log->error_fatal("[listener] There is no gateway set! Unable to proceed!");