• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP error_report函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: generate_from_id

 function generate_from_id($id)
 {
     $sql = "select * from {$this->type} where id = {$id}";
     //echo $sql;
     if (!($result = $this->db->query($sql))) {
         error_report(SQL_ERROR, 'generate', __LINE__, __FILE__, $sql);
     }
     $row = $result->fetchRow(DB_FETCHMODE_ASSOC);
     return $this->generate_from_row($row);
 }
开发者ID:BackupTheBerlios,项目名称:yaret,代码行数:10,代码来源:classes.php


示例2: error_fatal

function error_fatal($type, $message, $file, $line = 0)
{
    switch ($type) {
        case E_USER_ERROR:
            $type_str = 'Error';
            break;
        case E_WARNING:
        case E_USER_WARNING:
            $type_str = 'Warning';
            break;
        case E_NOTICE:
        case E_USER_NOTICE:
            $type_str = 'Notice';
            break;
        case QUICKSILVER_QUERY_ERROR:
            $type_str = 'Query Error';
            break;
        default:
            $type_str = 'Unknown Error';
    }
    if (strstr($file, 'eval()')) {
        $split = preg_split('/[\\(\\)]/', $file);
        $file = $split[0];
        $line = $split[1];
        $message .= ' (in evaluated code)';
    }
    $details = null;
    if ($type != QUICKSILVER_QUERY_ERROR) {
        if (strpos($message, 'mysql_fetch_array(): supplied argument') === false) {
            $lines = null;
            $details2 = null;
            if (function_exists('debug_backtrace')) {
                $backtrace = debug_backtrace();
                if (strpos($message, 'Template not found') !== false) {
                    $file = $backtrace[2]['file'];
                    $line = $backtrace[2]['line'];
                }
            }
            if (file_exists($file)) {
                $lines = file($file);
            }
            if ($lines) {
                $details2 = "\n\t\t\t\t<span class='header'>Code:</span><br />\n\t\t\t\t<span class='code'>" . error_getlines($lines, $line) . '</span>';
            }
        } else {
            $details2 = "\n\t\t\t<span class='header'>MySQL Said:</span><br />" . mysql_error() . '<br />';
        }
        $details .= "\n\t\t<span class='header'>{$type_str} [{$type}]:</span><br />\n\t\tThe error was reported on line <b>{$line}</b> of <b>{$file}</b><br /><br />{$details2}";
    } else {
        $details .= "\n\t\t<span class='header'>{$type_str} [{$line}]:</span><br />\n\t\tThis type of error is reported by MySQL.\n\t\t<br /><br /><span class='header'>Query:</span><br />{$file}<br />";
    }
    $checkbug = error_report($type, $message, $file, $line);
    $temp_querystring = str_replace("&", "&amp;", $_SERVER['QUERY_STRING']);
    return "\n\t<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n\t<html>\n\t<head>\n\t<title>Quicksilver Forums Error</title>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n\n\t<style type='text/css'>\n\tbody {font-size:12px; font-family: verdana, arial, helvetica, sans-serif; color:#000000; background-color:#ffffff}\n\thr {height:1px}\n\t.large  {font-weight:bold; font-size:18px; color:#660000; background-color:transparent}\n\t.header {font-weight:bold; font-size:12px; color:#660000; background-color:transparent}\n\t.error  {font-weight:bold; font-size:12px; color:#ff0000; background-color:transparent}\n\t.small  {font-weight:bold; font-size:10px; color:#000000; background-color:transparent}\n\t.code   {font-weight:normal; font-size:12px; font-family:courier new, fixedsys, serif}\n\t</style>\n\t</head>\n\n\t<body>\n\t<span class='large'>Quicksilver Forums has exited with an error</span><br /><br />\n\n\t<hr>\n\t<span class='error'>{$message}</span>\n\t<hr><br />\n\n\t{$details}\n\n\t<br /><hr><br />\n\t<a href='http://developer.berlios.de/bugs/?group_id=5008' class='small'>Check status of problem (recommended)</a><br />\n\t<a href='{$_SERVER['PHP_SELF']}?{$temp_querystring}&amp;debug=1' class='small'>View debug information (advanced)</a><br />\n\t<a href='{$_SERVER['PHP_SELF']}' class='small'>Return to the board</a>\n\t</body>\n\t</html>";
}
开发者ID:BackupTheBerlios,项目名称:qsf-svn,代码行数:55,代码来源:error.php


示例3: autoloader

function autoloader($class)
{
    $name = explode('_', $class);
    try {
        @(include_once './models/' . strtolower($name[0]) . '.php');
        @(include_once './controllers/' . strtolower($name[0]) . '.php');
        @(include_once './views/' . strtolower($name[0]) . '.php');
    } catch (ErrorException $e) {
        error_report($e);
        die;
    }
}
开发者ID:hanyuwei70,项目名称:VCBS-Sub,代码行数:12,代码来源:index.php


