当前位置: 首页>>代码示例>>PHP>>正文


PHP log_error函数代码示例

本文整理汇总了PHP中log_error函数的典型用法代码示例。如果您正苦于以下问题:PHP log_error函数的具体用法?PHP log_error怎么用?PHP log_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了log_error函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: checkIfUserExists

 static function checkIfUserExists($name, $id)
 {
     if (posix_getpwnam($name)) {
         $username = $name;
         $list = lfile("/etc/passwd");
         $comment = null;
         foreach ($list as $l) {
             $l = trim($l);
             if (csb($l, "{$username}:")) {
                 $useri = explode(":", $l);
                 $comment = $useri[4];
                 break;
             }
         }
         //dprint($comment . "Hello\n");
         if ($comment === uuser::getUserDescription($id)) {
             log_error("User {$name} Already Exists. But is of the same domain");
             return true;
         } else {
             log_error("User {$name} Already Exists. But is of NOT of the same domain");
             throw new lxexception("User_Exist", 'web_s_uuser_nname', $name);
         }
     }
     return false;
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:25,代码来源:uuser__linuxlib.php

示例2: openvpn_resync_gwgroup

function openvpn_resync_gwgroup($gwgroupname = "")
{
    global $config;
    if (!empty($gwgroupname)) {
        if (isset($config['openvpn']['openvpn-server'])) {
            foreach ($config['openvpn']['openvpn-server'] as &$settings) {
                if ($gwgroupname == $settings['interface']) {
                    log_error("Resyncing OpenVPN for gateway group " . $gwgroupname . " server " . $settings["description"] . ".");
                    openvpn_resync('server', $settings);
                }
            }
        }
        if (isset($config['openvpn']['openvpn-client'])) {
            foreach ($config['openvpn']['openvpn-client'] as &$settings) {
                if ($gwgroupname == $settings['interface']) {
                    log_error("Resyncing OpenVPN for gateway group " . $gwgroupname . " client " . $settings["description"] . ".");
                    openvpn_resync('client', $settings);
                }
            }
        }
        // Note: no need to resysnc Client Specific (csc) here, as changes to the OpenVPN real interface do not effect these.
    } else {
        log_error("openvpn_resync_gwgroup called with null gwgroup parameter.");
    }
}
开发者ID:paudam,项目名称:opnsense-core,代码行数:25,代码来源:system_gateway_groups.php

示例3: render

 /**
  * Render debug trace
  *
  */
 public function render($e)
 {
     Charcoal_ParamTrait::validateException(1, $e);
     $message = $this->output($e);
     log_error("debug,error,debugtrace", "debugtrace", $message);
     return TRUE;
 }
开发者ID:stk2k,项目名称:charcoalphp2,代码行数:11,代码来源:LogDebugtraceRenderer.class.php

示例4: log

 public function log($level, &$message) {
     switch ($level) {
         case LogHelper::LEVEL_DEBUG:
             log_debug($message);
             break;
         case LogHelper::LEVEL_INFO:
             log_info($message);
             break;
         case LogHelper::LEVEL_NOTICE:
             log_notice($message);
             break;
         case LogHelper::LEVEL_WARNING:
             log_warn($message);
             break;
         case LogHelper::LEVEL_ERROR:
             log_error($message);
             break;
         case LogHelper::LEVEL_CRITICAL:
             log_critical($message);
             break;
         case LogHelper::LEVEL_ALERT:
             log_alert($message);
             break;
         case LogHelper::LEVEL_EMERGENCY:
             log_emergency($message);
             break;
     }
 }
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:28,代码来源:Log4DrupalMessageListener.php

示例5: template_wraperror

function template_wraperror()
{
    global $context, $settings;
    log_error('Sorry, [action=' . $context['wraperror_action'] . '] is not supported within this theme.', 'template');
    echo '
	<img src="', $settings['images_url'], '/404.jpg" alt="" style="cursor: pointer; width: 100%;" onclick="javascript: window.history.back();" />';
}
开发者ID:Bloc67,项目名称:ShelfLife,代码行数:7,代码来源:index.template.php

示例6: request

 private function request($data = array())
 {
     $data['api_token'] = $GLOBALS['CONFIG']['translation']['sync']['poeditor_api_key'];
     $data['id'] = $GLOBALS['CONFIG']['translation']['sync']['poeditor_project_id'];
     //log_debug($data);
     $res = downloadData('http://poeditor.com/api/', $data);
     $res = json_decode($res);
     if (!$res) {
         $this->Lasterror = "Error connecting to the POEditor API";
         log_error($this->Lasterror);
         return false;
     }
     if ($res->response->code != 200) {
         $this->Lasterror = "POEditor API returned error: " . $res->response->message;
         log_error($this->Lasterror, "Details: ", $res);
         return false;
     }
     if (isset($res->details)) {
         $edited = (isset($res->details->added) ? $res->details->added : 0) + (isset($res->details->updated) ? $res->details->updated : 0);
         if ($edited == 0) {
             $this->Lasterror = "POEditor API did not add anything";
             log_error($this->Lasterror, "Details:", $res, "Request was:", $data);
             return false;
         }
     }
     return $res;
 }
开发者ID:Naveenr9,项目名称:WebFramework,代码行数:27,代码来源:translationadmin.class.php

示例7: akismet_create_topic

function akismet_create_topic($msg_options, $topic_options, $poster_options)
{
    global $modSettings, $scripturl, $smcFunc, $sourcedir;
    require $sourcedir . '/Akismet.class.php';
    // If the subject is 'akismet-test-123', then mark it as spam (this is a test)
    if ($msg_options['subject'] == 'akismet-test-123') {
        $spam = true;
    } else {
        // If the API key has been set
        if (isset($modSettings['akismetAPIKey']) && $modSettings['akismetAPIKey'] != "") {
            // Set up the Akismet class
            $akismet = new Akismet($scripturl, $modSettings['akismetAPIKey']);
            $akismet->setAuthor($poster_options['name']);
            $akismet->setAuthorEmail($poster_options['email']);
            //$akismet->setCommentAuthorURL(""); -- URL's not used in SMF.
            $akismet->setContent($msg_options['body']);
            if (!empty($topic_options['id'])) {
                $akismet->setPermalink($scripturl . '?topic=' . $topicOptions['id']);
            }
            $akismet->setType('smf-post');
            // Now, the moment of truth... Send the post to Akismet
            $akismet_return = $akismet->isSpam();
            // Was the server down?
            if ($akismet_return === 'conn_error') {
                // Assume it's not spam. We log an error to the error log later
                $spam = false;
                // Log it!
                if (empty($modSettings['akismetNoLog'])) {
                    log_error(sprintf($txt['akismet_cant_connect2'], $_POST['guestname'], $scripturl . '?topic=' . $topic . (isset($_REQUEST['msg']) ? '.msg' . $_REQUEST['msg'] : '')));
                }
            } elseif ($akismet_return === true) {
                // Oh, the horror! Someone posted spam to your forum!
                $spam = true;
            } else {
                $spam = false;
            }
        } else {
            // No API key, assume it isn't spam
            $spam = false;
        }
    }
    if ($spam) {
        // Mark the message as spam and unapprove the post. Post moderation is a big help here. :)
        $smcFunc['db_query']('', '
			UPDATE {db_prefix}topics
			SET spam = 1,
				approved = 0,
				unapproved_posts = 1
			WHERE id_topic = {int:id_topic}', array('id_topic' => $topic_options['id']));
        $smcFunc['db_query']('', '
			UPDATE {db_prefix}messages
			SET approved = 0
			WHERE id_msg = {int:id_msg}', array('id_msg' => $msg_options['id']));
        // Increase spam count
        $smcFunc['db_query']('', '
			UPDATE {db_prefix}settings
			SET value = value + 1
			WHERE variable = {string:akismetCaughtSpam}', array('akismetCaughtSpam' => 'akismetCaughtSpam'));
    }
}
开发者ID:valek0972,项目名称:hackits,代码行数:60,代码来源:Subs-Akismet.php

示例8: dbtickets_create

function dbtickets_create($len = 32)
{
    $table = 'Tickets' . intval($len);
    # As in an instance of flamework that has no access to
    # its mysql config files and/or the ability to set up
    # a dedicated DB server for tickets.
    if ($GLOBALS['cfg']['db_enable_poormans_ticketing']) {
        # ALTER TABLE tbl_name AUTO_INCREMENT = (n)
        # how the fuck do you set the offset from the SQL CLI ?
        $rsp = db_tickets_write("SET @@auto_increment_increment=2");
        if (!$rsp['ok']) {
            log_error("Failed to set auto_increment_increment for {$table}");
            return null;
        }
        $rsp = db_tickets_write("SET @@auto_increment_offset=1");
        if (!$rsp['ok']) {
            log_error("Failed to set auto_increment_offset for {$table}");
            return null;
        }
    }
    $rsp = db_tickets_write("REPLACE INTO {$table} (stub) VALUES ('a')");
    if (!$rsp['ok'] || !$rsp['insert_id']) {
        log_error("Failed to replace into {$table}");
        return null;
    }
    return $rsp['insert_id'];
}
开发者ID:netcon-source,项目名称:dotspotting,代码行数:27,代码来源:lib_dbtickets.php

示例9: error_message

function error_message($userdescription, $description = false)
{
    global $infoerror, $errormessage, $config;
    $infoerror = true;
    $errormessage = $userdescription;
    log_error($description);
    return;
}
开发者ID:burak-tekin,项目名称:CMScout2,代码行数:8,代码来源:functions.php

示例10: fatal_handler

function fatal_handler()
{
    $error = error_get_last();
    if ($error !== NULL) {
        log_error($error);
        error_response(500, "There is some technical problem. Kindly contact the administrator.");
    }
}
开发者ID:geekypedia,项目名称:aero,代码行数:8,代码来源:init.php

示例11: lx_mysql_connect

 function lx_mysql_connect($server, $dbadmin, $dbpass)
 {
     $rdb = mysql_connect('localhost', $dbadmin, $dbpass);
     if (!$rdb) {
         log_error(mysql_error());
         throw new lxException('could_not_connect_to_db_admin', '', '');
     }
     return $rdb;
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:9,代码来源:dbadmin__synclib.php

示例12: log_error_messages

 function log_error_messages($link, $throwflag = true)
 {
     if (mysqli_errno($link)) {
         dprint(mysqli_error($link));
         log_error(mysqli_error($link));
         if ($throwflag) {
             throw new lxException('mysql_error', '', mysqli_error($link));
         }
     }
 }
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:10,代码来源:mysqldb__mysqllib.php

示例13: parse

 /**
  * Parse a string, and return the result or throw a parser exception
  * @param string $str
  * @return MC_Parser_Token
  */
 public function parse($str)
 {
     $str = ltrim($str);
     list($loc, $tok) = $this->parsePart($str, 0);
     if ($loc != strlen($str)) {
         log_error("An error occurred: '" . substr($str, $loc) . "' (str={$str})(loc={$loc})", $this);
         throw new MC_Parser_ParseError('An error occurred: "' . substr($str, $loc) . '"', $str, $loc);
     }
     return $tok;
 }
开发者ID:Naveenr9,项目名称:WebFramework,代码行数:15,代码来源:Def.php

示例14: purge_log

 function purge_log($account_id)
 {
     $where = $this->test_account_id($account_id);
     $this->db->query("delete from phpgw_log {$where}", __LINE__, __FILE__);
     if (isset($this->db->Errno) && $this->db->Errno) {
         log_error(array('text' => 'Failed to delete log records from database using where clause of %1. DB errno %2: message %3', 'p1' => $where, 'p2' => $this->db->Errno, 'p3' => $this->db->Error, 'file' => __FILE__, 'line' => __LINE__));
         return false;
     }
     return true;
 }
开发者ID:HaakonME,项目名称:porticoestate,代码行数:10,代码来源:class.solog.inc.php

示例15: lx_mysql_connect

 function lx_mysql_connect($server, $dbadmin, $dbpass)
 {
     // TODO: REPLACE MYSQL_CONNECT OR REMOVE FUNCTION
     $rdb = mysqli_connect('localhost', $dbadmin, $dbpass);
     if (!$rdb) {
         log_error(mysqli_error($rdb));
         throw new lxException('could_not_connect_to_db_admin', '', '');
     }
     return $rdb;
 }
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:10,代码来源:dbadmin__synclib.php


注:本文中的log_error函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。