本文整理汇总了PHP中print_log函数的典型用法代码示例。如果您正苦于以下问题:PHP print_log函数的具体用法?PHP print_log怎么用?PHP print_log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_log函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: halt
function halt($message = '', $sql = '')
{
$error = self::error();
$errno = self::errno();
$errmsg = "MySQL: [{$errno}] {$message} | SQL: \"{$sql}\" | Error: {$error}";
print_log($errmsg);
}
示例2: PDO_Inst
function PDO_Inst()
{
require SYSTEM_ROOT . '/config.mysql.php';
try {
return new PDO("mysql:host={$dbhost};dbname={$dbname}", $dbuser, $dbpass, array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''));
} catch (PDOException $Exception) {
print_log($Exception->getMessage());
}
}
示例3: admin_externalpage_setup
admin_externalpage_setup('reportlog');
echo $OUTPUT->header();
} else {
$PAGE->set_title($course->shortname .': '. $strlogs);
$PAGE->set_heading($course->fullname);
$PAGE->navbar->add("$userinfo, $dateinfo");
echo $OUTPUT->header();
}
echo $OUTPUT->heading(format_string($course->fullname) . ": $userinfo, $dateinfo (".usertimezone().")");
report_log_print_mnet_selector_form($hostid, $course, $user, $date, $modname, $modid, $modaction, $group, $showcourses, $showusers, $logformat);
if ($hostid == $CFG->mnet_localhost_id) {
print_log($course, $user, $date, 'l.time DESC', $page, $perpage,
"index.php?id=$course->id&chooselog=1&user=$user&date=$date&modid=$modid&modaction=$modaction&group=$group",
$modname, $modid, $modaction, $group);
} else {
print_mnet_log($hostid, $id, $user, $date, 'l.time DESC', $page, $perpage, "", $modname, $modid, $modaction, $group);
}
break;
case 'downloadascsv':
if (!print_log_csv($course, $user, $date, 'l.time DESC', $modname,
$modid, $modaction, $group)) {
echo $OUTPUT->notification("No logs found!");
echo $OUTPUT->footer();
}
exit;
case 'downloadasods':
if (!print_log_ods($course, $user, $date, 'l.time DESC', $modname,
$modid, $modaction, $group)) {
示例4: required_param
require_once "../../../config.php";
require_once "../../lib.php";
$id = required_param('id', PARAM_INT);
$page = optional_param('page', 0, PARAM_INT);
// which page to show
if (!($course = $DB->get_record("course", array("id" => $id)))) {
print_error('invalidcourseid');
}
require_login($course);
$context = get_context_instance(CONTEXT_COURSE, $course->id);
require_capability('coursereport/log:viewlive', $context);
add_to_log($course->id, "course", "report live", "report/log/live.php?id={$course->id}", $course->id);
session_get_instance()->write_close();
// we override the default framename so header/footer
// links open in a new window
if (empty($CFG->framename) || $CFG->framename === '_top') {
$CFG->framename = '_blank';
}
$strlivelogs = get_string("livelogs");
$strupdatesevery = get_string("updatesevery", "moodle", COURSE_LIVELOG_REFRESH);
$PAGE->set_url('/course/report/log/live.php', array('id' => $course->id));
$PAGE->set_pagelayout('popup');
$PAGE->set_title("{$strlivelogs} ({$strupdatesevery})");
$PAGE->set_periodic_refresh_delay(COURSE_LIVELOG_REFRESH);
$PAGE->set_heading($strlivelogs);
echo $OUTPUT->header();
$user = 0;
$date = time() - 3600;
print_log($course, $user, $date, "l.time DESC", $page, 500, "live.php?id={$course->id}&user={$user}&date={$date}");
echo $OUTPUT->footer();
exit;
示例5: time
$date = time() - 3600;
$url = new moodle_url('/report/loglive/index.php', array('id' => $course->id, 'user' => 0, 'date' => $date, 'inpopup' => 1));
$strupdatesevery = get_string('updatesevery', 'moodle', REPORT_LOGLIVE_REFRESH);
$coursename = format_string($course->fullname, true, array('context' => $context));
$PAGE->set_url($url);
$PAGE->set_pagelayout('popup');
$PAGE->set_title("{$coursename}: {$strlivelogs} ({$strupdatesevery})");
$PAGE->set_periodic_refresh_delay(REPORT_LOGLIVE_REFRESH);
$PAGE->set_heading($strlivelogs);
echo $OUTPUT->header();
// Trigger a content view event.
$event = \report_loglive\event\content_viewed::create(array('courseid' => $course->id, 'other' => array('content' => 'loglive')));
$event->set_page_detail();
$event->set_legacy_logdata(array($course->id, 'course', 'report live', "report/loglive/index.php?id={$course->id}", $course->id));
$event->trigger();
print_log($course, 0, $date, "l.time DESC", $page, 500, $url);
echo $OUTPUT->footer();
exit;
}
if ($course->id == SITEID) {
admin_externalpage_setup('reportloglive', '', null, '', array('pagelayout' => 'report'));
echo $OUTPUT->header();
} else {
$PAGE->set_url('/report/log/live.php', array('id' => $course->id));
$PAGE->set_title($course->shortname . ': ' . $strlivelogs);
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
}
echo $OUTPUT->heading(get_string('pluginname', 'report_loglive'));
echo $OUTPUT->container_start('info');
$link = new moodle_url('/report/loglive/index.php', array('id' => $course->id, 'inpopup' => 1));
示例6: print_log_graph
}
break;
case "todaylogs" :
echo '<div class="graph">';
print_log_graph($course, $user->id, "userday.png");
echo '</div>';
print_log($course, $user->id, usergetmidnight(time()), "l.time DESC", $page, $perpage,
"user.php?id=$course->id&user=$user->id&mode=$mode");
break;
case "alllogs" :
echo '<div class="graph">';
print_log_graph($course, $user->id, "usercourse.png");
echo '</div>';
print_log($course, $user->id, 0, "l.time DESC", $page, $perpage,
"user.php?id=$course->id&user=$user->id&mode=$mode");
break;
case 'stats':
if (empty($CFG->enablestats)) {
print_error('statsdisable', 'error');
}
require_once($CFG->dirroot.'/lib/statslib.php');
$statsstatus = stats_check_uptodate($course->id);
if ($statsstatus !== NULL) {
echo $OUTPUT->notification($statsstatus);
}
$earliestday = $DB->get_field_sql('SELECT timeend FROM {stats_user_daily} ORDER BY timeend');
示例7: find_best_rate
}
$value_step = 10;
if (count($argv) > 3) {
$value_step = $argv[3];
}
$best_brl = find_best_rate($pairs_arbitrage_brl, $value_min, $value_max, $value_step, true);
//$best_usd = find_best_rate($pairs_arbitrage_usd, $value_min, $value_max, $value_step, false);
date_default_timezone_set('America/Sao_Paulo');
$arb_log = "/tmp/arbitrage.log";
/* open trade log*/
$fh = fopen($arb_log, 'a+') or die("can't open file");
function print_log($tolog)
{
global $fh;
fwrite($fh, date('Y-m-d H:i:s', time()) . " - " . $tolog . "\n");
print date('Y-m-d H:i:s', time()) . " - " . $tolog . "\n";
}
if ($best_brl['rate_no_withdrawal'] < 1.0) {
print_log("BRL => BTC => BRL (" . $best_brl['origin']['name'] . " => " . $best_brl['destination']['name'] . ")");
print_log($best_brl['origin']['results']['initial'] . " BRL => " . $best_brl['destination']['results']['initial'] . " BTC => " . $best_brl['destination']['results']['bought'] . " BRL");
print_log(1.0 / $best_brl['rate_no_withdrawal'] . " (Sell)");
print_log(1.0 / $best_brl['rate'] . " (Sell and withdraw)");
print_log("");
}
//if ($best_usd['rate_no_withdrawal'] < 1.0) {
// print_log( "USD => BTC => USD (" . $best_usd['origin']['name'] . " => ". $best_usd['destination']['name'] . ")");
// print_log( $best_usd['origin']['results']['initial'] . " USD => " . $best_usd['destination']['results']['initial'] . " BTC => " . $best_usd['destination']['results']['bought'] . " USD");
// print_log( 1.0/$best_usd['rate_no_withdrawal'] . " (Sell)");
// print_log( 1.0/$best_usd['rate'] . " (Sell and withdraw)");
// print_log( "");
//}
示例8: log_error
echo "Usage : release.sh <version>";
die;
}
$versionNumber = $argv[$argc - 1];
$nugetDirectory = $versionNumber . "/";
if (!file_exists($nugetDirectory)) {
log_error("Missing directory " . $nugetDirectory . " to create nuget package");
}
print_log("# Ok let's go !");
print_log("# Updating nuspec file for " . $projectName . " in version " . $versionNumber);
$nuspecFile = $nugetDirectory . $nuspecTemplate;
UpdateTemplate($nuspecTemplate, $nuspecFile, array('version' => $versionNumber));
move_chdir($nugetDirectory);
print_log("# Generating nuget package for " . $projectName . " in version " . $versionNumber);
exec_system("nuget pack -Verbosity quiet -NonInteractive");
print_log("# Uploading nuget package " . $projectName . " version " . $versionNumber . " to nuget server");
exec_system("nuget push -Verbosity quiet -NonInteractive *.nupkg");
move_chdir('..');
print_log("# Add new packages to git");
exec_system("git add -f " . $versionNumber . "/*.nupkg");
$commitMessage = "Release nuget package " . $projectName . " in version " . $versionNumber;
$commitMessage = str_replace('"', '\\"', $commitMessage);
print_log("# Commit packages to git");
$tag = 'v_' . $versionNumber;
exec_system('git tag -a ' . $tag . ' -m "Release ' . $projectName . ' in version ' . $versionNumber . '"');
exec_system('git commit -m "' . $commitMessage . '"');
// Push all tags
print_log("# Pushing tags to remote");
exec_system('git push origin ' . $tag);
print_log("# Finished Release ! :)");
示例9: date
"title":"' . $page_title . '",
"series":"' . $original_url->host . '",
"publisher":"' . $original_url . '",
"url":"' . $original_url . '",
"publicationYear":' . date('Y') . ',
"publicationMonth":' . date('n') . ',
"tags":["Downloads"]
}}';
$zip->addFromString("ZipInfo.txt", $zipinfo);
$zip->addFromString("manifest.txt", $manifest);
$zip->setArchiveComment($zipinfo);
$zip->close();
print_log("Created zip file '{$zipfilename}'");
print_log("numfiles: {$zip->numFiles}, size: " . format_bytes(filesize($zipfilename)));
} else {
print_log("No valid files retrieved. With no contents to bundle, I'm going to skip creating that zip file for you.");
}
// Clean up
rrmdir($dirname);
///////////////////////////////////////////////////////////////////////
/**
* A list of domains to ignore.
* These are domains that often look like image thumbnails -
* An img icon with a link around it is indistinguishable from a thumbnail
* linking to a gallery page - until you visit it.
*/
function get_domain_blacklist()
{
return array('www.facebook.com', 'feeds.feedburner.com', 'twitter.com', 'www.addthis.com', 'ehgt.org');
}
/**
示例10: do_get_links
function do_get_links($path, $sess_id, $server, $md5)
{
$out = array();
$md5_sid = substr(md5(time()), 0, 16);
$command = CURL_BIN . ' -A ' . CURL_USERAGENTS . ' -s -F "sid=' . $md5 . '" -F "session_id=' . $sess_id . '" -F "fname=' . basename($path) . '" -F "op=compile" ' . $server . '/api.cgi';
exec($command, $out);
if (is_array($out)) {
$str = implode('', $out);
$str = str_replace('#', '', $str);
$xml = xml2array($str);
if (array_key_exists('Links', $xml)) {
print_log('File uploaded successfully.', '+', 1, false);
print_log('---------------------------------------------------------------------------', '+', 1, false);
print_log('Link : ' . $xml['Links']['Link'], '+', 1, false);
print_log('Delete Link : ' . $xml['Links']['DelLink'], '+', 1, false);
print_log('---------------------------------------------------------------------------', '+', 1, true);
} else {
if (array_key_exists('Error', $xml)) {
print_log('Cannot compile uploaded file. (Reason: ' . $xml['Error'] . '). Exit', 'do_get_links', 0, true);
} else {
print_log('Invalid responds. (Reason: unknown XML). Exit', 'do_get_links', 0, true);
}
}
} else {
print_log('Invalid responds. Exit', 'do_get_links', 0, true);
}
}
示例11: read_logs
*/
function read_logs()
{
$files = glob(dirname(__FILE__) . '/*' . G_EXT_LOGS);
for ($index = 0, $max = count($files); $index < $max; $index++) {
echo '<a href="?file=' . $files[$index] . '">' . $files[$index] . '</a><br/>';
}
}
function print_log($file)
{
if (isset($file) && file_exists($file)) {
$lines = file($file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach ($lines as $line_nb => $line) {
echo sprintf('<div id="%s"> #<b>%d</b>: %s<br/></div>', $line_nb % 2 == 0 ? 'codeLnA' : 'codeLnB', $line_nb, htmlspecialchars($line));
}
unset($lines);
}
}
require '../local_configuration.php';
if (isset($_GET['file']) && file_exists($_GET['file'])) {
echo '<div style="font-family: monospace; size: 10px;"><h2>Current file</h2>';
print_log($_GET['file']);
echo '</div>';
}
echo '<div><h2>File list</h2>';
read_logs();
echo '</div>';
?>
</body>
</html>
示例12: proofsheet_filter_images
/**
* Given an array of file data, discard non-images
*/
function proofsheet_filter_images($files)
{
foreach ($files as $filepath => &$file) {
$meta = library_invoke_all('metadata_from_file', $file->filepath);
$file->meta = $meta;
#print_log($meta);
// Among a hundred other things, the meta will have
// deduced the mime_type.
// From the scanned metadata, promote the 'info' fields to the file object.
foreach ($meta as $tag => $values) {
list($tag_source, $tag_name) = split(':', $tag);
if ($tag_source == 'info') {
$file->{$tag_name} = reset($values);
}
}
if ($file->mime_type) {
list($media, $format) = split('/', $file->mime_type);
if ($media != 'image') {
print_log("{$filepath} is not an image, it's a {$media} ({$format})");
unset($files[$filepath]);
}
} else {
print_log("{$filepath} is unknown mime type");
unset($files[$filepath]);
}
}
return $files;
}
示例13: onload_func
function onload_func()
{
global $onlinedir, $Client, $inittime;
$olfile = $onlinedir . '/' . $Client['uid'];
if (file_exists($olfile)) {
print_log("Client file '{$olfile}' duplicated");
}
$data = array('uid' => $Client['uid'], 'pid' => $Client['pid'], 'ip' => $Client['ip'], 'host' => $Client['host'], 'useragent' => $Client['useragent'], 'inittime' => $inittime);
file_put_contents($olfile, serialize($data));
}
示例14: Member
<?php
if (isset($_POST['login_c'])) {
include_once '../../../settings.php';
include_once APPLICATION_PATH . '/includes/template.php';
include_once APPLICATION_PATH . '/includes/autoloader.php';
$member_ = new Member();
if ($member_->existUser($_POST['login_c'])) {
$member_->setUserData($_POST['login_c']);
$member_->initSession();
print_log($member_);
print_log($_POST);
print_log($_COOKIE);
if (isset($_POST['remember_me_c']) && $_POST['remember_me_c'] === true) {
$member_->initCookies();
} else {
$member_->destroyCookies();
}
}
}
$layouts_ = array('main_nav' => true, 'connexion' => true, 'footer' => true);
示例15: halt
function halt($str)
{
self::close();
print_log($str);
}