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


PHP logmsg函数代码示例

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


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

示例1: parseItem

function parseItem($blog, $item, $ts)
{
    if ($ts != 0 && $item->pubdate <= $ts) {
        logmsg('Zatrzymanie na wpisie: %s', StringUtils::removeAccents($item->title));
        return false;
    }
    logmsg('  - Parsowanie wpisu: %s', StringUtils::removeAccents($item->title));
    $post = new Post();
    $post->setBlog($blog);
    foreach ($item->tags as $name) {
        $tag = TagPeer::retriveByName($name, true);
        if ($post->addTag($tag)) {
            logmsg('    - Znaleziono tag: %s', $name);
        }
    }
    if ($post->hasTags()) {
        $shortened = $post->setFullContent($item->content);
        $post->setLink(htmlspecialchars($item->link));
        $post->setTitle($item->title);
        $post->setCreatedAt($item->pubdate);
        $post->setShortened($shortened);
        $post->save();
    } else {
        logmsg('    - Nie znaleziono tagow');
    }
    return true;
}
开发者ID:noose,项目名称:Planeta,代码行数:27,代码来源:refresh.php

示例2: err

/** helper to output an error message. */
function err($string)
{
    // Annoying PHP: we need to import global variables here...
    global $title;
    require LIBWWWDIR . '/header.php';
    echo "<h2>Submit - error</h2>\n\n";
    echo '<div id="uploadstatus">';
    logmsg(LOG_WARNING, $string);
    echo '</div>';
    require LIBWWWDIR . '/footer.php';
    exit;
}
开发者ID:Surya97,项目名称:domjudge,代码行数:13,代码来源:upload.php

示例3: delete_file_and_edit_agreement

function delete_file_and_edit_agreement($var)
{
    $f = explode('_', $var);
    $fileid = $_POST['fileid_' . $f[1] . '_' . $f[2]];
    logmsg("deletefile {$var}; {$fileid}");
    save_agreement();
    $details = db_retrieve_file_details($fileid);
    $id = $_POST['0'];
    show_delete_file_form($fileid, $details[3], $details[4], array('ID' => $id));
    $aggr = db_retrieve_agreement_byID($id);
    addedit_agreement($aggr);
}
开发者ID:TIS-FMDP,项目名称:Erasmus,代码行数:12,代码来源:agreements.php

示例4: minecraft_sigterm

function minecraft_sigterm($signal)
{
    echo "terming\n";
    global $_STATE;
    logmsg("SIGTERM - stop");
    $_STATE['Running'] = false;
    fwrite($_STATE['Descriptors'][0], 'stop' . PHP_EOL);
    fflush($_STATE['Descriptors'][0]);
    if (isset($_CONFIG['Command_Pidfile']) && file_exists($_CONFIG['Command_Pidfile'])) {
        unlink($_CONFIG['Command_Pidfile']);
    }
}
开发者ID:haxney,项目名称:minecraft-config,代码行数:12,代码来源:daemonize_minecraft.php

示例5: dj_setcookie

/**
 * Wrapper around PHP setcookie function to automatically set some
 * DOMjudge specific defaults and check the return value.
 * - cookies are defined in a common path for all web interfaces
 */
function dj_setcookie($name, $value = null, $expire = 0, $path = null, $domain = null, $secure = false, $httponly = false)
{
    if (!isset($path)) {
        // KLUDGE: We want to find the DOMjudge base path, but this
        // information is not directly available as configuration, so
        // we extract it from the executed PHP script.
        $path = preg_replace('/(jury|public|team)\\/?$/', '', dirname($_SERVER['PHP_SELF']));
    }
    $ret = setcookie($name, $value, $expire, $path, $domain, $secure, $httponly);
    if ($ret !== true) {
        warning("Cookie '{$name}' not set properly.");
    }
    logmsg(LOG_DEBUG, "Cookie set: {$name}={$value}, expire={$expire}, path={$path}");
    return $ret;
}
开发者ID:rohit-takhar,项目名称:domjudge,代码行数:20,代码来源:lib.wrappers.php

示例6: retrieve_filter_exchange

function retrieve_filter_exchange()
{
    global $filter_url;
    logmsg("trsel: " . $_POST['travel_selection']);
    if (isset($_POST['travel_selection'])) {
        $filter_t = $_POST['travel_selection'];
    } else {
        $filter_t = $_GET['ft'];
    }
    if (strlen($filter_t) == 0) {
        $filter_t = $_POST['ft'];
    }
    if (strlen($filter_t) == 0) {
        $filter_t = db_get_first_travel();
    }
    $filter_url = '&ft=' . $filter_t;
    logmsg("ft: " . $filter_t);
    return $filter_t;
}
开发者ID:TIS-FMDP,项目名称:Erasmus,代码行数:19,代码来源:foreigncredits.php

示例7: process_fmfi_credits