示例4: http_get_simple

function http_get_simple($url)
{
    $options = array('http' => array('header' => '', 'method' => 'GET'));
    $context = stream_context_create($options);
    $stream = fopen($url, 'r', false, $context);
    if ($stream === FALSE) {
        error_report("Error opening GET request to URL '{$url}'");
        return FALSE;
    }
    $meta = stream_get_meta_data($stream);
    $result = array('headers' => $meta['wrapper_data'], 'meta' => $meta, 'content' => stream_get_contents($stream));
    return $result;
}
开发者ID:scraimer,项目名称:bgggcr,代码行数:13,代码来源:http.inc.php


示例5: auth_activate_by_cookie

function auth_activate_by_cookie($cookie)
{
    $result = db_get_auth_request_by_cookie($cookie);
    if ($result === FALSE) {
        error_report("Error: No such cookie is known.");
        return FALSE;
    }
    $success = db_mark_user_as_authenicated($result['username'], $result['cookie'], $result['id']);
    if ($success === FALSE) {
        error_report("Error: Could not mark user as 'authenticated'. Aborting.");
        return FALSE;
    }
    return TRUE;
}
开发者ID:scraimer,项目名称:bgggcr,代码行数:14,代码来源:auth.inc.php


示例6: generate_from_content_id

 function generate_from_content_id($content_id)
 {
     global $db, $config_vars;
     unset($this->meta_data);
     $sql = 'select * from ' . $config_vars['table_prefix'] . "content_meta_data where content_id = {$content_id}";
     if (!($result = $db->sql_query($sql))) {
         error_report(SQL_ERROR, 'generate', __LINE__, __FILE__, $sql);
     }
     while ($row = $db->sql_fetchrow($result)) {
         $this->meta_data[$row['id']] = $row;
     }
     $this->content_id = $content_id;
     return OP_SUCCESSFUL;
 }
开发者ID:BackupTheBerlios,项目名称:phreakpic,代码行数:14,代码来源:meta.inc.php


示例7: bgg_login

function bgg_login()
{
    global $config;
    if ($config['bgg']['cookie'] !== FALSE) {
        error_report("Already logged in! Not logging in again.");
        return TRUE;
    }
    $url = "https://" . $config['bgg']['domain'] . "/login";
    $params = array('lasturl' => '/', 'username' => $config['bgg']['username'], 'password' => $config['bgg']['password']);
    $result = http_post($url, $params);
    if ($result === FALSE) {
        return FALSE;
    }
    $cookies = bgg_get_cookies_from_headers($result['headers']);
    if (!isset($cookies['bggusername']) || !isset($cookies['bggpassword']) || !isset($cookies['SessionID'])) {
        error_log("Missing cookies after BGG logon. Logon error!");
        return FALSE;
    }
    $bgg_cookies = sprintf("bggusername=%s; bggpassword=%s; SessionID=%s", $cookies['bggusername'], $cookies['bggpassword'], $cookies['SessionID']);
    $config['bgg']['cookie'] = $bgg_cookies;
    return TRUE;
}
开发者ID:scraimer,项目名称:bgggcr,代码行数:22,代码来源:bgg.inc.php


示例8: get_content_ordered_by

function get_content_ordered_by($by, $filter = true, $order = 'DESC', $limit_start = 0, $limit_end = -1)
{
    // returns a assoc array containing 'object' = content objects and 'length' = how long they have been viewed ordered by the length they have been viewed.
    global $db, $config_vars;
    if ($filter) {
        $filter = 'and (view_table.end!=0)';
    }
    $sql = 'SELECT SUM(UNIX_TIMESTAMP(view_table.end) - UNIX_TIMESTAMP(view_table.start)) as length,COUNT(*) as amount,content.* FROM ' . $config_vars['table_prefix'] . 'views AS view_table, ' . $config_vars['table_prefix'] . 'content AS content 
		WHERE (view_table.content_id=content.id) ' . $filter . '
		GROUP BY view_table.content_id 
		ORDER BY ' . $by . " {$order} \n\t\tLIMIT {$limit_start},{$limit_end}";
    if (!($result = $db->sql_query($sql))) {
        error_report(SQL_ERROR, 'get_content_ordered_by', __LINE__, __FILE__, $sql);
    }
    while ($row = $db->sql_fetchrow($result)) {
        $a['object'] = get_content_from_row($row);
        $a['length'] = $row['length'];
        $a['amount'] = $row['amount'];
        $objarray[] = $a;
    }
    return $objarray;
}
开发者ID:BackupTheBerlios,项目名称:phreakpic,代码行数:22,代码来源:statistics.inc.php


示例9: run_test


