예제 #1
0
파일: Hook.class.php 프로젝트: jayxtt999/me
 /**
  * 监听标签的插件
  * @param string $tag 标签名称
  * @param mixed $params 传入参数
  * @return void
  */
 public static function listen($tag, &$params = NULL)
 {
     if (isset(self::$tags[$tag])) {
         if (APP_DEBUG) {
             G($tag . 'Start');
             \System\Core\Error::trace('[ ' . $tag . ' ] --START--', '', 'INFO');
         }
         foreach (self::$tags[$tag] as $name) {
             APP_DEBUG && G($name . '_start');
             $result = self::exec($name, $tag, $params);
             if (APP_DEBUG) {
                 G($name . '_end');
                 \System\Core\Error::trace('Run ' . $name . ' [ RunTime:' . G($name . '_start', $name . '_end', 6) . 's ]', '', 'INFO');
             }
             if (false === $result) {
                 // 如果返回false 则中断插件执行
                 return;
             }
         }
         if (APP_DEBUG) {
             // 记录行为的执行日志
             \System\Core\Error::trace('[ ' . $tag . ' ] --END-- [ RunTime:' . G($tag . 'Start', $tag . 'End', 6) . 's ]', '', 'INFO');
         }
     }
     return;
 }
예제 #2
0
 /**
  * 保存用户信息
  */
 public function saveAction()
 {
     $data = $this->request()->getData();
     $memberForm = new \Member\Login\Form\infoForm();
     $memberForm->start('info');
     $data = checkForm::init($data, $memberForm->_name);
     $member = $this->getMember();
     //生成头像
     try {
         db()->upDate($data, array('id' => $member['id']))->done();
         return $this->link()->success("admin:user:profile", "保存成功");
     } catch (\Exception $e) {
         Error::halt($e->getMessage());
         exit;
     }
 }
예제 #3
0
/**
 * 添加和获取页面Trace记录
 * @param string $value 变量
 * @param string $label 标签
 * @param string $level 日志级别
 * @param boolean $record 是否记录日志
 * @return void|array
 */
function trace($value = '[xtt]', $label = '', $level = 'DEBUG', $record = false)
{
    return \System\Core\Error::trace($value, $label, $level, $record);
}