function process_fmfi_credits()
{
    global $userrole;
    if ($userrole === "admin") {
        print '<b>Travel FMFI courses</b><br /><br />';
        $filter_exchange = retrieve_filter_exchange();
        show_exchange_filter($filter_exchange);
        $tcdata = NULL;
        if (isset($_GET['act'])) {
            if ($_POST['Edit'] === 'edit') {
                $tcdata = db_fmfi_courses_for_an_exchange($filter_exchange, TRUE);
                edit_fmfi_travel_course($tcdata);
            } else {
                if ($_POST['Add'] === 'add') {
                    add_fmfi_travel_course($filter_exchange);
                } else {
                    if ($_POST['Save'] === 'save') {
                        save_fmfi_travel_course($filter_exchange);
                    } else {
                        if ($_POST['Remove'] === 'remove') {
                            $tcdata = db_fmfi_courses_for_an_exchange($filter_exchange, TRUE);
                            remove_record($tcdata);
                        } else {
                            if ($_POST['Remove'] === 'yes') {
                                yes_remove_fmfi_travel_courses();
                            }
                        }
                    }
                }
            }
        }
        logmsg("retr");
        if ($tcdata == NULL) {
            $tcdata = db_fmfi_courses_for_an_exchange($filter_exchange, TRUE);
        }
        logmsg("ieve {$filter_exchange}");
        $tcf = format_travel_fmfi_courses($tcdata);
        show_table(array('ID', 'FMFI course', 'Grade'), $tcf);
    } else {
        return;
    }
}
开发者ID:TIS-FMDP,项目名称:Erasmus,代码行数:42,代码来源:fmficredits.php

示例8: logmsg

logmsg("Loading signals file: \"" . $_CONFIG['Signals'] . "\"");
logmsg("Working Directory: \"" . $_CONFIG['WorkingDirectory'] . "\"");
logmsg("");
for (;;) {
    // Start the command
    logmsg("Starting command");
    commandStart();
    // Block until it quits
    logmsg("Monitoring");
    commandMonitor();
    // Clean up descriptors and stuff
    logmsg("Died - Cleaning up");
    commandCleanup();
    // If we're shutting down, break out of the loop.
    if ($_STATE['Running'] == false) {
        logmsg("Saying goodnight - remember to tip your waitress!");
        break;
    }
}
if (isset($_CONFIG['Monitor_Pidfile'])) {
    unlink($_CONFIG['Monitor_Pidfile']);
}
/* Functions */
function logmsg($str)
{
    global $_CONFIG, $_STATE;
    $str = '[' . date('Y-m-d H:i:s') . '] ' . $str;
    if ($_CONFIG['Interactive'] == true) {
        echo $str . PHP_EOL;
    }
    if (!isset($_STATE['LogHandle'])) {
开发者ID:haxney,项目名称:minecraft-config,代码行数:31,代码来源:daemonize.php

示例9: explode

                     $arr = explode(':', $v);
                     $calendar_name = trim($arr[1]);
                     break;
                 }
             }
             $calendar_name = isset($calendar_name) ? $calendar_name : 'default';
             if (isset($_SERVER['PATH_INFO'])) {
                 preg_match("/\\/([ A-Za-z0-9.]*).ics/i", $_SERVER['PATH_INFO'], $matches);
                 $calendar_name = $matches[1];
             }
             // write to file
             if ($fp = fopen($calendar_path . $calendar_name . '.ics', 'w+')) {
                 fputs($fp, $data, strlen($data));
                 @fclose($fp);
             } else {
                 logmsg('couldnt open file ' . $calendar_path . $calendar_name . '.ics');
             }
         }
     }
     if ($_SERVER['REQUEST_METHOD'] == 'GET') {
         if (isset($_SERVER['PATH_INFO'])) {
             preg_match("/\\/([ A-Za-z0-9._]*).ics/i", $_SERVER['PATH_INFO'], $matches);
             $icsfile = $matches[1];
             // get calendar data
             if (file_exists($calendar_path . $icsfile . '.ics') && is_readable($calendar_path . $icsfile . '.ics') && is_file($calendar_path . $icsfile . '.ics')) {
                 echo file_get_contents($calendar_path . $icsfile . '.ics');
             } else {
             }
         }
     }
 }
开发者ID:jbogota,项目名称:blog-king,代码行数:31,代码来源:publish.mozilla.php

示例10: retrieve_first_checked_record

function retrieve_first_checked_record($data)
{
    foreach ($data as $r) {
        if (isset($_POST[$r[0]])) {
            return $r;
        }
    }
    logmsg("no item checked");
    return NULL;
}
开发者ID:TIS-FMDP,项目名称:Erasmus,代码行数:10,代码来源:submissions.php

