dongxi7704 2017-05-11 17:35
浏览 393

CodeIgniter如何关闭数据库连接?

I'm wondering how CodeIgniter close db connections. In the doc, it says "CodeIgniter intelligently takes care of closing your database connections". But how does CodeIgniter do this? Seems I didn't find the db driver's close method get called in CodeIgniter 3.0.3 source code.

  • 写回答

1条回答 默认 最新

  • douju6850 2017-05-11 18:23
    关注

    Follow the code. If

    $this->db->close() 
    

    is called for an action, first thing you should look is

    DB.php
    

    file with

    CI_DB
    

    class within. There you would see that there is no

    close()
    

    method and you should then make search in

    DB_driver.php
    

    file which holds

    CI_DB_driver
    

    class that is extended class by

    CI_DB
    

    class. And Eureca! method with code is there. :) Of course, all these files are in system directory.

    评论

报告相同问题?

悬赏问题

  • ¥30 vmware exsi重置后的密码
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 UE5#if WITH_EDITOR导致打包的功能不可用
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?
  • ¥15 电磁场的matlab仿真
  • ¥15 mars2d在vue3中的引入问题