//.........这里部分代码省略.........
        */
        if (preg_match("/^{$wanted_re}\$/s", $output)) {
            $passed = true;
            if (!$cfg['keep']['php']) {
                @unlink($test_file);
            }
            if (!$leaked && !$failed_headers) {
                if (isset($section_text['XFAIL'])) {
                    $warn = true;
                    $info = " (warn: XFAIL section but test passes)";
                } else {
                    show_result("PASS", $tested, $tested_file, '', $temp_filenames);
                    junit_mark_test_as('PASS', $shortname, $tested);
                    return 'PASSED';
                }
            }
        }
    } else {
        $wanted = trim($section_text['EXPECT']);
        $wanted = preg_replace('/\\r\\n/', "\n", $wanted);
        show_file_block('exp', $wanted);
        // compare and leave on success
        if (!strcmp($output, $wanted)) {
            $passed = true;
            if (!$cfg['keep']['php']) {
                @unlink($test_file);
            }
            if (!$leaked && !$failed_headers) {
                if (isset($section_text['XFAIL'])) {
                    $warn = true;
                    $info = " (warn: XFAIL section but test passes)";
                } else {
                    show_result("PASS", $tested, $tested_file, '', $temp_filenames);
                    junit_mark_test_as('PASS', $shortname, $tested);
                    return 'PASSED';
                }
            }
        }
        $wanted_re = null;
    }
    // Test failed so we need to report details.
    if ($failed_headers) {
        $passed = false;
        $wanted = $wanted_headers . "\n--HEADERS--\n" . $wanted;
        $output = $output_headers . "\n--HEADERS--\n" . $output;
        if (isset($wanted_re)) {
            $wanted_re = preg_quote($wanted_headers . "\n--HEADERS--\n", '/') . $wanted_re;
        }
    }
    if ($leaked) {
        $restype[] = 'LEAK';
    }
    if ($warn) {
        $restype[] = 'WARN';
    }
    if (!$passed) {
        if (isset($section_text['XFAIL'])) {
            $restype[] = 'XFAIL';
            $info = '  XFAIL REASON: ' . rtrim($section_text['XFAIL']);
        } else {
            $restype[] = 'FAIL';
        }
    }
    if (!$passed) {
        // write .exp
        if (strpos($log_format, 'E') !== false && file_put_contents($exp_filename, $wanted, FILE_BINARY) === false) {
            error("Cannot create expected test output - {$exp_filename}");
        }
        // write .out
        if (strpos($log_format, 'O') !== false && file_put_contents($output_filename, $output, FILE_BINARY) === false) {
            error("Cannot create test output - {$output_filename}");
        }
        // write .diff
        $diff = generate_diff($wanted, $wanted_re, $output);
        if (is_array($IN_REDIRECT)) {
            $diff = "# original source file: {$shortname}\n" . $diff;
        }
        show_file_block('diff', $diff);
        if (strpos($log_format, 'D') !== false && file_put_contents($diff_filename, $diff, FILE_BINARY) === false) {
            error("Cannot create test diff - {$diff_filename}");
        }
        // write .sh
        if (strpos($log_format, 'S') !== false && file_put_contents($sh_filename, "#!/bin/sh\n\n{$cmd}\n", FILE_BINARY) === false) {
            error("Cannot create test shell script - {$sh_filename}");
        }
        chmod($sh_filename, 0755);
        // write .log
        if (strpos($log_format, 'L') !== false && file_put_contents($log_filename, "\n---- EXPECTED OUTPUT\n{$wanted}\n---- ACTUAL OUTPUT\n{$output}\n---- FAILED\n", FILE_BINARY) === false) {
            error("Cannot create test log - {$log_filename}");
            error_report($file, $log_filename, $tested);
        }
    }
    show_result(implode('&', $restype), $tested, $tested_file, $info, $temp_filenames);
    foreach ($restype as $type) {
        $PHP_FAILED_TESTS[$type . 'ED'][] = array('name' => $file, 'test_name' => (is_array($IN_REDIRECT) ? $IN_REDIRECT['via'] : '') . $tested . " [{$tested_file}]", 'output' => $output_filename, 'diff' => $diff_filename, 'info' => $info);
    }
    $diff = empty($diff) ? '' : preg_replace('/\\e/', '<esc>', $diff);
    junit_mark_test_as($restype, str_replace($cwd . '/', '', $tested_file), $tested, null, $info, $diff);
    return $restype[0] . 'ED';
}
开发者ID:jimjag,项目名称:php-src,代码行数:101,代码来源:run-tests.php


示例10: run_test


