In CodeIgniter, How Can I Have PHP Error Messages Emailed to Me?

前端 未结 4 988
忘掉有多难
忘掉有多难 2021-01-31 21:57

I\'d like to receive error logs via email. For example, if a Warning-level error message should occur, I\'d like to get an email about it.

How can I get tha

4条回答
  •  走了就别回头了
    2021-01-31 22:43

    One thing that is left out of the solution is that you have to grab CodeIgniters super object to load and use the email library (or any of CodeIgniters other libraries and native functions).

    $CI =& get_instance();
    

    After you have done that you use $CI instead of $this to load the email library and set all of the parameters. For more information click here and look under the Utilizing CodeIgniter Resources within Your Library section.

提交回复
热议问题