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']); }
/** * 通知初始化 * @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'); }