//.........这里部分代码省略.........
    $out = system_with_timeout($cmd);
    if (!empty($section_text['ENV'])) {
        foreach (explode("\n", $section_text['ENV']) as $env) {
            $env = explode('=', $env);
            putenv($env[0] . '=');
        }
    }
    @unlink($tmp_post);
    // Does the output match what is expected?
    $output = trim($out);
    $output = preg_replace('/\\r\\n/', "\n", $output);
    /* when using CGI, strip the headers from the output */
    if (isset($old_php) && ($pos = strpos($output, "\n\n")) !== FALSE) {
        $output = substr($output, $pos + 2);
    }
    if (isset($section_text['EXPECTF']) || isset($section_text['EXPECTREGEX'])) {
        if (isset($section_text['EXPECTF'])) {
            $wanted = trim($section_text['EXPECTF']);
        } else {
            $wanted = trim($section_text['EXPECTREGEX']);
        }
        $wanted_re = preg_replace('/\\r\\n/', "\n", $wanted);
        if (isset($section_text['EXPECTF'])) {
            $wanted_re = preg_quote($wanted_re, '/');
            // Stick to basics
            $wanted_re = str_replace("%e", '\\' . DIRECTORY_SEPARATOR, $wanted_re);
            $wanted_re = str_replace("%s", ".+?", $wanted_re);
            //not greedy
            $wanted_re = str_replace("%i", "[+\\-]?[0-9]+", $wanted_re);
            $wanted_re = str_replace("%d", "[0-9]+", $wanted_re);
            $wanted_re = str_replace("%x", "[0-9a-fA-F]+", $wanted_re);
            $wanted_re = str_replace("%f", "[+\\-]?\\.?[0-9]+\\.?[0-9]*(E-?[0-9]+)?", $wanted_re);
            $wanted_re = str_replace("%c", ".", $wanted_re);
            // %f allows two points "-.0.0" but that is the best *simple* expression
        }
        /* DEBUG YOUR REGEX HERE
        		var_dump($wanted_re);
        		print(str_repeat('=', 80) . "\n");
        		var_dump($output);
        */
        if (preg_match("/^{$wanted_re}\$/s", $output)) {
            @unlink($tmp_file);
            echo "PASS {$tested}\n";
            if (isset($old_php)) {
                $php = $old_php;
            }
            return 'PASSED';
        }
    } else {
        $wanted = trim($section_text['EXPECT']);
        $wanted = preg_replace('/\\r\\n/', "\n", $wanted);
        // compare and leave on success
        $ok = 0 == strcmp($output, $wanted);
        if ($ok) {
            @unlink($tmp_file);
            echo "PASS {$tested}\n";
            if (isset($old_php)) {
                $php = $old_php;
            }
            return 'PASSED';
        }
        $wanted_re = NULL;
    }
    // Test failed so we need to report details.
    if ($warn) {
        echo "WARN {$tested}{$info}\n";
    } else {
        echo "FAIL {$tested}{$info}\n";
    }
    $PHP_FAILED_TESTS['FAILED'][] = array('name' => $file, 'test_name' => (is_array($IN_REDIRECT) ? $IN_REDIRECT['via'] : '') . $tested, 'output' => $output_filename, 'diff' => $diff_filename, 'info' => $info);
    // write .exp
    if (strpos($log_format, 'E') !== FALSE) {
        $log = fopen($exp_filename, 'w') or error("Cannot create test log - {$exp_filename}");
        fwrite($log, $wanted);
        fclose($log);
    }
    // write .out
    if (strpos($log_format, 'O') !== FALSE) {
        $log = fopen($output_filename, 'w') or error("Cannot create test log - {$output_filename}");
        fwrite($log, $output);
        fclose($log);
    }
    // write .diff
    if (strpos($log_format, 'D') !== FALSE) {
        $log = fopen($diff_filename, 'w') or error("Cannot create test log - {$diff_filename}");
        fwrite($log, generate_diff($wanted, $wanted_re, $output));
        fclose($log);
    }
    // write .log
    if (strpos($log_format, 'L') !== FALSE) {
        $log = fopen($log_filename, 'w') or error("Cannot create test log - {$log_filename}");
        fwrite($log, "\n---- EXPECTED OUTPUT\n{$wanted}\n---- ACTUAL OUTPUT\n{$output}\n---- FAILED\n");
        fclose($log);
        error_report($file, $log_filename, $tested);
    }
    if (isset($old_php)) {
        $php = $old_php;
    }
    return $warn ? 'WARNED' : 'FAILED';
}
开发者ID:BackupTheBerlios,项目名称:php-qt-svn,代码行数:101,代码来源:run-tests.php


示例11: serverInterface_error_report

function serverInterface_error_report($a)
{
    if (G()->SET['error_report']['javascript']->v) {
        $a['error source'] = 'js';
        error_report($a);
    }
}
开发者ID:nikbucher,项目名称:shwups-cms-v4,代码行数:7,代码来源:qg.php


