本文整理汇总了PHP中displayError函数的典型用法代码示例。如果您正苦于以下问题:PHP displayError函数的具体用法?PHP displayError怎么用?PHP displayError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了displayError函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: perform
function perform()
{
WorkbenchContext::get()->getApexConnection()->setDebugLevels($this->logCategory, $this->logCategoryLevel);
$executeAnonymousResultWithDebugLog = WorkbenchContext::get()->getApexConnection()->executeAnonymous($this->executeAnonymousBlock);
ob_start();
if ($executeAnonymousResultWithDebugLog->executeAnonymousResult->success) {
if (isset($executeAnonymousResultWithDebugLog->debugLog) && $executeAnonymousResultWithDebugLog->debugLog != "") {
print "<pre>" . addLinksToIds(htmlspecialchars($executeAnonymousResultWithDebugLog->debugLog, ENT_QUOTES)) . '</pre>';
} else {
displayInfo("Execution was successful, but returned no results. Confirm log category and level.");
}
} else {
$error = null;
if (isset($executeAnonymousResultWithDebugLog->executeAnonymousResult->compileProblem)) {
$error .= "COMPILE ERROR: " . $executeAnonymousResultWithDebugLog->executeAnonymousResult->compileProblem;
}
if (isset($executeAnonymousResultWithDebugLog->executeAnonymousResult->exceptionMessage)) {
$error .= "\nEXCEPTION: " . $executeAnonymousResultWithDebugLog->executeAnonymousResult->exceptionMessage;
}
if (isset($executeAnonymousResultWithDebugLog->executeAnonymousResult->exceptionStackTrace)) {
$error .= "\nSTACKTRACE: " . $executeAnonymousResultWithDebugLog->executeAnonymousResult->exceptionStackTrace;
}
if (isset($executeAnonymousResultWithDebugLog->executeAnonymousResult->line)) {
$error .= "\nLINE: " . $executeAnonymousResultWithDebugLog->executeAnonymousResult->line;
}
if (isset($executeAnonymousResultWithDebugLog->executeAnonymousResult->column)) {
$error .= " COLUMN: " . $executeAnonymousResultWithDebugLog->executeAnonymousResult->column;
}
displayError($error);
print '<pre style="color: red;">' . addLinksToIds(htmlspecialchars($executeAnonymousResultWithDebugLog->debugLog, ENT_QUOTES)) . '</pre>';
}
$result = ob_get_contents();
ob_end_clean();
return $result;
}
示例2: run
function run()
{
$openid = getOpenIDURL();
$consumer = getConsumer();
// Begin the OpenID authentication process.
$auth_request = $consumer->begin($openid);
// No auth request means we can't begin OpenID.
if (!$auth_request) {
displayError("Authentication error; not a valid OpenID.");
}
$sreg_request = Auth_OpenID_SRegRequest::build(array('nickname'), array('fullname', 'email'));
if ($sreg_request) {
$auth_request->addExtension($sreg_request);
}
// Create attribute request object
// See http://code.google.com/apis/accounts/docs/OpenID.html#Parameters for parameters
// Usage: make($type_uri, $count=1, $required=false, $alias=null)
$attribute[] = Auth_OpenID_AX_AttrInfo::make('http://axschema.org/contact/email', 2, 1, 'email');
$attribute[] = Auth_OpenID_AX_AttrInfo::make('http://axschema.org/namePerson/first', 1, 1, 'firstname');
$attribute[] = Auth_OpenID_AX_AttrInfo::make('http://axschema.org/namePerson/last', 1, 1, 'lastname');
// Create AX fetch request
$ax = new Auth_OpenID_AX_FetchRequest();
// Add attributes to AX fetch request
foreach ($attribute as $attr) {
$ax->add($attr);
}
$auth_request->addExtension($ax);
$policy_uris = $_GET['policies'];
$pape_request = new Auth_OpenID_PAPE_Request($policy_uris);
if ($pape_request) {
$auth_request->addExtension($pape_request);
}
// Redirect the user to the OpenID server for authentication.
// Store the token for this authentication so we can verify the
// response.
// For OpenID 1, send a redirect. For OpenID 2, use a Javascript
// form to send a POST request to the server.
if ($auth_request->shouldSendRedirect()) {
$redirect_url = $auth_request->redirectURL(getTrustRoot(), getReturnTo());
// If the redirect URL can't be built, display an error
// message.
if (Auth_OpenID::isFailure($redirect_url)) {
displayError("Could not redirect to server: " . $redirect_url->message);
} else {
// Send redirect.
header("Location: " . $redirect_url);
}
} else {
// Generate form markup and render it.
$form_id = 'openid_message';
$form_html = $auth_request->htmlMarkup(getTrustRoot(), getReturnTo(), false, array('id' => $form_id));
// Display an error if the form markup couldn't be generated;
// otherwise, render the HTML.
if (Auth_OpenID::isFailure($form_html)) {
displayError("Could not redirect to server: " . $form_html->message);
} else {
print $form_html;
}
}
}
示例3: modulAusgeben
function modulAusgeben($modul, $design, $naechstePosition)
{
global $flipDot;
$smarty = new Smarty();
$templateDir = "./designs/" . $design . "/";
$smarty->setTemplateDir($templateDir);
$smarty->assign("modulName", $modul->getName());
$smarty->assign("naechstePosition", -1);
if ($modul->getTemplateVar("fontZoom") != 100) {
$zoom = "&fontZoom=" . $modul->getTemplateVar("fontZoom");
} else {
$zoom = "";
}
$smarty->assign("url", $_SERVER["PHP_SELF"] . "?modul=" . $modul->getName() . $zoom);
foreach ($modul->getTemplateVars() as $key => $var) {
$smarty->assign($key, $var);
}
if ($flipDot) {
echo $modul->getFlipDotOutput();
} else {
try {
$smarty->display(strtolower($modul->getName()) . ".tpl");
} catch (Exception $e) {
displayError($e, $modul, $templateDir);
}
}
}
示例4: run_default
public function run_default()
{
global $geo_cities, $geo_countries;
$formData = $_REQUEST["formData"];
$formData["country_id"] = (int) $formData["country_id"];
$formData["city_id"] = (int) $formData["city_id"];
$Q = new UsersExec();
$Q->limit = $this->app->getCONFIG("users_ipp");
$Q->start = (int) $_REQUEST["start"];
if ($formData["sex"]) {
$Q->where("sex", $formData["sex"]);
}
if ($formData["country_id"]) {
$Q->where("country_id", $formData["country_id"]);
}
if ($formData["city_id"]) {
$Q->where("city_id", $formData["city_id"]);
}
if ($formData["age_from"]) {
$Q->where("age_from", $formData["age_from"]);
}
if ($formData["age_to"]) {
$Q->where("age_to", $formData["age_to"]);
}
if ($formData["sex"] || $formData["country_id"] || $formData["city_id"] || $formData["age_from"] || $formData["age_to"]) {
$title .= "<!--[Sex_familiar_" . (int) $formData["sex"] . "]--> ";
if ($formData["city_id"]) {
$title .= "<!--[in]--> " . ($geo_cities[$formData["city_id"]]["name2"] ? $geo_cities[$formData["city_id"]]["name2"] : $geo_cities[$formData["city_id"]]["name"]) . " ";
} elseif ($formData["country_id"]) {
$title .= "<!--[in]--> " . $geo_countries[$formData["country_id"]]["name2"] . " ";
}
if ($formData["age_from"]) {
$title .= "<!--[s]--> " . $formData["age_from"];
}
if ($formData["age_to"]) {
$title .= "<!--[do]--> " . $formData["age_to"];
}
if ($formData["age_from"] || $formData["age_to"]) {
$title .= " <!--[let]--> ";
}
}
$link_ar = array();
$link_ar["CID"] = "main";
$link_ar["formData[sex]"] = $formData["sex"];
$link_ar["formData[country_id]"] = $formData["country_id"];
$link_ar["formData[city_id]"] = $formDat["city_id"];
$link_ar["formData[age_from]"] = $formData["age_from"];
$link_ar["formData[age_to]"] = $formData["age_to"];
$data = $Q->f();
if ($rws = $data["data"]) {
foreach ($rws as $rw) {
$tmp .= $this->displayUser($rw);
}
} else {
$tmp .= displayError("<!--[People_not_found]-->", 0, 1);
}
$out = "\n\t\t\t<table class='wide'><tr>\n\t\t\t\t<td class='top'>\n\t\t\t\t\t" . ($title ? "<h1>" . $title . "</h1>" : "") . "\n\t\t\t\t\t<div class='mainpage_photos'>" . $tmp . "</div>\n\t\t\t\t\t" . makePages($this->app->makeLink($link_ar), $Q->start, $Q->limit, $data["data_cnt"]) . "\n\t\t\t\t</td>\n\t\t\t\t<td class='top' style='width:230px;'>" . $this->displayFilter() . "</td>\n\t\t\t</tr></table>\n\t\t";
$this->data["title"] = $title;
$this->data["content"] = $out;
}
示例5: displayError
function displayError(Exception $error)
{
echo $error->getMessage() . "\n";
if ($error->getPrevious()) {
echo ' Underlying error: ';
displayError($error->getPrevious());
}
}
示例6: errorHandler
function errorHandler($errno, $errstr, $errfile, $errline)
{
$errortype = array(E_ERROR => "Error", E_WARNING => "Warning", E_PARSE => "Parsing Error", E_NOTICE => "Notice", E_CORE_ERROR => "Core Error", E_CORE_WARNING => "Core Warning", E_COMPILE_ERROR => "Compile Error", E_COMPILE_WARNING => "Compile Warning", E_USER_ERROR => "User Error", E_USER_WARNING => "User Warning", E_USER_NOTICE => "User Notice", E_STRICT => "Runtime Notice");
// if a function etc, where called with an prefix of @ do nothing
if (CONFIG::$DEBUG !== false) {
displayError($errortype[$errno] . ', ' . $errstr, $errfile, $errline);
}
}
示例7: verify_leader
function verify_leader($teamID, $playerID)
{
$p = mysql_query("SELECT * FROM team_members WHERE fk_team='{$teamID}' AND fk_player='{$playerID}'");
$r = mysql_fetch_array($p);
if ($r[level] < 100) {
displayError("You are not the team leader and are not allowed to challenge other teams.", "mainmenu.php");
exit;
}
}
示例8: run
function run()
{
$openid = getOpenIDURL();
$consumer = getConsumer();
$return_to = getReturnTo();
// Begin the OpenID authentication process.
$auth_request = $consumer->begin($openid);
// No auth request means we can't begin OpenID.
if (!$auth_request) {
displayError("Authentication error; not a valid OpenID.");
}
// add AX request
if ($_GET['ax'] == 'true') {
$ax_request = new Auth_OpenID_AX_FetchRequest();
global $ax_data;
foreach ($ax_data as $ax_key => $ax_data_ns) {
// set AX params
if ($_GET['ax_' . $ax_key] == 'true') {
$ax_request->add(new Auth_OpenID_AX_AttrInfo($ax_data_ns, 1, true, $ax_key));
}
}
// add extension
if ($ax_request) {
$auth_request->addExtension($ax_request);
}
}
// add UI extension request
if ($_GET['ui'] == 'true') {
$UI_request = new OpenID_UI_Request();
// set icon
if ($_GET['icon'] == 'true') {
$UI_request->setIcon();
}
// set lang
if ($_GET['lang'] == 'true' && $_GET['pref_lang']) {
$UI_request->setLang($_GET['pref_lang']);
}
// set popup
if ($_GET['popup'] == 'true') {
$UI_request->setPopup();
$return_to .= "popup=true";
}
$auth_request->addExtension($UI_request);
} else {
if ($_GET['callback'] == "ax") {
$return_to .= "callback=ax";
}
}
$redirect_url = $auth_request->redirectURL(getTrustRoot(), $return_to);
if (Auth_OpenID::isFailure($redirect_url)) {
displayError("Could not redirect to server: " . $redirect_url->message);
} else {
// Send redirect.
header("Location: " . $redirect_url);
}
}
示例9: run_overall
public function run_overall()
{
$msg = $this->app->CHDATA[$this->app->CID]["msg"];
$type = $this->app->CHDATA[$this->app->CID]["type"];
if ($type == "signin_required") {
$tmp = "<strong><!--[Error]-->:</strong> " . $msg . "<br /><a href='" . $this->app->makeLink(array("CID" => "profile", "page" => "signin"), null, 1) . "'><!--[Signin]--></a> | <a href='" . $this->app->makeLink(array("CID" => "profile", "page" => "signup"), null, 1) . "'><!--[Signup]--></a>";
} else {
$tmp = "<strong><!--[Error]-->:</strong> " . $msg . "<br /><a href='" . $this->app->makeLink("CID", "main", 1) . "'><!--[Goto_mainpage]--></a>";
}
$this->data["content"] = displayError($tmp, 0, 1);
}
示例10: mysqlQuery
function mysqlQuery($query)
{
try {
$response = $GLOBALS['MYSQL']->query($query);
} catch (Exception $e) {
displayError(array('Query' => $query, 'Exception' => $e->getMessage(), 'Error' => $GLOBALS['MYSQL']->error), true, 'MySQL Exception');
exit;
}
displayError(array('Query' => $query, 'Response' => $response ? 'True' : mysqlError()), true, 'MySQL Query', null, DEBUGGING_MYSQL);
return $response;
}
示例11: multiplyForLoop
function multiplyForLoop($a, $b)
{
if (validateNumbers($a, $b)) {
$sum = 0;
for ($i = 0; $i < $b; $i++) {
$sum = $sum + $a;
}
return $sum;
} else {
return displayError($a, $b, 'multiply');
}
}
示例12: run
function run()
{
$openid = getOpenIDURL();
$consumer = getConsumer();
// Begin the OpenID authentication process.
$auth_request = $consumer->begin($openid);
// No auth request means we can't begin OpenID.
if (!$auth_request) {
displayError("认证错误,不是有效的OpenID。");
}
$sreg_request = Auth_OpenID_SRegRequest::build(array('nickname', 'email'), array('gender'));
//'nickname','fullname', 'email', 'dob','gender','postcode','country','language','timezone'
if ($sreg_request) {
$auth_request->addExtension($sreg_request);
}
/*NOTE:目前还很少有网站要用到PAPE这个功能
$policy_uris = $_GET['policies'];
$pape_request = new Auth_OpenID_PAPE_Request($policy_uris);
if ($pape_request) {
$auth_request->addExtension($pape_request);
}
*/
// Redirect the user to the OpenID server for authentication.
// Store the token for this authentication so we can verify the
// response.
// For OpenID 1, send a redirect. For OpenID 2, use a Javascript
// form to send a POST request to the server.
if ($auth_request->shouldSendRedirect()) {
$redirect_url = $auth_request->redirectURL(getTrustRoot(), getReturnTo());
// If the redirect URL can't be built, display an error
// message.
if (Auth_OpenID::isFailure($redirect_url)) {
displayError("不能跳转到: " . $redirect_url->message);
} else {
// Send redirect.
header("Location: " . $redirect_url);
}
} else {
// Generate form markup and render it.
$form_id = 'openid_message';
$form_html = $auth_request->htmlMarkup(getTrustRoot(), getReturnTo(), false, array('id' => $form_id));
// Display an error if the form markup couldn't be generated;
// otherwise, render the HTML.
if (Auth_OpenID::isFailure($form_html)) {
displayError("不能跳转到: " . $form_html->message);
} else {
print $form_html;
}
}
}
示例13: result
private function result()
{
ob_start();
if ($this->c->errors != null) {
displayError($this->c->errors);
?>
<p/><?php
}
?>
<div style="float: left;">
<?php
if (trim($this->c->instResponse) != "") {
?>
<a href="javascript:ddtreemenu.flatten('responseList', 'expand')">Expand All</a> |
<a href="javascript:ddtreemenu.flatten('responseList', 'contact')">Collapse All</a> |
<a id="codeViewPortToggler" href="javascript:toggleCodeViewPort();">Show Raw Response</a>
<div id="responseListContainer" class="results"></div>
<script type='text/javascript' class='evalable'>convert(<?php
echo $this->c->instResponse;
?>
);</script>
<?php
}
?>
</div>
<?php
if (isset($this->c->rawResponse)) {
?>
<div id="codeViewPortContainer" style="display: <?php
echo trim($this->c->instResponse) != "" ? "none; right:10px;" : "block";
?>
;">
<strong>Raw Response</strong>
<p id="codeViewPort"><?php
echo htmlspecialchars($this->c->rawResponse->header);
?>
<br /><?php
echo htmlspecialchars($this->c->rawResponse->body);
?>
</p>
</div>
<?php
}
$result = ob_get_contents();
ob_end_clean();
return $result;
}
示例14: run
function run()
{
$openid = getOpenIDURL();
$consumer = getConsumer();
// Begin the OpenID authentication process.
$auth_request = $consumer->begin($openid);
// No auth request means we can't begin OpenID.
if (!$auth_request) {
displayError(_CORE_OID_URL_INVALID);
}
$sreg_request = Auth_OpenID_SRegRequest::build(array('nickname', 'email'), array('fullname', 'dob', 'gender', 'postcode', 'country', 'language', 'timezone'));
if ($sreg_request) {
$auth_request->addExtension($sreg_request);
}
$policy_uris = isset($_GET['policies']) ? filter_var($_GET['policies'], FILTER_SANITIZE_URL) : NULL;
$pape_request = new Auth_OpenID_PAPE_Request($policy_uris);
if ($pape_request) {
$auth_request->addExtension($pape_request);
}
// Redirect the user to the OpenID server for authentication.
// Store the token for this authentication so we can verify the
// response.
// For OpenID 1, send a redirect. For OpenID 2, use a Javascript
// form to send a POST request to the server.
if ($auth_request->shouldSendRedirect()) {
$redirect_url = $auth_request->redirectURL(getTrustRoot(), getReturnTo());
// If the redirect URL can't be built, display an error
// message.
if (Auth_OpenID::isFailure($redirect_url)) {
//displayError("Could not redirect to server: " . $redirect_url->message);
} else {
// Send redirect.
header('Location: ' . $redirect_url);
exit;
}
} else {
// Generate form markup and render it.
$form_id = 'openid_message';
$form_html = $auth_request->formMarkup(getTrustRoot(), getReturnTo(), FALSE, array('id' => $form_id));
// Display an error if the form markup couldn't be generated;
// otherwise, render the HTML.
if (Auth_OpenID::isFailure($form_html)) {
displayError(sprintf(_CORE_OID_REDIRECT_FAILED, $form_html->message));
} else {
$page_contents = array("<html><head><title>", _CORE_OID_INPROGRESS, "</title></head>", "<body onload='document.getElementById(\"" . $form_id . "\").submit()'>", $form_html, "</body></html>");
print implode("\n", $page_contents);
}
}
}
示例15: run
function run()
{
$openid = getOpenIDURL();
$consumer = getConsumer();
// Begin the OpenID authentication process.
$auth_request = $consumer->begin($openid);
// No auth request means we can't begin OpenID.
if (!$auth_request) {
displayError("Authentication error; not a valid OpenID.");
}
$sreg_request = Auth_OpenID_SRegRequest::build(array('nickname'), array('fullname', 'email'));
if ($sreg_request) {
$auth_request->addExtension($sreg_request);
}
$policy_uris = $_GET['policies'];
$pape_request = new Auth_OpenID_PAPE_Request($policy_uris);
if ($pape_request) {
$auth_request->addExtension($pape_request);
}
// Redirect the user to the OpenID server for authentication.
// Store the token for this authentication so we can verify the
// response.
// For OpenID 1, send a redirect. For OpenID 2, use a Javascript
// form to send a POST request to the server.
if ($auth_request->shouldSendRedirect()) {
$redirect_url = $auth_request->redirectURL(getTrustRoot(), getReturnTo());
// If the redirect URL can't be built, display an error
// message.
if (Auth_OpenID::isFailure($redirect_url)) {
displayError("Could not redirect to server: " . $redirect_url->message);
} else {
// Send redirect.
header("Location: " . $redirect_url);
}
} else {
// Generate form markup and render it.
$form_id = 'openid_message';
$form_html = $auth_request->formMarkup(getTrustRoot(), getReturnTo(), false, array('id' => $form_id));
// Display an error if the form markup couldn't be generated;
// otherwise, render the HTML.
if (Auth_OpenID::isFailure($form_html)) {
displayError("Could not redirect to server: " . $form_html->message);
} else {
$page_contents = array("<html><head><title>", "OpenID transaction in progress", "</title></head>", "<body onload='document.getElementById(\"" . $form_id . "\").submit()'>", $form_html, "</body></html>");
print implode("\n", $page_contents);
}
}
}