示例11: logmsg

                @fclose($dataout);
            } else {
                logmsg('could not open file ' . $calendar_path . $calendar_name . '.ics');
            }
        } else {
            logmsg('PUT ERROR - No data supplied.');
        }
        break;
    case 'GET':
        if (isset($_SERVER['PATH_INFO'])) {
            preg_match("/\\/([ A-Za-z0-9._]*).ics/i", $_SERVER['PATH_INFO'], $matches);
            $icsfile = urldecode($matches[1]);
            // get calendar data
            if (file_exists($calendar_path . $icsfile . '.ics') && is_readable($calendar_path . $icsfile . '.ics') && is_file($calendar_path . $icsfile . '.ics')) {
                echo file_get_contents($calendar_path . $icsfile . '.ics');
                logmsg('downloaded calendar ' . $icsfile);
            }
        }
}
if (defined('PHPICALENDAR_LOG_PUBLISHING') && PHPICALENDAR_LOG_PUBLISHING == 1) {
    fclose($logfile);
}
header('HTTP/1.1 200 OK');
exit;
// for logging
function logmsg($str)
{
    global $logfile;
    if (defined('PHPICALENDAR_LOG_PUBLISHING') && PHPICALENDAR_LOG_PUBLISHING == 1) {
        if ($_SERVER['PHP_AUTH_USER']) {
            $user = $_SERVER['PHP_AUTH_USER'];
开发者ID:bilsan,项目名称:schedule-generator,代码行数:31,代码来源:publish.php

示例12: warning

/**
 * Log a warning at level LOG_WARNING.
 */
function warning($string)
{
    logmsg(LOG_WARNING, "warning: {$string}");
}
开发者ID:nya3jp,项目名称:domjudge,代码行数:7,代码来源:lib.error.php

示例13: err_log

/**
 * Zapise do logu, ktery je definovan v globalnim nastaveni.
 * @deprecated pouzijte radeji metodu logmsg($message, $level)
 * @param string $message Zprava, ktera se ma vypsat do logu
 * @param int $level level logu - PEAR_LOG_EMERG, PEAR_LOG_ALERT, PEAR_LOG_CRIT, PEAR_LOG_ERR,
 * PEAR_LOG_WARNING, PEAR_LOG_NOTICE, PEAR_LOG_INFO, PEAR_LOG_DEBUG
 * PEAR_LOG_DEBUG je defaultni
 */
function err_log($message, $level = PEAR_LOG_DEBUG)
{
    logmsg($message, $level);
}
开发者ID:klofac,项目名称:combros,代码行数:12,代码来源:functions.php

示例14: save_student

function save_student()
{
    $id = $_POST['0'];
    $firstname = htmlspecialchars($_POST['1']);
    $middlename = htmlspecialchars($_POST['2']);
    $lastname = htmlspecialchars($_POST['3']);
    $born = htmlspecialchars($_POST['4']);
    $studentID = htmlspecialchars($_POST['5']);
    $gender = $_POST['6'];
    $citizenship = $_POST['7'];
    $email = htmlspecialchars($_POST['8']);
    $year = htmlspecialchars($_POST['10']);
    logmsg("year: {$year}");
    db_save_student($id, $firstname, $middlename, $lastname, $born, $studentID, $gender, $citizenship, $email, $year);
}
开发者ID:TIS-FMDP,项目名称:Erasmus,代码行数:15,代码来源:students.php

示例15: execute

 private function execute($query)
 {
     $query = trim($query);
     list($micros, $secs) = explode(' ', microtime());
     $res = @mysqli_query($this->_connection, $query);
     list($micros2, $secs2) = explode(' ', microtime());
     $elapsed_ms = round(1000 * ($secs2 - $secs + ($micros2 - $micros)));
     if (DEBUG & DEBUG_SQL) {
         global $DEBUG_NUM_QUERIES;
         $DEBUG_NUM_QUERIES++;
         if (isset($_SERVER['REMOTE_ADDR'])) {
             if (defined('DOMJUDGE_API_VERSION')) {
                 logmsg(LOG_DEBUG, "SQL: {$this->database}: {$query} ({$elapsed_ms}ms)\n");
             } else {
                 printf("<p>SQL: {$this->database}: <kbd>%s</kbd> ({$elapsed_ms}ms)</p>\n", specialchars($query));
             }
         } else {
             printf("SQL: {$this->database}: %s ({$elapsed_ms}ms)\n", $query);
         }
     }
     if ($res) {
         return $res;
     }
     if (DEBUG) {
         $backtrace = debug_backtrace();
         $callsite = ' file: ' . $backtrace[2]['file'] . ', ' . ' line: ' . $backtrace[2]['line'] . ', ';
     } else {
         $callsite = '';
     }
     // switch error message depending on errornr.
     switch (mysqli_errno($this->_connection)) {
         case 1062:
             // duplicate key
             throw new UnexpectedValueException("Item with this key already" . " exists.\n" . $callsite . mysqli_error($this->_connection));
         case 1217:
             // foreign key constraint
             throw new UnexpectedValueException("This operation would have" . " brought the database in an inconsistent state,\n" . $callsite . mysqli_error($this->_connection));
         case 2006:
             // MySQL server has gone away
             throw new RuntimeException("MySQL server has gone away");
         default:
             throw new RuntimeException("SQL error, " . $callsite . "Error#" . mysqli_errno($this->_connection) . ": " . mysqli_error($this->_connection) . ", query: '{$query}'");
     }
 }
开发者ID:bertptrs,项目名称:domjudge,代码行数:44,代码来源:lib.database.php


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