示例12: calc_child_comments_amount

    function calc_child_comments_amount()
    {
        global $db, $config_vars;
        //get the comments from  cat
        $sql = 'SELECT count(cat_comments.id) FROM ' . $config_vars['table_prefix'] . 'cat_comments AS cat_comments WHERE cat_comments.owner_id = ' . $this->id;
        if (!($result = $db->sql_query($sql))) {
            $error = new phreak_error(E_WARNING, SQL_ERROR, __LINE__, __FILE__, 'calc_child_comments_amoount', $this->id, 0, 0, $sql);
            $error->commit();
            error_report(SQL_ERROR, 'commit', __LINE__, __FILE__, $sql);
        }
        $row = $db->sql_fetchrow($result);
        $amount = $row[0];
        //get the comments from content
        $sql = 'SELECT count(content_comments.id) 
				FROM ' . $config_vars['table_prefix'] . 'content_comments AS content_comments, ' . $config_vars['table_prefix'] . 'content_in_cat AS content_in_cat 
				WHERE (content_in_cat.cat_id = ' . $this->id . ') AND (content_in_cat.content_id = content_comments.owner_id)';
        if (!($result = $db->sql_query($sql))) {
            error_report(SQL_ERROR, 'commit', __LINE__, __FILE__, $sql);
        }
        $row = $db->sql_fetchrow($result);
        $amount += $row[0];
        $child_cats = get_cats_of_cat($this->id);
        for ($i = 0; $i < sizeof($child_cats); $i++) {
            if ($child_cats[$i]->id != $config_vars['root_categorie']) {
                $amount += $child_cats[$i]->calc_child_comments_amount();
            }
        }
        return $amount;
    }
开发者ID:BackupTheBerlios,项目名称:phreakpic,代码行数:29,代码来源:categorie.inc.php


示例13: error_report

    $entry->commit();
    $HTTP_GET_VARS['sel_group_id'] = $entry->id;
}
if (isset($HTTP_POST_VARS['change'])) {
    // make sure at first var is set
    if ($HTTP_POST_VARS[$entry->processing_vars[0]] == '') {
        error_report(INFORMATION, 'enter_name', __LINE__, __FILE__);
    }
    $entry->generate_from_id($HTTP_GET_VARS['sel_group_id']);
    $entry->set_vars($HTTP_POST_VARS);
    $entry->commit();
}
// get all usergroups
$sql = "SELECT * from " . $config_vars['table_prefix'] . "{$_SESSION[type]}s";
if (!($result = $db->sql_query($sql))) {
    error_report(AUTH_ERROR, 'get_groups', __LINE__, __FILE__, $sql);
}
while ($row = $db->sql_fetchrow($result)) {
    $groups[] = $row;
}
// get data of selected group
foreach ($groups as $value) {
    if ($value['id'] == $HTTP_GET_VARS['sel_group_id']) {
        $sel_group = $value;
        break;
    }
}
$smarty->assign('processing_vars', $entry->processing_vars);
$smarty->assign('groups', $groups);
$smarty->assign('sel_group_id', $HTTP_GET_VARS['sel_group_id']);
$smarty->assign('sel_group', $sel_group);
开发者ID:BackupTheBerlios,项目名称:phreakpic,代码行数:31,代码来源:groups.php


示例14: db_mark_user_as_authenicated

function db_mark_user_as_authenicated($bggusername, $cookie, $auth_req_id)
{
    global $dbh;
    $id = FALSE;
    $sth = $dbh->prepare('
		SELECT id
			FROM `users`
	WHERE username=:username
		');
    $sth->bindParam('username', $bggusername, PDO::PARAM_STR);
    $sth->execute();
    $id = FALSE;
    if ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
        $id = $row['id'];
    }
    $sth = NULL;
    $params = array('username' => $bggusername, 'cookie' => $cookie);
    if ($id === FALSE) {
        $sth = $dbh->prepare('INSERT INTO users (username, cookie) VALUES (:username, :cookie)');
    } else {
        $sth = $dbh->prepare('UPDATE users SET username=:username, cookie=:cookie WHERE id=:id');
        $params['id'] = $id;
    }
    $result = $sth->execute($params);
    # Now the user is authenticated, we can delete the auth request
    if ($result) {
        $sth = $dbh->prepare('DELETE FROM authrequests WHERE id=:id');
        $delete_result = $sth->execute(array(':id' => $auth_req_id));
        if ($delete_result === FALSE) {
            $info = $sth->errorInfo();
            error_report("Warning: There was en error deleting auth request ID=" . $auth_req_id . " (" . $info[2] . "). Until it is deleted, that user cannot re-auth.");
        }
    }
    return $result !== FALSE;
}
开发者ID:scraimer,项目名称:bgggcr,代码行数:35,代码来源:db.inc.php


示例15: run_test


