当前位置: 首页>>代码示例>>PHP>>正文


PHP report_error函数代码示例

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


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

示例1: __construct

 function __construct($username)
 {
     $this->_username = $username;
     log_error("Initalizing DB connecion!");
     try {
         if (!MYSQL_ENABLE) {
             $path = explode('/', $_SERVER['SCRIPT_FILENAME']);
             $db_name = 'weave_db';
             array_pop($path);
             array_push($path, $db_name);
             $db_name = implode('/', $path);
             if (!file_exists($db_name)) {
                 report_error("The required sqllite database is not present! {$db_name}");
             }
             log_error("Starting SQLite connection");
             $this->_dbh = new PDO('sqlite:' . $db_name);
             $this->_dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
         } else {
             if (MYSQL_ENABLE) {
                 log_error("Starting MySQL connection");
                 $this->_dbh = new PDO("mysql:host=" . MYSQL_HOST . ";dbname=" . MYSQL_DB, MYSQL_USER, MYSQL_PASSWORD);
             }
         }
     } catch (PDOException $exception) {
         log_error("database unavailable " . $exception->getMessage());
         throw new Exception("Database unavailable " . $exception->getMessage(), 503);
     }
 }
开发者ID:nafets,项目名称:FSyncMS,代码行数:28,代码来源:weave_storage.php

示例2: assert_die

function assert_die($param, $message, $strict = true)
{
    if ($strict) {
        if ($param === FALSE) {
            report_error($message);
        }
    } else {
        if (!$param) {
            report_error($message);
        }
    }
}
开发者ID:nanoprime,项目名称:sureinvoice,代码行数:12,代码来源:phpdt_to_sureinvoice.php

示例3: show_exception

 function show_exception($exception)
 {
     if (!is_null($CI =& get_instance())) {
         $message = $exception->getMessage();
         if (empty($message)) {
             $message = '(null)';
         }
         $error_data['exception'] = $exception;
         $error_data['message'] = $message;
         $CI->load->helper('email');
         report_error('error_exception', $error_data);
     }
     return parent::show_exception($exception);
 }
开发者ID:RimeOfficial,项目名称:postmaster,代码行数:14,代码来源:MY_Exceptions.php

示例4: has_registered_responses

function has_registered_responses($player_id, $clue_id_array)
{
    /* Returns the number of registered responses for the
       given player to clues in $clue_id_array. */
    $query_template = "SELECT COUNT(*) FROM player_responses\n        WHERE player_id = ? AND clue_id IN (%s)";
    $tuple_text = implode(',', $clue_id_array);
    $query = sprintf($query_template, $tuple_text);
    $count = 0;
    $stmt = $mysqli->prepare($query);
    if (!$stmt) {
        report_error(sprintf("Could not prepare user response " . "selection statement (error %d)", $mysqli->errno));
    }
    $stmt->bind_param('i', $player_id);
    $stmt->execute();
    $stmt->bind_result($count);
    $stmt->fetch();
    $stmt->close();
    return $count;
}
开发者ID:rjaguar3,项目名称:shc-manager,代码行数:19,代码来源:autofill_cron.php

示例5: auth_check

