<?php
/**
 * 紫斑马软件
 * @author afan
 * @link http://www.zibanma.com
 */
if(ZIBANMA_SYS_LINK != 'zibanma_com'){
	die('access deny');
}
class ZibanmaModel{
	public $_db;
	public $_common;
	public $_page;
	public $_thumb;
	public static $_model;
	
	public function __construct(){
		$this->_db = ZibanmaDatabase::get_instance();
		$this->_common = new ZibanmaCommon();
		$this->_page = ZibanmaPage::get_instance();
		$this->_thumb = new ZibanmaThumbnail();
	}
	
	public static function get_instance(){
		if(!(self::$_model instanceof self)){
			self::$_model = new self();
		}
		return self::$_model;
	}
	
	public function db(){
		if(!$this->_db){
			return ZibanmaDatabase::get_instance();
		}else{
			return $this->_db;
		}
	}
}
?>