//.........这里部分代码省略.........
            $wanted_re = str_replace('%s', '[^\\r\\n]+', $wanted_re);
            $wanted_re = str_replace('%a', '.+', $wanted_re);
            $wanted_re = str_replace('%w', '\\s*', $wanted_re);
            $wanted_re = str_replace('%i', '[+-]?\\d+', $wanted_re);
            $wanted_re = str_replace('%d', '\\d+', $wanted_re);
            $wanted_re = str_replace('%x', '[0-9a-fA-F]+', $wanted_re);
            $wanted_re = str_replace('%f', '[+-]?\\.?\\d+\\.?\\d*(?:[Ee][+-]?\\d+)?', $wanted_re);
            $wanted_re = str_replace('%c', '.', $wanted_re);
            // %f allows two points "-.0.0" but that is the best *simple* expression
        }
        /* DEBUG YOUR REGEX HERE
        		var_dump($wanted_re);
        		print(str_repeat('=', 80) . "\n");
        		var_dump($output);
        */
        if (preg_match((string) "/^{$wanted_re}\$/s", $output)) {
            $passed = true;
            if (!$cfg['keep']['php']) {
                @unlink($test_file);
            }
            if (isset($old_php)) {
                $php = $old_php;
            }
            if (!$leaked && !$failed_headers) {
                show_result("PASS", $tested, $tested_file, '', $temp_filenames);
                return 'PASSED';
            }
        }
    } else {
        $wanted = trim($section_text['EXPECT']);
        $wanted = preg_replace('/\\r\\n/', "\n", $wanted);
        show_file_block('exp', $wanted);
        // compare and leave on success
        if (!strcmp($output, $wanted)) {
            $passed = true;
            if (!$cfg['keep']['php']) {
                @unlink($test_file);
            }
            if (isset($old_php)) {
                $php = $old_php;
            }
            if (!$leaked && !$failed_headers) {
                show_result("PASS", $tested, $tested_file, '', $temp_filenames);
                return 'PASSED';
            }
        }
        $wanted_re = null;
    }
    // Test failed so we need to report details.
    if ($failed_headers) {
        $passed = false;
        $wanted = $wanted_headers . "\n--HEADERS--\n" . $wanted;
        $output = $output_headers . "\n--HEADERS--\n" . $output;
        if (isset($wanted_re)) {
            $wanted_re = preg_quote($wanted_headers . "\n--HEADERS--\n", '/') . $wanted_re;
        }
    }
    if ($leaked) {
        $restype[] = 'LEAK';
    }
    if ($warn) {
        $restype[] = 'WARN';
    }
    if (!$passed) {
        if (isset($section_text['XFAIL'])) {
            $restype[] = 'XFAIL';
        } else {
            $restype[] = 'FAIL';
        }
    }
    if (!$passed) {
        // write .exp
        if (strpos($log_format, 'E') !== false && file_put_contents($exp_filename, (string) $wanted, FILE_BINARY) === false) {
            error("Cannot create expected test output - {$exp_filename}");
        }
        // write .out
        if (strpos($log_format, 'O') !== false && file_put_contents($output_filename, (string) $output, FILE_BINARY) === false) {
            error("Cannot create test output - {$output_filename}");
        }
        // write .diff
        $diff = generate_diff($wanted, $wanted_re, $output);
        show_file_block('diff', $diff);
        if (strpos($log_format, 'D') !== false && file_put_contents($diff_filename, (string) $diff, FILE_BINARY) === false) {
            error("Cannot create test diff - {$diff_filename}");
        }
        // write .log
        if (strpos($log_format, 'L') !== false && file_put_contents($log_filename, "\n---- EXPECTED OUTPUT\n{$wanted}\n---- ACTUAL OUTPUT\n{$output}\n---- FAILED\n", FILE_BINARY) === false) {
            error("Cannot create test log - {$log_filename}");
            error_report($file, $log_filename, $tested);
        }
    }
    show_result(implode('&', $restype), $tested, $tested_file, $info, $temp_filenames);
    foreach ($restype as $type) {
        $PHP_FAILED_TESTS[$type . 'ED'][] = array('name' => $file, 'test_name' => (is_array($IN_REDIRECT) ? $IN_REDIRECT['via'] : '') . $tested . " [{$tested_file}]", 'output' => $output_filename, 'diff' => $diff_filename, 'info' => $info);
    }
    if (isset($old_php)) {
        $php = $old_php;
    }
    return $restype[0] . 'ED';
}
开发者ID:wgy0323,项目名称:ffmpeg-php,代码行数:101,代码来源:run-tests.php


示例16: session_start

<?php

