/** * Creates the migrations table if it does not exist. * @return null */ public function create_migrations_table() { // Make sure migrations have been installed. if (!$this->db_tools->sql_table_exists($this->table_prefix . 'migrations')) { $this->db_tools->sql_create_table($this->table_prefix . 'migrations', array('COLUMNS' => array('migration_name' => array('VCHAR', ''), 'migration_depends_on' => array('TEXT', ''), 'migration_schema_done' => array('BOOL', 0), 'migration_data_done' => array('BOOL', 0), 'migration_data_state' => array('TEXT', ''), 'migration_start_time' => array('TIMESTAMP', 0), 'migration_end_time' => array('TIMESTAMP', 0)), 'PRIMARY_KEY' => 'migration_name')); } }
/** * Returns true if the sphinx table was created * * @return bool true if sphinx table was created */ public function index_created($allow_new_files = true) { $created = false; if ($this->db_tools->sql_table_exists(SPHINX_TABLE)) { $created = true; } return $created; }
/** * Gets the PBWoW config data from the DB, or the cache if it is present */ protected function get_pbwow_config() { if (($this->pbwow_config = $this->cache->get('pbwow_config')) != true) { $this->pbwow_config = array(); if ($this->db_tools->sql_table_exists($this->pbwow_config_table)) { $sql = 'SELECT config_name, config_value FROM ' . $this->pbwow_config_table; $result = $this->db->sql_query($sql); while ($row = $this->db->sql_fetchrow($result)) { $this->pbwow_config[$row['config_name']] = $row['config_value']; } $this->db->sql_freeresult($result); } $this->cache->put('pbwow_config', $this->pbwow_config); } }