當前位置: 首頁>>代碼示例>>PHP>>正文


PHP logger::error_fatal方法代碼示例

本文整理匯總了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 {
開發者ID:Tymecode,項目名稱:smstoxmpp,代碼行數:31,代碼來源:dispatcher.php

示例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!");
開發者ID:Tymecode,項目名稱:smstoxmpp,代碼行數:31,代碼來源:listener.php


注:本文中的logger::error_fatal方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。