/** * Short Description. (use period) * * Long Description. * * @since 1.0.0 */ public static function activate() { require_once plugin_dir_path(__FILE__) . '/class-smartling-connector-db.php'; $db = new Smartling_Connector_DB(); $db->install(); }
public function prepare_sql() { $table = $this->get_table_name(); $pk = $this->get_primary_key(); $columns = $this->get_schema(); $schema = $this->array_to_sql_columns($columns); $index = $this->get_index(); $charset_collate = $this->get_charset_collate(); $add = ''; if (!empty($pk)) { $add .= "PRIMARY KEY ({$pk})"; } // two spaces! if (!empty($index)) { $add .= ", {$index}"; } $sql = 'CREATE TABLE IF NOT EXISTS ' . $table . ' ( ' . $schema . ' ' . $add . ' ) ' . $charset_collate . ';'; // return $sql; self::$query = $sql; }