国内流行的内容管理系统(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.

42 lines
964B

  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) 2007 - 2018, DesDev, Inc.
  8. * @copyright Copyright (c) 2020, DedeBIZ.COM
  9. * @license https://www.dedebiz.com/license/v6
  10. * @link https://www.dedebiz.com
  11. */
  12. class Model
  13. {
  14. var $dsql;
  15. var $db;
  16. function __construct()
  17. {
  18. $this->Model();
  19. }
  20. // 析构函数
  21. function Model()
  22. {
  23. global $dsql;
  24. if ($GLOBALS['cfg_mysql_type'] == 'mysqli')
  25. {
  26. $this->dsql = $this->db = isset($dsql)? $dsql : new DedeSqli(FALSE);
  27. } else {
  28. $this->dsql = $this->db = isset($dsql)? $dsql : new DedeSql(FALSE);
  29. }
  30. }
  31. // 释放资源
  32. function __destruct()
  33. {
  34. $this->dsql->Close(TRUE);
  35. }
  36. }