observer_mail.php

来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· PHP 代码 · 共 31 行

PHP
31
字号
<?phprequire_once 'Log/observer.php';class Log_observer_mail extends Log_observer{    var $_to = '';    var $_subject = '';    var $_pattern = '';    function Log_observer_mail($priority, $conf)    {        /* Call the base class constructor. */        $this->Log_observer($priority);        /* Configure the observer. */        $this->_to = $conf['to'];        $this->_subject = $conf['subject'];        $this->_pattern = $conf['pattern'];    }    function notify($event)    {        if (preg_match($this->_pattern, $event['message']) != 0) {            mail($this->_to, $this->_subject, $event['message']);        }    }}?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?