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


PHP Error::get方法代码示例

本文整理汇总了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;
 }
开发者ID:sonaljain888,项目名称:project-legal-lawyer-,代码行数:28,代码来源:class.Company.php

示例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;
     }
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:12,代码来源:ErrorControl.php

示例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');
 }
开发者ID:helpfulrobot,项目名称:silverstripe-devtools,代码行数:13,代码来源:DevErrorLogsController.php

示例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();
 }
开发者ID:helpfulrobot,项目名称:silverstripe-devtools,代码行数:38,代码来源:DataObjectErrorWriter.php

示例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(); ?>
开发者ID:ritthai,项目名称:LMS,代码行数:31,代码来源:index.view.php

示例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;
                 }
             }
         }
     }
 }
开发者ID:sonaljain888,项目名称:project-legal-lawyer-,代码行数:27,代码来源:class.User.php


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