Example #1
0
 public static function alarm($config = [])
 {
     $type = isset($config['type']) ? $config['type'] : 'Email';
     $class = (!empty($config['namespace']) ? $config['namespace'] : '\\think\\log\\alarm\\') . ucwords($type);
     unset($config['type']);
     self::$alarm = new $class($config['alarm']);
 }
Example #2
0
 /**
  * 通知初始化
  * @return void
  */
 public static function alarm($config = [])
 {
     $type = isset($config['type']) ? $config['type'] : 'Email';
     $class = (!empty($config['namespace']) ? $config['namespace'] : '\\think\\log\\alarm\\') . ucwords($type);
     unset($config['type']);
     self::$alarm = new $class($config['alarm']);
     // 记录初始化信息
     APP_DEBUG && Log::record('[ CACHE ] ALARM ' . $type . ': ' . var_export($config, true), 'info');
 }