本文整理汇总了PHP中Error::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Error::get方法的具体用法?PHP Error::get怎么用?PHP Error::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Error
的用法示例。
在下文中一共展示了Error::get方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addcompany
public function addcompany()
{
$errors = Error::get("error");
if (!count($errors) || $errors == "") {
$db = new Db();
if (Session::read("userid")) {
$user_id = Session::read("userid");
//print_r($user_id); exit();
// $user_id=$db->quote($this->user_id);
$name = $db->quote($this->name);
$email = $db->quote($this->email);
$website = $db->quote($this->website);
$phone = $db->quote($this->phone);
$city = $db->quote($this->city);
$location = $db->quote($this->location);
$specialization = $db->quote($this->specialization);
$description = $db->quote($this->description);
$query = "INSERT INTO " . $this->tableName() . " (user_id,name,city,location,website,email,phone,specialization,description,active) \n VALUES({$user_id},{$name},{$city},{$location},{$website},{$email},{$phone},{$specialization},{$description},1)";
if ($db->query($query)) {
//print_r($query); exit();
if ($db->affectedRows()) {
return true;
}
}
}
}
return false;
}
示例2: success
public function success()
{
if (empty($this->error) && !Error::get(str_ireplace(STATIC_ACCESS, '', __CLASS__))) {
if (!empty($this->success)) {
return $this->success;
} else {
return lang('Success', 'success');
}
} else {
return false;
}
}
示例3: delete
public function delete(SS_HTTPRequest $request)
{
$hash = $_REQUEST['hash'];
$error = Error::get()->filter('Hash', $hash)->first();
if ($error) {
$error->delete();
}
foreach (ErrorOccurance::get()->filter('Hash', $hash) as $errorOccurance) {
/* @var $errorOccurance ErrorOccurance */
$errorOccurance->delete();
}
return $this->redirect('dev/logs');
}
示例4: _write
protected function _write($event)
{
// parse event
$file = $event['message']['errfile'];
$line = $event['message']['errline'];
$message = $event['message']['errstr'];
$data = print_r($event, true);
$stack = '';
foreach ($event['message']['errcontext'] as $stackPart) {
if (isset($stackPart['file']) && isset($stackPart['line'])) {
$stack .= $stackPart['file'] . '#' . $stackPart['line'] . PHP_EOL;
}
}
// error unique-ness
$hash = Error::generateHash($file, $line);
// get/create error
$error = Error::get()->filter('Hash', $hash)->limit(1);
if ($error->exists()) {
$error = $error->first();
$error->write();
} else {
$error = new Error();
$error->Hash = $hash;
$error->write();
}
// create occurance
$errorOccurance = new ErrorOccurance();
$errorOccurance->Hash = $hash;
$errorOccurance->Message = $message;
$errorOccurance->Stack = $stack;
$errorOccurance->File = $file;
$errorOccurance->Line = $line;
$errorOccurance->IP = $_SERVER['REMOTE_ADDR'];
$errorOccurance->RequestMethod = $_SERVER['REQUEST_METHOD'];
$errorOccurance->RequestURI = $_SERVER['REQUEST_URI'];
$errorOccurance->Data = $data;
$errorOccurance->write();
}
示例5: foreach
Given: pagetitle,
pageurl,
course: title,
code,
descr
courses,
searchresults,
actions
*/
?>
<html>
<head>
<title><?php echo $args['pagetitle']; ?></title>
</head>
<body>
<?php if($errors=Error::get()) { ?>
<div style="border: 1px solid #F00; background-color: #fff5f5;">
<ul>
<?php foreach($errors as $error) { ?>
<li><?php echo Error::format_error($error); ?></li>
<?php } ?>
</ul>
</div>
<?php } ?>
<center><img src="<?php echo $HTMLROOT; ?>/images/logo.png" /></center>
<?php $args['actions']['search']->FORM_BEGIN(); ?>
Enter the course code: <input type="text" id="terms" name="terms" value="<?php echo $args['course']['code']; ?>" /><br/>
Tags (comma-delimited): <textarea cols=30 rows=3 id="tags" name="tags" /><?php echo $args['course']['tags']; ?></textarea><br/>
<input type="submit" value="Find resources" />
<?php $args['actions']['search']->FORM_END(); ?>
示例6: editProfile
function editProfile($user_id)
{
$errors = Error::get("error");
if (!count($errors) || $errors == "") {
$db = new Db();
if (Session::read("userid")) {
$user_id = Session::read("userid");
//$user_id= $db->quote($this->user_id);
$name = $db->quote($this->name);
$website = $db->quote($this->website);
//$mobile = $db->quote($this->mobile);
$add = $db->quote($this->add);
$city = $db->quote($this->city);
$location = $db->quote($this->location);
$education = $db->quote($this->education);
$experience = $db->quote($this->experince);
$specialization = $db->quote($this->specialization);
$pra_court = $db->quote($this->practicing_court);
$query = "update user set Name={$name}, Website={$website}, Address={$add},\n City={$city}, Location={$location}, Education={$education}, Experiance={$experience}, Specialization={$specialization},\n PracticingCourt={$pra_court} where UserId={$user_id}";
if ($db->query($query)) {
if ($db->affectedRows()) {
return true;
}
}
}
}
}