$obsoletedby = $patchinfo->getObsoletingPatches($bug, $patch, $revision);
$obsoletes = $patchinfo->getObsoletePatches($bug, $patch, $revision);
$patches = $patchinfo->listPatches($bug);
$revisions = $patchinfo->listRevisions($bug, $patch);
$canpatch = auth_check('pear.bug') || auth_check('pear.dev');
response_header('Bug #' . clean($bug) . ' :: Patches');
if (isset($_GET['diff']) && $_GET['diff'] && isset($_GET['old']) && is_numeric($_GET['old'])) {
    /**
     * Display patch diff
     */
    $diffoldrev = (int) $_GET['old'];
    $old = $patchinfo->getPatchFullpath($bug_id, $patch, $diffoldrev);
    $new = $path;
    if (!realpath($old) || !realpath($new)) {
        response_header('Error :: Cannot retrieve patch');
        report_error('Internal error: Invalid patch revision specified for diff');
        response_footer();
        exit;
    }
    require_once 'Horde/Text/Diff.php';
    require_once 'bugs/Diff/pearweb.php';
    assert_options(ASSERT_WARNING, 0);
    $d = new Horde_Text_Diff('auto', array($orig = file($old), $now = file($new)));
    $diff = new Horde_Text_Diff_Renderer_pearweb();
    include PEARWEB_TEMPLATEDIR . '/bugs/patchinfo.php';
    include PEARWEB_TEMPLATEDIR . '/bugs/patchdiff.php';
    response_footer();
    exit;
}
/**
 * Display patch alone
开发者ID:stof,项目名称:pearweb,代码行数:31,代码来源:patch-display.php

示例6: with

  <li>The list of modules you compiled PHP with (your configure line).</li>
  <li>Any other information unique or specific to your setup.</li>
  <li>
     Any changes made in your php.ini compared to php.ini-dist
     (<strong>not</strong> your whole php.ini!)
  </li>
  <li>
     A <a href="http://bugs.php.net/bugs-generating-backtrace.php">gdb backtrace</a>.
  </li>
 </ul>
</p>

<?php 
}
//no post set
report_error($errors);
$action = 'report.php?package=' . $clean_package;
?>
<form method="post" action="<?php 
echo $action;
?>
" name="bugreport" id="bugreport">
<table class="form-holder" cellspacing="1">
 <tr>
  <th class="form-label_left">
<?php 
if (isset($auth_user)) {
    ?>
   Your handle:
  </th>
  <td class="form-input">
开发者ID:stof,项目名称:pearweb,代码行数:31,代码来源:report.php

示例7: report_error

                    report_error('Missing package ID!');
                    break;
                }
                include_once 'pear-database-release.php';
                if (release::remove($_GET['id'], $_GET['release'])) {
                    echo "<b>Release successfully deleted.</b><br /><br />\n";
                } else {
                    report_error('An error occured while deleting the release!');
                }
                break;
        }
    }
}
$row = package::info((int) $_GET['id']);
if (empty($row['name'])) {
    report_error('Illegal package id');
    response_footer();
    exit;
}
print_package_navigation($row['packageid'], $row['name'], '/package-edit.php?id=' . $row['packageid']);
$sth = $dbh->query('SELECT id, name FROM categories ORDER BY name');
while ($cat_row = $sth->fetchRow(DB_FETCHMODE_ASSOC)) {
    $rows[$cat_row['id']] = $cat_row['name'];
}
$form = new HTML_QuickForm2('package-edit', 'post', array('action' => '/package-edit.php?id=' . $row['packageid']));
$form->removeAttribute('name');
$renderer = HTML_QuickForm2_Renderer::factory('default');
// Set defaults for the form elements
$form->addDataSource(new HTML_QuickForm2_DataSource_Array(array('name' => htmlspecialchars($row['name']), 'license' => htmlspecialchars($row['license']), 'summary' => htmlspecialchars($row['summary']), 'description' => htmlspecialchars($row['description']), 'category' => (int) $row['categoryid'], 'homepage' => htmlspecialchars($row['homepage']), 'doc_link' => htmlspecialchars($row['doc_link']), 'bug_link' => htmlspecialchars($row['bug_link']), 'cvs_link' => htmlspecialchars($row['cvs_link']), 'unmaintained' => $row['unmaintained'] ? true : false, 'newpk_id' => (int) $row['newpk_id'], 'new_channel' => htmlspecialchars($row['new_channel']), 'new_package' => htmlspecialchars($row['new_package']))));
$form->addElement('text', 'name', array('maxlength' => "80", 'accesskey' => "c"))->setLabel('Pa<span class="accesskey">c</span>kage Name');
$form->addElement('text', 'license', array('maxlength' => "50", 'placeholder' => 'BSD'))->setLabel('License:');
开发者ID:stof,项目名称:pearweb,代码行数:31,代码来源:package-edit.php

示例8: report_error

                    }
                    if (!isset($rv[GESHI_AFTER])) {
                        report_error(TYPE_WARNING, "Language file contains no GESHI_AFTER entry in extended regular expression at \$language_data['REGEXPS'][{$rk}]!");
                    } elseif (!is_string($rv[GESHI_AFTER])) {
                        report_error(TYPE_ERROR, "Language file contains a GESHI_AFTER entry in extended regular expression at \$language_data['REGEXPS'][{$rk}] which is not a string!");
                    }
                } else {
                    report_error(TYPE_WARNING, "Language file contains an non-string and non-array entry at \$language_data['REGEXPS'][{$rk}]!");
                }
                if (!isset($language_data['STYLES']['REGEXPS'][$rk])) {
                    report_error(TYPE_WARNING, "Language file contains no \$language_data['STYLES']['REGEXPS'] specification for regexp group {$rk}!");
                }
            }
            foreach ($language_data['STYLES']['REGEXPS'] as $rk => $rv) {
                if (!isset($language_data['REGEXPS'][$rk])) {
                    report_error(TYPE_NOTICE, "Language file contains an superfluous \$language_data['STYLES']['REGEXPS'] specification for regexp key {$rk}!");
                }
            }
        }
        output_error_cache();
        flush();
        if ($error_abort) {
            break;
        }
    }
}
$time_end = explode(' ', microtime());
$time_diff = $time_end[0] + $time_end[1] - $time_start[0] - $time_start[1];
if (PHP_SAPI != 'cli') {
    ?>
</li>
开发者ID:emildev35,项目名称:processmaker,代码行数:31,代码来源:langcheck.php

示例9: array

                    bugdb.id = r.id AND
                    r.roadmap_id = ? AND
                    bugdb.bug_type = "Feature/Change Request" AND
                    bugdb.status = "Closed"', array($allroadmaps->id));
        }
    }
    $savant->roadmap[] = $allroadmaps->toArray();
}
usort($savant->roadmap, 'sort_roadmaps');
$savant->package = $_GET['package'];
if (isset($_GET['edit'])) {
    $bugdb = Bug_DataObject::bugDB('bugdb_roadmap');
    $bugdb->id = $_GET['edit'];
    if (!$bugdb->find(true)) {
        response_header('Error :: no such roadmap');
        report_error('Unknown roadmap "' . clean($_GET['edit']));
        response_footer();
        exit;
    }
    $savant->info = $bugdb->toArray();
    $savant->isnew = false;
    $savant->errors = false;
    $savant->display('roadmapform.php');
    exit;
}
if (isset($_GET['new'])) {
    $savant->errors = false;
    if (isset($_POST['go'])) {
        if ($_POST['releasedate'] == 'future') {
            // my birthday will represent the future ;)
            $_POST['releasedate'] = '1976-09-02 17:15:30';
开发者ID:stof,项目名称:pearweb,代码行数:31,代码来源:roadmap.php

示例10: report_error

     report_error('Invalid token.');
     response_footer();
     exit;
 }
 // Got a new maintainer?
 if (isset($_POST['handle']['new']) && !empty($_POST['handle']['new'])) {
     $new = strip_tags($_POST['handle']['new']);
     include_once 'pear-database-user.php';
     if (!ereg('^[0-9a-z_]{2,20}$', $new)) {
         report_error('Invalid handle: ' . $new);
     } elseif (!user::exists($new)) {
         report_error($new . ' does not exist.');
     } else {
         $role = $_POST['role']['new'];
         if (!maintainer::isValidRole($role)) {
             report_error('Invalid role.');
         } else {
             if (maintainer::add($pid, $new, $role)) {
                 $message = 'Maintainer ' . $new . 'sucessfully added.';
                 $maintainers[$new] = array('role' => $role, 'active' => 1);
             }
         }
     }
 } else {
     $new = '';
 }
 // Role, active, and marked for removal
 $roles = $_POST['role'];
 if (isset($_POST['active'])) {
     $active = $_POST['active'];
 } else {
开发者ID:stof,项目名称:pearweb,代码行数:31,代码来源:package-maintainers.php

示例11: get_id

 function get_id($item_id)
 {
     $item = $this->get('items', array('id' => $item_id));
     if ($item->num_rows()) {
         $i = $item->row();
         $el = $this->get($i->type . 's', array('item_id' => $item_id));
         if ($el->num_rows()) {
             return $el->row()->id;
         } else {
             report_error('Not a valid element: ' . $i->type);
         }
     } else {
         report_error("No Item");
     }
 }
开发者ID:beexsvn,项目名称:Beex.org,代码行数:15,代码来源:mitems.php

示例12: array

        if ($request->find($salt) && $request->pending()) {
            $email = $request->email;
            $user = $name = '';
            $errors = array();
            include PEARWEB_TEMPLATEDIR . '/bugs/registernewaccount.php';
            response_footer();
            exit;
        } else {
            report_error('Unknown salt');
        }
    } else {
        report_error('Unknown salt');
    }
} else {
    echo '<h1>Confirm Account</h1>';
    if (empty($stripped['salt']) || strlen($salt = htmlspecialchars($stripped['salt'])) != 32) {
        report_error('Unknown salt');
    } else {
        $request = new PEAR_Election_Accountrequest();
        $result = $request->confirmRequest($salt);
        if (PEAR::isError($result)) {
            report_error($result->getMessage());
        } elseif ($result) {
            report_success('Your account has been activated, you can now vote in
        PEAR elections that are for the general PHP public as well as open bugs in the bug tracker');
        } else {
            report_error('There was a problem activating your account, please contact ' . PEAR_WEBMASTER_EMAIL);
        }
    }
}
response_footer();
开发者ID:stof,项目名称:pearweb,代码行数:31,代码来源:account-request-confirm.php

示例13: error_handler

/**
 * Generates a complete PEAR web page with an error message in it then
 * calls exit
 *
 * For use with PEAR_ERROR_CALLBACK error handling mode to print fatal
 * errors and die.
 *
 * @param string|array|PEAR_Error $in  see report_error() for more info
 * @param string $title  string to be put above the message
 *
 * @return void
 *
 * @see report_error()
 */
