public static function getInstance() { if (!isset(self::$instance)) { $classname = __CLASS__; self::$instance = new $classname(); } return self::$instance; }
public function __construct() { $this->db = iDBConnectionFactory::getInstance(); $this->error = ErrorCodeHandler::getInstance(); $base = TRACE_LOG_ROOT; if (!defined('TRACE_LOG_ROOT') || !is_writable(TRACE_LOG_ROOT)) { $base = '/var/log/'; } $this->dblog = TRACE_LOG_ROOT . '/dbmodel_' . Date("Y") . '.log'; }