public function __construct($options) { parent::__construct($options); $ci =& get_instance(); $this->_db = $ci->db; if (!$this->_db->table_exists('cache')) { // you'll see this error once when upgrading from non-cache enabled builds log_message('error', 'Cache table does not exist. Disabling cache.'); parent::enabled(false); } }
/** * Check to see if a table exists * * @param mixed $Table * @return ifx_Model */ private final function _table_exists($Table) { if (is_a($Table, 'ifx_Model')) { $Table = $Table->_table(); } //Could use db->list_tables? if (!isset(self::$_existing_tables[$Table])) { self::$_existing_tables[$Table] = $this->db->table_exists($Table); } return self::$_existing_tables[$Table]; }