本文整理汇总了PHP中debug_log函数的典型用法代码示例。如果您正苦于以下问题:PHP debug_log函数的具体用法?PHP debug_log怎么用?PHP debug_log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了debug_log函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_debug
function show_debug()
{
global $mypbx, $debug, $phone_data, $data_credit;
if (is_array($phone_data['number'])) {
$k = array_keys($phone_data['number']);
$data_credit = $phone_data[$k[0]];
}
if (function_exists(debug_log) && $debug) {
if (count($debug) < 200) {
$debug = array_reverse($debug);
foreach ($debug as $key => $log) {
if ($log['level'] == 'd' && ($mypbx['logging'] == 'debug' || $data_credit['debugphone'] == 'd' && $data_credit['phoneid'] == true)) {
//echo $log['file']."-".$log['status']."-".$log['log']."<br>";
debug_log($log['log'], $log['status'], $log['file']);
} elseif ($log['level'] == 'v' && ($mypbx['logging'] == 'debug' || $mypbx['logging'] == 'verbose' || $data_credit['debugphone'] == 'v' && $data_credit['phoneid'] == true || $data_credit['debugphone'] == 'd' && $data_credit['phoneid'] == true)) {
//echo $log['file']."-".$log['status']."-".$log['log']."<br>";
debug_log($log['log'], $log['status'], $log['file']);
} elseif ($log['level'] == 'm' && ($mypbx['logging'] == 'minimal' || $mypbx['logging'] == 'verbose' || $mypbx['logging'] == 'debug' || $data_credit['debugphone'] == 'm' && $data_credit['phoneid'] == true || $data_credit['debugphone'] == 'v' && $data_credit['phoneid'] == true || $data_credit['debugphone'] == 'd' && $data_credit['phoneid'] == true)) {
debug_log($log['log'], $log['status'], $log['file']);
} elseif ($log['level'] == '' && ($mypbx['logging'] == 'minimal' || $mypbx['logging'] == 'verbose' || $mypbx['logging'] == 'debug' || $data_credit['debugphone'] == 'm' && $data_credit['phoneid'] == true || $data_credit['debugphone'] == 'v' && $data_credit['phoneid'] == true || $data_credit['debugphone'] == 'd' && $data_credit['phoneid'] == true)) {
//echo $log['file']."-".$log['status']."-".$log['log']."<br>";
debug_log($log['log'], $log['status'], $log['file']);
}
}
} else {
debug_log("Count of log is to high: " . count($debug), 'problem', __FILE__ . ":" . __LINE__);
}
}
}
示例2: session_timed_out
/**
* Check if custom session timeout has been reached for server $ldapserver.
* If it has:
* - automatically log out user by calling $ldapserver->unsetLoginDN()
* - if $server_id is equal to right frame $server_id, load timeout.php page in the right frame
* - return true
*
* @param object $ldapserver The LDAPServer object of the server which the user has logged in.
* @return bool true on success, false on failure.
*/
function session_timed_out($ldapserver)
{
if (DEBUG_ENABLED) {
debug_log('session_timed_out(): Entered with (%s)', 1, $ldapserver->server_id);
}
# If session hasn't expired yet
if (isset($_SESSION['activity']['server'][$ldapserver->server_id])) {
# If $session_timeout not defined, use (session_cache_expire() - 1)
if (!isset($ldapserver->session_timeout)) {
$session_timeout = session_cache_expire() - 1;
} else {
$session_timeout = $ldapserver->session_timeout;
}
# Get the $last_activity and $rightframe_server_id value
$last_activity = $_SESSION['activity']['server'][$ldapserver->server_id];
# If diff between current time and last activity greater than $session_timeout, log out user
if (time() - $last_activity > $session_timeout * 60) {
if (in_array($ldapserver->auth_type, array('cookie', 'session'))) {
syslog_notice('Logout for ' . $ldapserver->getLoggedInDN());
$ldapserver->unsetLoginDN() or pla_error(_('Could not logout.'));
}
return true;
} else {
return false;
}
}
}
示例3: addValue
public function addValue($new_val, $i = -1)
{
if (DEBUG_ENABLED && (($fargs = func_get_args()) || ($fargs = 'NOARGS'))) {
debug_log('Entered (%%)', 5, 0, __FILE__, __LINE__, __METHOD__, $fargs);
}
$this->addOption($new_val, $i);
}
示例4: register_email
function register_email($account)
{
global $_url, $MMORPG_Name, $MMORPG_Description;
//-----------------------------------------------
//DECLARE LES VARIABLES
//-----------------------------------------------
$sujet = "{$MMORPG_Name} - Validation inscription";
$destinataire = $account['Account_Email'];
//'mail_destinataire@fai.fr';
$url_valid = get_link('Register', 'User', array('Valid' => 'Activer', 'Account_Key' => $account['Account_Key'], 'Account_Email' => $account['Account_Email']));
$message_texte = 'Bonjour,' . "\n\n" . 'utilisier ce lien dans votre navigateur pour valider votre inscription' . "\n\n" . $url_valid;
$message_html = '<html>
<head>
<title>' . $MMORPG_Name . ' - valider votre inscription</title>
</head>
<body>
' . $MMORPG_Description . '<hr/>
Vous venez d\'effectuer l\'inscription sur le site <a href="' . $_url . '">' . $MMORPG_Name . '</a> .<br/><br/>
Pour valider votre inscription, cliquez sur ce bouton :
<form method="post" action="' . get_link('Register', 'User') . '">
<input type="hidden" name="Account_Key" value="' . $account['Account_Key'] . '"/>
<input type="hidden" name="Account_Email" value="' . $account['Account_Email'] . '"/>
<input type="submit" name="Valid" value="Activer"/>
</form>
Ou sur <a href="' . $url_valid . '">ce lien</a>
</body>
</html>';
debug_log($message_html, false);
send_email($account['Account_Email'], $sujet, $message_texte, $message_html);
}
示例5: download
protected function download(Request $request, $prefix, $attachment = false)
{
$path = $request->path();
// trim prefix
if (starts_with($path, $prefix)) {
$path = substr($path, strlen($prefix));
}
debug_log('File Download[File Path]', $path);
// make absolute file path
$path = wordpress_path($path);
// ERROR: file not found
if (!is_file($path)) {
debug_log('File Download: [Abort]: not found');
abort(404);
}
$extension = pathinfo($path, PATHINFO_EXTENSION);
// ERROR: file extension is .php
if ($extension == 'php') {
debug_log('File Download: [Abort]: .php');
abort(404);
}
debug_log('File Download[Content Type]', $this->getMimeType($path, $extension));
$headers = ['Content-Type' => $this->getMimeType($path, $extension)];
if ($attachment === false) {
return response()->make(file_get_contents($path), 200, $headers);
}
return response()->download($path, 200, $headers);
}
示例6: exception_error_handler
function exception_error_handler($errno, $errstr, $errfile, $errline)
{
if (function_exists("debug_log")) {
debug_log("Error {$errno} : {$errstr} - {$errfile} @ {$errline}");
}
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
示例7: login
function login()
{
global $secteur, $page, $_path, $newsAmodifier, $array_adm;
if ($page == 'login') {
//Si l'id passé en paramètre dans l'url n'existe pas, c'est que le visiteur a été amenené ici par hasard
if (!request_confirm('admin-login')) {
//Donc on redirige vers index.php
header('location:' . getenv('HTTP_REFERER'));
//Puis on stoppe l'exécution du script
exit;
}
debug_log('page login');
// si on s'identifie
if (request_confirm('admin-login')) {
debug_log('form login');
$login = request_post('pseudo');
$pass = request_post('password');
if (array_key_exists($login, $array_adm)) {
debug_log('exists login' . "test({$pass} == " . $array_adm[$login] . ")");
if ($pass == $array_adm[$login]) {
debug_log('pass login');
$_SESSION['admin'] = true;
$_SESSION['user'] = $login;
} else {
$_SESSION['error'] = "Mot de passe erroné.";
}
} else {
$_SESSION['error'] = "Cet accès n'existe pas.";
}
header('location:' . getenv('HTTP_REFERER'));
}
}
}
示例8: nameavailableAction
public function nameavailableAction()
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
debug_log('[DatasetsController::nameavailableAction]: ' . $_GET["n"]);
if ($this->session->userid === null || isset($_GET["n"]) === false) {
$this->getResponse()->clearAllHeaders();
$this->getResponse()->setRawHeader("HTTP/1.0 403 Forbidden");
$this->getResponse()->setHeader("Status", "403 Forbidden");
return;
}
$name = $this->_getParam("n");
$id = $this->_getParam("id");
if (is_numeric($id) && intval($id) <= 0) {
$id = 0;
}
$res = Datasets::nameAvailability($name, $id);
header('Content-type: text/xml');
if ($res === true) {
echo "<response>OK</response>";
} else {
echo "<response error='" . htmlentities("The given name is already used by another dataset.") . "' >";
echo "<search>";
echo htmlentities($name);
echo "</search>";
foreach ($res as $k => $v) {
echo "<" . $k . ">";
echo htmlentities($v);
echo "</" . $k . ">";
}
echo "</response>";
}
}
示例9: report
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @return void
*/
public function report(Exception $e)
{
if ($e instanceof MethodNotAllowedHttpException) {
$request = app('request');
debug_log(get_class($e), $request->method() . ' ' . $request->fullUrl());
}
return parent::report($e);
}
示例10: loadClass
public function loadClass($base_path, $relative_class_name)
{
$path = $base_path . '/' . str_replace('\\', '/', $relative_class_name) . '.php';
debug_log('try include', $path);
if (file_exists($path)) {
require_once $path;
}
}
示例11: debugFlag
function debugFlag($message, $tag = null)
{
global $DEBUG_FLAG_TAG;
if (!isset($DEBUG_FLAG_TAG)) {
$DEBUG_FLAG_TAG = isset($tag) ? $tag : time();
}
debug_log(getToolNameForConsole() . " {$DEBUG_FLAG_TAG} {$message}");
}
示例12: response_json
function response_json($value)
{
$response = raw_json_encode($value);
debug_log("Response: " . $response);
header('Content-Type: application/json');
// 古いIEがおかしいMIMEタイプ判定をしてXSSの原因になる問題を避けるための呪符
header('X-Content-Type-Options: nosniff');
echo $response;
}
示例13: log
/**
* Helper function to log formatted messages to log. In case of
* DEBUG or INFO type the logging occurs only for development
* instances of the application.
*
* @param string $message The message to log
* @param string $type Type of logging. EG DEBUG, INFO, ERROR, WARN
*/
private static function log($message, $type = 'ERROR')
{
$txt = '[EmailService::' . strtoupper($type) . ']: ' . $message;
if ($type === 'DEBUG' || $type === 'INFO') {
debug_log($txt);
} else {
error_log('[EmailService::' . strtoupper($type) . ']: ' . $message);
}
}
示例14: register_email
function register_email($account)
{
global $MMORPG_Name;
debug_log("register-member-end => send mail init");
$sujet = "{$MMORPG_Name} - Validation inscription";
$destinataire = $account['Account_Email'];
//'mail_destinataire@fai.fr';
list($message_texte, $message_html) = content_valid_mail($account);
send_email($account['Account_Email'], $sujet, $message_texte, $message_html);
}
示例15: addObjectProperty
function addObjectProperty($name, $value = NULL)
{
debug_log("%s::%s(%s, %s)", __CLASS__, __FUNCTION__, $name, $value);
$element = $this->createObjectPropertyElement($name);
$this->payload->appendChild($element);
if ($value instanceof DomNode) {
$element->appendChild($value);
} elseif (isset($value)) {
$element->appendChild($this->createTextNode($value));
}
return $element;
}