本文整理匯總了PHP中l::setSyslogPrefix方法的典型用法代碼示例。如果您正苦於以下問題:PHP l::setSyslogPrefix方法的具體用法?PHP l::setSyslogPrefix怎麽用?PHP l::setSyslogPrefix使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類l
的用法示例。
在下文中一共展示了l::setSyslogPrefix方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: die
// Game libraries
//
// proxycheck.php
//
// This is the main script for the proxy detector.
//
// Copyright(C) 2004-2008, DeepClone Development
//-----------------------------------------------------------------------
/* Checks for fork() */
if (!(function_exists('pcntl_fork') || $__runFromAdmin)) {
die("This script may not be called from the web server.\n");
}
/* Load the required libraries */
$__loader = array('log', 'classloader', 'version', 'game', 'tick', 'config', 'db_connection', 'db_accessor', 'db_copy', 'pcheck_thread', 'pcheck_manager', 'pcheck');
require_once "loader.inc";
l::setSyslogPrefix("lwProxy");
if (count($argv) > 1) {
/* Checks for command line arguments */
if (count($argv) > 2 && ($argv[1] == '-c' || $argv[1] == '-f')) {
$addresses = $argv;
array_shift($addresses);
array_shift($addresses);
print "Running manual check, please wait ...\n";
try {
$results = pcheck::check($addresses, $argv[1] == '-f');
} catch (Exception $e) {
print "{$argv[0]}: " . $e->getMessage() . "\n";
exit(1);
}
foreach ($results as $address => $proxy) {
print "\t{$address} - ";
示例2: Exception
$game = config::getGame($gName);
if (is_null($game)) {
throw new Exception("Game '{$gName}' not found");
}
l::notice("administration script executing tick {$gName}::{$tName}");
$game->getDBAccess();
$game->runTick($tName, true);
l::notice("tick {$gName}::{$tName} executed");
dbClose();
} catch (Exception $e) {
$argh = $e->getMessage();
}
chdir($oldDir);
return;
} else {
l::setSyslogPrefix("lwTicks");
if (count($argv) > 1) {
/* Checks for command line arguments */
if ($argv[1] == "-r" && count($argv) == 4) {
$game = $argv[2];
$tick = $argv[3];
dbConnect();
$game = config::getGame($argv[2]);
if (is_null($game)) {
die("Error: game {$argv[2]} not found");
}
l::notice("manually executing {$argv[2]}::{$argv[3]}");
$game->getDBAccess();
$game->runTick($argv[3], true);
l::notice("{$argv[2]}::{$argv[3]} executed");
dbClose();