//philum_ajax_hangar
session_start();
error_report();
$_SESSION['onload'] = '';
if (!$_SESSION['stime']) {
    req('boot,art,spe');
    master_params('params/_' . $db, $qd, $aqb, $subd);
    define_hubs();
    define_qb();
    define_config();
    time_system($cache);
    cache_arts();
    define_cats_rqt();
    define_condition();
    define_clr();
}
if (!$_SESSION['picto']) {
    $_SESSION['picto'] = msql_read('system', 'edition_pictos', '', 1);
}
$res = $_GET['res'];
if (substr($res, -1) == '_') {
    $res = substr($res, 0, -1);
}
list($n, $id, $va, $opt, $optb) = ajxr($_GET['callj']);
$sz = $_GET['sz'];
$pp = $_GET['popup'];
$ar = array('plug' => 1, 'plup' => 1, 'plugin' => 1, 'plupin' => 1, 'titsav' => 1, 'popbub' => 1, 'call' => 1, 'callp' => 1);
if (!$ar[$n]) {
    require_once 'prog' . $b . '/ajxf.php';
开发者ID:philum,项目名称:cms,代码行数:31,代码来源:ajax.php


示例17: add_signin_log

function add_signin_log($account, $accepted, $time, $ip)
{
    $sql = 'INSERT INTO `signin_log`(`account`, `accepted`, `time`, `ip`)    VALUES(?, ?, ?, ?)';
    $params = array($account, $accepted, $time, $ip);
    $cnt = (new MysqlDAO())->execute($sql, $params, 'ssii');
    if ($cnt != 1) {
        error_report('store sign in log error');
    }
    return;
}
开发者ID:newnius,项目名称:quickauth,代码行数:10,代码来源:account-functions.php


示例18: award_microbadges_and_send_confirmations

function award_microbadges_and_send_confirmations()
{
    global $config;
    $how_many_to_send = $config['bgg']['max_award_geekmails_rate_per_hour'];
    # This is a little tricky. We don't need to send a geemail to the
    # recipients, since that will get sent by the microbadge awarding in BGG. We
    # will send a geekmail to the givers, but really only a single geekmail to
    # many recipients. Howerver, because I don't want this script going crazy,
    # I'll just use the configuration value to limit how many awards are given
    # out.
    $reqs = db_get_award_requests($how_many_to_send);
    if (count($reqs) == 0) {
        print "No reqs\n";
        return TRUE;
    }
    $result = bgg_login();
    if ($result === FALSE) {
        error_report("Error logging into BGG.");
        exit;
    }
    # I don't want to bulk-award the microbadges. It will make it hard to refund
    # awards, or handle re-try. (For example, a user might accidentaly get a
    # 4-star before getting a 3-star).
    #
    # So we'll just award them to each recipient, one at a time.
    #
    $givers = array();
    foreach ($reqs as $req) {
        echo "REQ: recipient=" . $req['recipient'] . " id=" . $req['id'] . "\n";
        $user = bgg_get_profile($req['recipient']);
        if ($user === FALSE || $user['result'] === FALSE) {
            error_report("Error fetching profile of '" . $req['recipient'] . "' while awarding a microbage (req ID " . $req['id'] . ")");
            continue;
        }
        # Does the recipient already have 5 stars?
        $has_stars = array_reduce($user['stars'], "array_counter", 0);
        if ($has_stars >= 5) {
            # Refund the current request
            error_report("Warning: The user \"" . $req['recipient'] . "\" already has five stars, so the request with ID " . $req['id'] . " will be refunded to " . $req['giver_username']);
            $result = award_refund($req['id']);
            if ($result === FALSE) {
                error_report("Warning: The award could not be refunded. It will be " . "checked again later. Unless these are eventually refunded or " . "deleted, they will accumulate and clog up the award queue.");
            }
            continue;
        }
        $mb_id = $bgg_mb_stars[$has_stars];
        # Award the microbadge
        $result = bgg_award_microbadge_bulk($mb_id, $req['recipient'], $config['bgg']['mb_award_msg_template']);
        if ($result === FALSE || $result['result'] === FALSE) {
            error_report("Error while awarding microbadge for award ID " . $req['id']);
            continue;
        }
        # Mark as awarded
        db_award_set_awarded($req['id']);
        # Add the giver to the list of givers who will recieve confirmation of award.
        # Both for later geekmailing.
        array_push($givers, $req['giver_username']);
        # Sleep for a bit, to give the BGG database time to update the user's profile
        usleep(300 * 1000);
        # Verify it was received, in the recpient profile
        $user = bgg_get_profile($req['recipient']);
        if ($user === FALSE || $user['result'] === FALSE) {
            error_report("Error verifying whether award ID " . $req['id'] . " was awarded.");
        } else {
            if ($user['stars'][$has_stars - 1]) {
                # Mark as verified
                if (!db_award_set_verified($req['id'])) {
                    error_report("Error marking award ID " . $req['id'] . " as verified.");
                }
            } else {
                error_report("Warning: The star hasn't appeared yet, " . "(request ID={$id}, star={$has_stars}) so it will not be marked as verified.");
            }
        }
    }
    # Send a mass-mail to all the givers, notifying them the microbadge has been awarded
    $to_givers = implode(',', $givers);
    geekmail_send($to_givers, $config['bgg']['giver_confirmation_msg_subject'], $config['bgg']['giver_confirmation_msg_body']);
    return TRUE;
}
开发者ID:scraimer,项目名称:bgggcr,代码行数:79,代码来源:send-queued-gm-and-mb.php


示例19: exit

<?php

if (!defined('PHPHOTPIC')) {
    exit('Access Denied');
}
$base['get']['id'] = intval($base['get']['id']);
$image = $db->first("SELECT * FROM {$base['config']['db']['pre']}images WHERE id={$base['get']['id']} LIMIT 1");
if (!$image) {
    error_report($base['lang']['image_not_exist']);
}
$db->query("UPDATE {$base['config']['db']['pre']}images SET views=views+1 WHERE id={$base['get']['id']} LIMIT 1");
$base['title'] = 'Show image ' . $image['originalname'];
$size = getimagesize($base['dir'] . '/i/' . $image['filename'] . $image['extension']);
$sizew = $size[0];
$other = "";
if ($sizew > 800) {
    $sizeh = ceil($size[1] * 800 / $sizew);
    $other = " width='800' height='{$sizeh}'";
}
$base['imagename'] = $image['originalname'];
$base['imageviews'] = $image['views'] + 1;
$base['imagedate'] = convertdate($image['time']);
$base['show'] = '<img src="' . $base['config']['url'] . '/i/' . $image['filename'] . $image['extension'] . '" alt="' . htmlspecialchars($image['originalname']) . '"' . $other . ' />';
$base['isthumb'] = $image['isthumb'];
$base['direct_url1'] = getlink('show', array($image['id'], '&amp;'));
$base['direct_url2'] = $base['config']['url'] . '/i/' . $image['filename'] . $image['extension'];
$base['bb_full'] = '[url=' . getlink('show', array($image['id'], '&amp;')) . '][img]' . $base['config']['url'] . '/i/' . $image['filename'] . $image['extension'] . '[/img][/url]';
$base['bb_thumb'] = '[url=' . getlink('show', array($image['id'], '&amp;')) . '][img]' . $base['config']['url'] . '/i/' . $image['filename'] . '.th' . $image['extension'] . '[/img][/url]';
$base['html_full'] = '&lt;a href=&quot;' . getlink('show', array($image['id'], '&amp;')) . '&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;' . $base['config']['url'] . '/i/' . $image['filename'] . $image['extension'] . '&quot; alt=&quot;Host by ' . $_SERVER['HTTP_HOST'] . '&quot; /&gt;&lt;/a&gt;';
$base['html_thumb'] = '&lt;a href=&quot;' . getlink('show', array($image['id'], '&amp;')) . '&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;' . $base['config']['url'] . '/i/' . $image['filename'] . '.th' . $image['extension'] . '&quot; alt=&quot;Host by ' . $_SERVER['HTTP_HOST'] . '&quot; /&gt;&lt;/a&gt;';
unset($image);
开发者ID:anugool,项目名称:php-news,代码行数:31,代码来源:show.mod.php


示例20: paddslashes

require_once $base['dir'] . 'data/config.php';
require_once $base['dir'] . 'source/core.func.php';
require_once $base['dir'] . 'source/mysqldb.class.php';
$base['post'] = paddslashes($_POST);
$base['get'] = paddslashes($_GET);
$base['cookie'] = paddslashes($_COOKIE);
unset($_POST);
unset($_GET);
unset($_COOKIE);
$langset = $base['cookie']['lang'] ? $base['cookie']['lang'] : $config['lang'];
require_once $base['dir'] . 'lang/langset.php';
$langset = in_array($langset, array_keys($all_lang)) ? $langset : $base['cookie']['lang'];
require_once $base['dir'] . 'lang/' . $langset . '/all.lang.php';
$base['lang'] = $lang;
unset($lang);
$base['config'] = $config;
unset($config);
$db = new mysql_database();
if (!$db->connect($base['config']['db'])) {
    error_report($base['lang']['db_connect_error']);
}
if ($base['get']['mod'] == '') {
    $base['get']['mod'] = 'index';
}
if (!empty($_FILES)) {
    $base['get']['mod'] = 'upload';
}
if (!in_array($base['get']['mod'], array('index', 'upload', 'show', 'admin'))) {
    error_report(str_replace('\\1', '<code>' . htmlspecialchars($base['get']['mod']) . '</code>', $base['lang']['mod_not_found']));
}
require_once $base['dir'] . 'source/' . $base['get']['mod'] . '.mod.php';
开发者ID:anugool,项目名称:php-news,代码行数:31,代码来源:index.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP error_report_show函数代码示例发布时间:2022-05-15
下一篇:
PHP error_popup函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap