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


PHP logger::customErrorMsg方法代码示例

本文整理汇总了PHP中logger::customErrorMsg方法的典型用法代码示例。如果您正苦于以下问题:PHP logger::customErrorMsg方法的具体用法?PHP logger::customErrorMsg怎么用?PHP logger::customErrorMsg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在logger的用法示例。


在下文中一共展示了logger::customErrorMsg方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get

 /**
  * Static method get 
  * 
  * @param  array $group
  * @return \helpers\database
  */
 public static function get($group = false)
 {
     // Determining if exists or it's not empty, then use default group defined in config
     $group = !$group ? array('type' => DB_TYPE, 'host' => DB_HOST, 'name' => DB_NAME, 'user' => DB_USER, 'pass' => DB_PASS) : $group;
     // Group information
     $type = $group['type'];
     $host = $group['host'];
     $name = $group['name'];
     $user = $group['user'];
     $pass = $group['pass'];
     // ID for database based on the group information
     $id = "{$type}.{$host}.{$name}.{$user}.{$pass}";
     // Checking if the same
     if (isset(self::$instances[$id])) {
         return self::$instances[$id];
     }
     try {
         // I've run into problem where
         // SET NAMES "UTF8" not working on some hostings.
         // Specifiying charset in DSN fixes the charset problem perfectly!
         $instance = new Database("{$type}:host={$host};dbname={$name};charset=utf8", $user, $pass);
         $instance->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
         // Setting Database into $instances to avoid duplication
         self::$instances[$id] = $instance;
         return $instance;
     } catch (PDOException $e) {
         //in the event of an error record the error to errorlog.html
         Logger::newMessage($e);
         logger::customErrorMsg();
     }
 }
开发者ID:fabioassuncao,项目名称:build-a-blog,代码行数:37,代码来源:database.php

示例2: __construct

 function __construct()
 {
     try {
         parent::__construct(DB_TYPE . ':host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USER, DB_PASS);
         $this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
         $this->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, "SET NAMES 'utf8'");
     } catch (PDOException $e) {
         Logger::newMessage($e);
         logger::customErrorMsg();
     }
 }
开发者ID:Gioxor,项目名称:Login-demo,代码行数:11,代码来源:database.php

示例3: __construct

 function __construct()
 {
     try {
         parent::__construct(DB_TYPE . ':host=' . DB_HOST . ';dbname=' . DB_NAME . ';charset=utf8', DB_USER, DB_PASS);
         $this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
         $this->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
     } catch (PDOException $e) {
         Logger::newMessage($e);
         logger::customErrorMsg();
     }
 }
开发者ID:cescgie,项目名称:garth,代码行数:11,代码来源:database.php


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