本文整理汇总了PHP中Debugger::error方法的典型用法代码示例。如果您正苦于以下问题:PHP Debugger::error方法的具体用法?PHP Debugger::error怎么用?PHP Debugger::error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Debugger
的用法示例。
在下文中一共展示了Debugger::error方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($number, $error, $query = null)
{
$this->number = $number;
$this->error = $error;
$this->query = $query;
Debugger::error(new Exception((string) $this));
}
示例2: error_handling_dev
public static function error_handling_dev($err_no, $err_str, $err_file, $err_line, $err_context)
{
$exception = new ErrorException($err_str, 0, $err_no, $err_file, $err_line);
Debugger::error($exception);
$ErrorHandler = new ErrorHandler($exception);
$ErrorHandler->ProcessError();
return;
}
示例3: __construct
function __construct()
{
parent::__construct();
$this->url = Config::get('Redirect');
$this->type = Config::get('RedirectType');
// **to disable redirects "touch disable-redirect" in the root of the your trunk directory
// **to enable redirects "unlink disable-redirect" in the root of the your trunk directory
// this only works on devboxes for now, and is a ghetto hack until it can be added as a
// preference that can be switched on and off from an interface.
$this->bypass = Config::get('DocRoot') . "/../disable-redirect";
if (!isset($this->url)) {
Debugger::error(new Exception("Can't redirect! Config::get('Redirect') contains no url."));
}
if (!isset($this->type)) {
$this->type = '301';
}
}
示例4: findRouter
private function findRouter()
{
$host = $_SERVER["HTTP_HOST"];
$parts = explode('.', $host);
if (Config::isMyDevBox()) {
if ($parts[count($parts) - 4] == 'dev') {
$parts = array_slice($parts, 0, count($parts) - 4);
} else {
$parts = array_slice($parts, 0, count($parts) - 3);
}
}
// dbcron.[xxx.]xxx.xxx
if ($parts[0] == 'dbcron') {
array_shift($parts);
}
// dev.xxx.xxx
if ($parts[0] == 'dev') {
array_shift($parts);
}
// www.xxx.xxx
if ($parts[0] == 'www') {
array_shift($parts);
}
// [xxx.]xxx.xxx
$name = ucfirst($parts[0]);
// xxx.xxx.xxx
if (count($parts) > 2) {
$name .= ucfirst($parts[1]);
}
$name .= 'Router';
//strip non-alphanumeric characters
$name = preg_replace("/[^a-zA-Z0-9\\s]/", "", $name);
$this->loadRouter($name);
if (!isset($this->router)) {
Debugger::error(new Exception("Failed to find site router for {$_SERVER['HTTP_HOST']}."));
}
}
示例5: parseCheckboxAnswer
$debugger->listDefinedPostAndGetVars("save.php");
foreach ($questions as $question) {
$answer = null;
// Checkbox is a bit more complicated
if ($question->getType() == "checkbox") {
$answer = parseCheckboxAnswer($question);
} else {
$answer = parseNormalAnswer($question);
}
array_push($answers, $answer);
}
// All answers are now in the answers array. Let's check that user answered
// to all required questions
$notAnsweredRequired = getNotAnsweredRequiredIds($answers);
if (count($notAnsweredRequired) > 0) {
$debugger->error("Et vastannut kaikkiin pakollisiin kysymyksiin", "save.php");
} else {
foreach ($answers as $answer) {
$answer->updateToDatabase();
}
}
header("Location: " . $configurations->webRoot . "admin/showanswers/{$signupId}");
function parseCheckboxAnswer($question)
{
global $userId, $debugger;
// Checkbox's question id is in format 14-0, 14-1, 14-2
$checkboxAnswers = array();
for ($i = 0; $i < count($question->getOptions()); $i++) {
$checkboxFromPost = CommonTools::POST($question->getId() . "-" . $i);
if ($checkboxFromPost != null && $checkboxFromPost != "") {
$debugger->debug("Checkbox value " . $question->getId() . "-" . $i . ": " . $checkboxFromPost, "parseChechboxAnswer");
示例6: User
// Redirect user to confirmation form of the old signup
$user = new User($signupid);
header("Location: " . $configurations->webRoot . "confirm/" . $user->getOldSignupId());
} else {
if ($action == "continueandcancelold") {
$user = new User($signupid);
$user->cancelUnconfirmedSignupAndRefreshSession();
header("Location: " . $configurations->webRoot . "confirm/" . $user->getNewSignupId());
} else {
// Check that signup is open
$newSignupGadget = new SignupGadget($signupid);
$user = null;
if ($newSignupGadget->isOpen()) {
$user = new User($signupid);
} else {
$debugger->error("Ilmoittautuminen ei ole avoinna.", "queue.php");
}
if ($user->getUnconfirmedSignupExists()) {
$debugger->debug("Unconfirmed signup exists", "queue.php");
if ($user->getUnconfirmedSignupIsNotTheSameAsThis()) {
$debugger->debug("Unconfirmed signup exists, but it is not this one", "queue.php");
$signupgadget = new SignupGadget($user->getOldSignupId());
$page->addContent("<p><b>Huom!</b> Olet ilmoittautunut jo ilmomasiinassa <b>" . $signupgadget->getTitle() . "</b>, muttet ole vahvistanut ilmoittautumista. " . "Ennen kuin voit ilmoittautua toiseen ilmomasiinaan sinun pitää vahvistaa tai peruuttaa" . " aikasemmat vahvistamattomat ilmoittautumiset.</p>");
$page->addContent("<p>Valitse mitä haluat tehdä:</p>");
$page->addContent("<p> >> <a href=\"" . $configurations->webRoot . "continueandcancelold/" . $user->getNewSignupId() . "\">Peruuta aiempi vahvistamaton ilmoittautuminen ja " . "siirry eteenpäin</a></p>");
$page->addContent("<p> >> <a href=\"" . $configurations->webRoot . "confirmold/" . $user->getOldSignupId() . "\">Siirry vahvistamaan aiempi ilmoittautuminen</a></p>");
$page->printPage();
} else {
header("Location: " . $configurations->webRoot . "confirm/" . $user->getNewSignupId());
}
} else {
示例7: loadGoogleAnalytics
static function loadGoogleAnalytics($actions)
{
$script = "<script type=\"text/javascript\">\n\nvar _gaq = _gaq || [];\n_gaq.push(['_setAccount', '%__UA__%']);\n_gaq.push(%__ACTIONS__%);\n\n(function() {\n\tvar ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n\tga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n\tvar s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n})();\n\n</script>";
if (isset($actions['_setAccount'])) {
$script = str_replace('%__UA__%', $actions['_setAccount'], $script);
unset($actions['_setAccount']);
$ga_options = array();
foreach ((array) $actions as $index => $action) {
if (is_int($index)) {
if (is_array($action)) {
$ga_options[] = json_encode($action);
} else {
$ga_options[] = "['{$action}']";
}
} else {
if (is_int($action)) {
$ga_options[] = "['{$index}'," . (string) $action . "]";
} elseif (is_bool($action)) {
$ga_options[] = "['{$index}'," . ($action === true ? 'true' : 'false') . "]";
} elseif (is_array($action)) {
$ga_options[] = "['{$index}'," . join(',', $action) . "]";
} else {
$ga_options[] = "['{$index}','{$action}']";
}
}
}
echo str_replace('%__ACTIONS__%', join(',', $ga_options), $script);
} else {
Debugger::error(new Exception("Didn't load google analytics. No UA set."));
}
}
示例8: Configurations
require_once "classes/CommonTools.php";
require_once "classes/User.php";
require_once "classes/SignupGadgetQuestionFormater.php";
/* Implementations of the most critical classes */
$configurations = new Configurations();
$page = new Page(1);
$debugger = new Debugger();
$database = new Database();
/* Variables from outside */
$signupId = $request->getSignupId();
/* The code */
$signupGadget = new SignupGadget($signupId);
$user = new User($signupId);
if ($user->unconfirmedSignupExists) {
if ($user->unconfirmedSignupIsNotTheSameAsThis) {
$debugger->error("Olet ilmoittautunut johonkin toiseen ilmomasiinaan", "confirm.php");
} else {
// Nice! User is signed up to this signup form!
}
} else {
$debugger->error("Et ole vielä ilmoittautunut tai ilmoittautumisesi on vanhentunut. Ilmoittautumisen vahvistaminen epäonnistui.", "confirm.php");
}
$page->addHeader("<script type=\"text/javascript\" src=\"javascript/jquery.js\"></script>");
$page->addHeader("<script type=\"text/javascript\" src=\"javascript/email_validation.js\"></script>");
$page->addContent("<div id=\"signup-position-info-div\">");
$page->addContent("<p id=\"signup-position-info\"><span>Olet sijalla <strong>" . $user->getPosition() . "</strong>. Edessäsi on <strong>" . $user->getUnconfirmedSignupsBefore() . "</strong> vahvistamatonta ilmoittautumista. Ilmoittautumisaikasi oli <strong>" . $user->getReadableSignupTime() . "</strong> ja aikaa ilmoittautumisen vahvistamiseen sinulla on <strong>" . $user->getSignupTimeLeftInMinutes() . "</strong> minuuttia</span></p>");
$page->addContent("</div>");
$page->addContent("<div id=\"questions\">");
$page->addContent("<form id=\"questions-form\" method=\"post\" action=\"" . $configurations->webRoot . "save\">");
$page->addContent("<input type=\"hidden\" name=\"signupid\" value=\"{$signupId}\">");
$page->addContent("<input type=\"hidden\" name=\"userid\" value=\"" . $user->getId() . "\">");