本文整理汇总了PHP中dbglog函数的典型用法代码示例。如果您正苦于以下问题:PHP dbglog函数的具体用法?PHP dbglog怎么用?PHP dbglog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dbglog函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkUpdateMessages
/**
* Check for new messages from upstream
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function checkUpdateMessages()
{
global $conf;
global $INFO;
global $updateVersion;
if (!$conf['updatecheck']) {
return;
}
if ($conf['useacl'] && !$INFO['ismanager']) {
return;
}
$cf = $conf['cachedir'] . '/messages.txt';
$lm = @filemtime($cf);
// check if new messages needs to be fetched
if ($lm < time() - 60 * 60 * 24 || $lm < @filemtime(DOKU_INC . DOKU_SCRIPT)) {
@touch($cf);
dbglog("checkUpdatesMessages(): downloading messages.txt");
$http = new DokuHTTPClient();
$http->timeout = 12;
$data = $http->get(DOKU_MESSAGEURL . $updateVersion);
io_saveFile($cf, $data);
} else {
dbglog("checkUpdatesMessages(): messages.txt up to date");
$data = io_readFile($cf);
}
// show messages through the usual message mechanism
$msgs = explode("\n%\n", $data);
foreach ($msgs as $msg) {
if ($msg) {
msg($msg, 2);
}
}
}
示例2: debug
function debug($msg, $msgLevel)
{
// DEBUG
// Write log on data/cache/debug.log
if ($this->getConf('rc_debug_level') >= $msgLevel) {
dbglog("RC:" . $msg);
}
}
示例3: handleError
public function handleError($errno, $message, $file, $line)
{
$aError = compact($errno, $message, $file, $line);
Pico::cfg()->use_debug_mail and dbgmail(print_r($aError, true), Pico::cfg()->admin_email);
Pico::cfg()->use_debug_log and dbglog(print_r($aError, true));
header("HTTP/1.0 500 Server Error");
PICOWA_DEBUG_MODE and print_r($aError);
echo $this->render('500');
die;
}
示例4: plain
function plain($string)
{
$doku_inline_tags = array('**', '//', "''", '<del>', '</del>', ']]');
$plain = str_replace($doku_inline_tags, '', $string);
$req_link = '/\\[\\[(.*?\\|)?/';
$plain = preg_replace($req_link, '', $plain);
dbglog($string, 'alphalist helper::plain before');
dbglog(trim($plain), 'alphalist helper::plain after');
return trim($plain);
}
示例5: send_change_mail
/**
* send an email to inform about a changed page
*
* @param $event
* @param $param
* @return bool false if the receiver is invalid or there was an error passing the mail to the MTA
*/
function send_change_mail(&$event, $param)
{
global $ID;
global $ACT;
global $INFO;
global $conf;
$data = pageinfo();
if ($ACT != 'save') {
return true;
}
// IO_WIKIPAGE_WRITE is always called twice when saving a page. This makes sure to only send the mail once.
if (!$event->data[3]) {
return true;
}
// Does the publish plugin apply to this page?
if (!$this->hlp->isActive($ID)) {
return true;
}
//are we supposed to send change-mails at all?
if ($this->getConf('apr_mail_receiver') === '') {
return true;
}
// get mail receiver
$receiver = $this->getConf('apr_mail_receiver');
$validator = new EmailAddressValidator();
$validator->allowLocalAddresses = true;
if (!$validator->check_email_address($receiver)) {
dbglog(sprintf($this->getLang('mail_invalid'), htmlspecialchars($receiver)));
return false;
}
// get mail sender
$ReplyTo = $data['userinfo']['mail'];
if ($ReplyTo == $receiver) {
return true;
}
if ($INFO['isadmin'] == '1') {
return true;
}
// get mail subject
$timestamp = dformat($data['lastmod'], $conf['dformat']);
$subject = $this->getLang('apr_mail_subject') . ': ' . $ID . ' - ' . $timestamp;
$body = $this->create_mail_body('change');
$mail = new Mailer();
$mail->to($receiver);
$mail->subject($subject);
$mail->setBody($body);
$mail->setHeader("Reply-To", $ReplyTo);
$returnStatus = $mail->send();
return $returnStatus;
}
示例6: _remote
/**
* Render the output remotely at ditaa.org
*/
function _remote($data, $in, $out)
{
if (!file_exists($in)) {
if ($conf['debug']) {
dbglog($in, 'no such seqdia input file');
}
return false;
}
$http = new DokuHTTPClient();
$http->timeout = 30;
$pass = array();
$pass['style'] = $data['style'];
$pass['message'] = io_readFile($in);
$result = $http->post('http://www.websequencediagrams.com/index.php', $pass);
if (!$result) {
return false;
}
$json = new JSON(JSON_LOOSE_TYPE);
$json->skipnative = true;
$json_data = $json->decode($result);
$img = $http->get('http://www.websequencediagrams.com/index.php' . $json_data['img']);
if (!$img) {
return false;
}
return io_saveFile($out, $img);
}
示例7: log_media
/**
* Log access to a media file
*
* called from action.php
*
* @param string $media the media ID
* @param string $mime the media's mime type
* @param bool $inline is this displayed inline?
* @param int $size size of the media file
*/
public function log_media($media, $mime, $inline, $size)
{
// handle user agent
$ua = addslashes($this->ua_agent);
$ua_type = addslashes($this->ua_type);
$ua_ver = addslashes($this->ua_version);
$os = addslashes($this->ua_platform);
$ua_info = addslashes($this->ua_name);
$media = addslashes($media);
list($mime1, $mime2) = explode('/', strtolower($mime));
$mime1 = addslashes($mime1);
$mime2 = addslashes($mime2);
$inline = $inline ? 1 : 0;
$size = (int) $size;
$ip = addslashes(clientIP(true));
$uid = addslashes($this->uid);
$user = addslashes($_SERVER['REMOTE_USER']);
$session = addslashes($this->getSession());
$sql = "INSERT DELAYED INTO " . $this->hlp->prefix . "media\n SET dt = NOW(),\n media = '{$media}',\n ip = '{$ip}',\n ua = '{$ua}',\n ua_info = '{$ua_info}',\n ua_type = '{$ua_type}',\n ua_ver = '{$ua_ver}',\n os = '{$os}',\n user = '{$user}',\n session = '{$session}',\n uid = '{$uid}',\n size = {$size},\n mime1 = '{$mime1}',\n mime2 = '{$mime2}',\n inline = {$inline}\n ";
$ok = $this->hlp->runSQL($sql);
if (is_null($ok)) {
global $MSG;
dbglog($MSG);
}
}
示例8: elseif
$sModuleFileName = $sModuleName . '.php';
if (!$bFlagStop) {
if (file_exists(FLGR_MODULES . '/' . $sModuleFileName)) {
$sModuleFileName = FLGR_MODULES . '/' . $sModuleFileName;
} elseif (file_exists(FLGR_CMS_MODULES . '/' . $sModuleFileName)) {
$sModuleFileName = FLGR_CMS_MODULES . '/' . $sModuleFileName;
} else {
dbglog('DBG_KRNL', 'Error: "Module not found" in index at line ' . __LINE__);
$sModuleFileName = false;
}
if ($sModuleFileName !== false) {
dbglog('DBG_KRNL', '===========================================', '===========================================');
dbglog('DBG_KRNL', $nId, '$nId');
dbglog('DBG_KRNL', $sTitle, '$sTitle');
dbglog('DBG_KRNL', $bFlagLastModule, '$bFlagLastModule');
dbglog('DBG_KRNL', $sModuleName, 'include');
include $sModuleFileName;
}
}
}
// Обработка 404, 301
if ($bFlag404) {
// nat
$sql = $Db->sqlGetSelect(DB_PREFIX . DB_TBL_NAT, array('to')) . $Db->sqlGetWhere(array('from' => $sRequest));
$sql = $Db->queryRow($sql);
if (!empty($sql)) {
// 301
// cStat::bSaveEvent(EVENT_301);
$nat = current($sql);
header('301 Moved Permanently');
header('Location: ' . $nat);
示例9: pingSearchEngines
/**
* Pings search engines with the sitemap url. Plugins can add or remove
* urls to ping using the SITEMAP_PING event.
*
* @author Michael Hamann
*/
public function pingSearchEngines()
{
//ping search engines...
$http = new DokuHTTPClient();
$http->timeout = 8;
$encoded_sitemap_url = urlencode(wl('', array('do' => 'sitemap'), true, '&'));
$ping_urls = array('google' => 'http://www.google.com/webmasters/sitemaps/ping?sitemap=' . $encoded_sitemap_url, 'yahoo' => 'http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=dokuwiki&url=' . $encoded_sitemap_url, 'microsoft' => 'http://www.bing.com/webmaster/ping.aspx?siteMap=' . $encoded_sitemap_url);
$data = array('ping_urls' => $ping_urls, 'encoded_sitemap_url' => $encoded_sitemap_url);
$event = new Doku_Event('SITEMAP_PING', $data);
if ($event->advise_before(true)) {
foreach ($data['ping_urls'] as $name => $url) {
dbglog("Sitemapper::PingSearchEngines(): pinging {$name}");
$resp = $http->get($url);
if ($http->error) {
dbglog("Sitemapper:pingSearchengines(): {$http->error}");
}
dbglog('Sitemapper:pingSearchengines(): ' . preg_replace('/[\\n\\r]/', ' ', strip_tags($resp)));
}
}
$event->advise_after();
return true;
}
示例10: _run
/**
* Run the ditaa Java program
*/
function _run($data, $in, $out)
{
global $conf;
if (!file_exists($in)) {
if ($conf['debug']) {
dbglog($in, 'no such ditaa input file');
}
return false;
}
$cmd = $this->getConf('java');
$cmd .= ' -Djava.awt.headless=true -Dfile.encoding=UTF-8 -jar';
$cmd .= ' ' . escapeshellarg(dirname(__FILE__) . '/ditaa/ditaa0_9.jar');
//ditaa jar
$cmd .= ' --encoding UTF-8';
$cmd .= ' ' . escapeshellarg($in);
//input
$cmd .= ' ' . escapeshellarg($out);
//output
$cmd .= ' -s ' . escapeshellarg($data['scale']);
if (!$data['antialias']) {
$cmd .= ' -A';
}
if (!$data['shadow']) {
$cmd .= ' -S';
}
if ($data['round']) {
$cmd .= ' -r';
}
if (!$data['edgesep']) {
$cmd .= ' -E';
}
exec($cmd, $output, $error);
if ($error != 0) {
if ($conf['debug']) {
dbglog(join("\n", $output), 'ditaa command failed: ' . $cmd);
}
return false;
}
return true;
}
示例11: define
/**
* Statistics plugin - data logger
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Andreas Gohr <gohr@cosmocode.de>
*/
if (!defined('DOKU_INC')) {
define('DOKU_INC', realpath(dirname(__FILE__) . '/../../../') . '/');
}
define('DOKU_DISABLE_GZIP_OUTPUT', 1);
require_once DOKU_INC . 'inc/init.php';
session_write_close();
// all features are brokered by the helper plugin
/** @var helper_plugin_statistics $plugin */
$plugin = plugin_load('helper', 'statistics');
dbglog('Log ' . $_SERVER['REQUEST_URI']);
switch ($_REQUEST['do']) {
case 'v':
$plugin->Logger()->log_access();
$plugin->Logger()->log_session(1);
break;
/** @noinspection PhpMissingBreakStatementInspection */
/** @noinspection PhpMissingBreakStatementInspection */
case 'o':
$plugin->Logger()->log_outgoing();
//falltrough
//falltrough
default:
$plugin->Logger()->log_session();
}
// fixme move to top
示例12: elseif
if (!$bFlagStop) {
if (file_exists(FLGR_MODULES . '/' . $sModuleFileName)) {
$sModuleFileName = FLGR_MODULES . '/' . $sModuleFileName;
} elseif (file_exists(FLGR_CMS_MODULES . '/' . $sModuleFileName)) {
$sModuleFileName = FLGR_CMS_MODULES . '/' . $sModuleFileName;
} else {
dbglog('Error: "Module not found" in index at line ' . __LINE__);
$sModuleFileName = false;
}
if ($sModuleFileName !== false) {
if (defined('KRNL')) {
dbglog('===========================================', '===========================================');
dbglog($nId, '$nId');
dbglog($sTitle, '$sTitle');
dbglog($bFlagLastModule, '$bFlagLastModule');
dbglog($sModuleName, 'include');
}
include $sModuleFileName;
}
}
}
// Обработка 404, 301
if ($bFlag404) {
// nat
$sql = "SELECT `to` FROM `" . DB_PREFIX . DB_TBL_NAT . "` WHERE `from` = '" . $sRequest . "'";
$sql = mysql_query($sql);
$sql = mysql_fetch_assoc($sql);
if (!empty($sql)) {
// 301
cStat::bSaveEvent(EVENT_301);
$nat = current($sql);
示例13: header
if (!$bFlagLastModule) {
return;
}
// ---------------------------
// Если нет параметра в запросе - перебрасываем
// на профиль залогиненного пользователя
if (!$bFlag404) {
header('Location: /user/' . $Permissions->getLoggedUserId());
include_once FLGR_COMMON . '/exit.php';
}
// off
$off = $aRequest[$nLevel + 1];
if ((string) (int) $off != $off) {
$errmess = 'WARN: Неверный id пользователя: ' . $off . ' !';
Console::log($errmess);
dbglog('DEBUG', $errmess);
$off = (int) $off;
}
//Console::log($seg.':'.$off);
// Получаем данные
$aUser = $Users->getBaseData($off);
if (empty($aUser)) {
//Console::log(__FILE_.' ('.__LINE__.') - Пользователь не найден');
die('Пользователь не найден');
}
//Console::log('$aUser:');
//Console::log($aUser);
// Add BreadCrumb
$BreadCrumbs->add('/user/' . $off, $aUser['family'] . ' ' . $aUser['name']);
// CSS
stylesheet('profile.css');
示例14: _run
/**
* Run the graphviz program
*/
function _run($data, $in, $out)
{
global $conf;
if (!file_exists($in)) {
if ($conf['debug']) {
dbglog($in, 'no such graphviz input file');
}
return false;
}
$cmd = $this->getConf('path');
if (isset($data['layer_n']) && isset($data['layer_cur'])) {
$gvpath = dirname($this->getConf('path'));
$script = 'BEG_G { char* larr[int]; int i; if (!isAttr($,"G","layers")) return; if (isAttr($,"G","layersep")) tokens($.layers,larr,$.layersep); else tokens($.layers,larr," :\\t"); for (larr[i]) { printf("%s\\n",larr[i]); } }';
exec(sprintf("%s/gvpr %s %s", escapeshellarg($gvpath), escapeshellarg($script), escapeshellarg($in)), $exout, $retval);
$cmd .= sprintf(" '-Glayerselect=%s'%s", $exout[$data['layer_cur']], (int) $data['layer_cur'] > 0 ? ' -Gbgcolor=#00000000' : '');
}
$cmd .= ' -Tpng';
$cmd .= ' -K' . $data['layout'];
$cmd .= ' -o' . escapeshellarg($out);
//output
$cmd .= ' ' . escapeshellarg($in);
//input
if (isset($data['dpi']) && $data['dpi'] > 0) {
$cmd .= sprintf(" -Gdpi=%d", $data['dpi']);
}
$cmd .= ' 2>/dev/null';
exec($cmd, $output, $error);
if (isset($data['slicespace']) && $data['slicespace'] > 0) {
$image = new Imagick($out);
$trans = new ImagickPixel('transparent');
$imageprops = $image->getImageGeometry();
$w = $imageprops['width'];
$h = $imageprops['height'];
$draw = new ImagickDraw();
$draw->setFillColor($trans);
// Set up some colors to use for fill and outline
$draw->setStrokeColor(new ImagickPixel('rgb(40,40,40)'));
$draw->rectangle(0, 0, $w - 1, $h - 1);
// Draw the rectangle
$image->drawImage($draw);
$image->resizeImage($w * 2, $h, imagick::FILTER_LANCZOS, 1.0);
$image->shearImage($trans, 45, 0);
$imageprops = $image->getImageGeometry();
$w = $imageprops['width'];
$image->resizeImage($w / 2, $h / 2, imagick::FILTER_LANCZOS, 1.0);
$image->writeImage($out);
}
if ($error != 0) {
if ($conf['debug']) {
dbglog(join("\n", $output), 'graphviz command failed: ' . $cmd);
}
return false;
}
return true;
}
示例15: retrieveGroups
public function retrieveGroups($start = 0, $limit = 0)
{
// connect to mysql
$link = mysql_connect($this->phpbb3_dbhost, $this->phpbb3_dbuser, $this->phpbb3_dbpasswd);
if (!$link) {
dbglog("authphpbb3 error: can't connect to database server");
msg("Database error. Contact wiki administrator", -1);
return false;
}
// set codepage to utf-8
mysql_set_charset("utf8", $link);
// select forum database
if (!mysql_select_db($this->phpbb3_dbname, $link)) {
dbglog("authphpbb3 error: can't use database");
msg("Database error. Contact wiki administrator", -1);
mysql_close($link);
return false;
}
if (limit > 0) {
// get groups from db
$query = "select *\n\t\t\t\t\tfrom {$this->phpbb3_table_prefix}groups \n\t\t\t\t\twhere 1 = 1\n order by group_name\n limit {$start}, {$limit}";
$rs = mysql_query($query, $link);
while ($row = mysql_fetch_array($rs)) {
// fill array of groups names whith data from db
$tmpvar[] = $row['group_name'];
}
mysql_close($link);
return $tmpvar;
} else {
mysql_close($link);
return false;
}
}