function error_handler($errobj, $title = 'Error')
{
    response_header($title);
    report_error($errobj);
    response_footer();
    error_log('pearweb errorhandler: ' . get_detail_error_msg($errobj), 0);
    exit;
}
开发者ID:stof,项目名称:pearweb,代码行数:22,代码来源:pear-format-html.php

示例14: response_header

 * @category  pearweb
 * @package   PEPr
 * @author    Tobias Schlitt <toby@php.net>
 * @author    Daniel Convissor <danielc@php.net>
 * @copyright Copyright (c) 1997-2005 The PHP Group
 * @license   http://www.php.net/license/3_0.txt  PHP License
 * @version   $Id$
 */
/**
 * Obtain the common functions and classes.
 */
require_once 'pepr/pepr.php';
if (!($proposal = proposal::get($dbh, (int) @$_GET['id']))) {
    response_header('PEPr :: Comments :: Invalid Request');
    echo "<h1>Comments for</h1>\n";
    report_error('The requested proposal does not exist.');
    response_footer();
    exit;
}
$id = $proposal->id;
response_header('PEPr :: Comments :: ' . htmlspecialchars($proposal->pkg_name));
echo '<h1>Comments for &quot;' . htmlspecialchars($proposal->pkg_name) . "&quot;</h1>\n";
display_pepr_nav($proposal);
if ($auth_user && $proposal->getStatus() == 'proposal') {
    include_once 'HTML/QuickForm2.php';
    $form = new HTML_QuickForm2('comment', 'post', array('action' => 'pepr-comments-show.php?id=' . $id));
    $form->removeAttribute('name');
    $c = $form->addElement('textarea', 'comment', array('cols' => 70, 'rows' => 20, 'required' => 'required', 'placeholder' => 'Hi. Can I politely suggest that...', 'id' => 'comment_field'))->setLabel('Comments:');
    $form->addElement('submit', 'submit');
    $c->addFilter('trim');
    $c->addRule('required', 'A comment is required');
开发者ID:stof,项目名称:pearweb,代码行数:31,代码来源:pepr-comments-show.php

示例15: PDO

<?php

try {
    $pdo = new PDO("mysql:dbname=test;host=localhost", "dbuser", "dbpassword");
} catch (PDOException $e) {
    //(1)
    report_error($e->getMessage());
    return;
}
$sql = "SELECT bug_id, summary, date_reported FROM Bugs\n    WHERE assigned_to = ? AND status = ?";
if (($stmt = $pdo->prepare($sql)) === false) {
    //(2)
    $error = $pdo->errorInfo();
    report_error($error[2]);
    return;
}
if ($stmt->execute(array(1, "OPEN")) === false) {
    //(3)
    $error = $stmt->errorInfo();
    report_error($error[2]);
    return;
}
if (($bug = $stmt->fetch()) === false) {
    //(4)
    $error = $stmt->errorInfo();
    report_error($error[2]);
    return;
}
开发者ID:rgamado,项目名称:book_code,代码行数:28,代码来源:check.php


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