国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
901B

  1. <?php if(!defined('DEDEINC')) exit("Request Error!");
  2. /**
  3. * 模型基类
  4. *
  5. * @version $Id: model.class.php 1 13:46 2010-12-1 tianya $
  6. * @package DedeCMS.Libraries
  7. * @copyright Copyright (c) 2020, DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. class Model
  12. {
  13. var $dsql;
  14. var $db;
  15. function __construct()
  16. {
  17. $this->Model();
  18. }
  19. // 析构函数
  20. function Model()
  21. {
  22. global $dsql;
  23. if ($GLOBALS['cfg_mysql_type'] == 'mysqli')
  24. {
  25. $this->dsql = $this->db = isset($dsql)? $dsql : new DedeSqli(FALSE);
  26. } else {
  27. $this->dsql = $this->db = isset($dsql)? $dsql : new DedeSql(FALSE);
  28. }
  29. }
  30. // 释放资源
  31. function __destruct()
  32. {
  33. $this->dsql->Close(TRUE);
  34. }
  35. }