<commit_before><?php
include 'src/Database/Adapter.php';
include 'src/Database/Query.php';

$db = Flux_Database_Adapter::factory('MySQL', array('dbname' => 'flux_db', 'username' => 'root', 'password' => '', 'prefix' => 'forum_', 'debug' => true));


// Create a select query and manipulate it a little
$query = $db->select(array('subject' => 't.subject', 'closed' => 't.closed', 'num_replies' => 't.num_replies', 'sticky' => 't.sticky', 'first_post_id' => 't.first_post_id', 'forum_id' => 'f.id AS forum_id', 'forum_name' => 'f.forum_name', 'moderators' => 'f.moderators', 'post_replies' => 'fp.post_replies', 'is_subscribed' => '0 AS is_subscribed'), 'topics AS t');

$query->innerJoin('f', 'forums AS f', 'f.id = t.forum_id');
$query->leftJoin('fp', 'forum_perms AS fp', 'fp.forum_id = f.id AND fp.group_id = :group_id');

$query->where = '(fp.read_forum IS NULL OR fp.read_forum = 1) AND t.id = :tid AND t.moved_to IS NULL';

$params = array(':group_id' => 1, ':tid' => 1);

$query->fields['is_subscribed'] = 's.user_id AS is_subscribed';

$query->leftJoin('s', 'topic_subscriptions AS s', 't.id = s.topic_id AND s.user_id = :user_id');
$params[':user_id'] = 1;<commit_msg>Fix example script.<commit_after><?php
include_once 'src/Database/Adapter.php';
include_once 'src/Database/Query.php';

$db = Flux_Database_Adapter::factory('MySQL', array('dbname' => 'fluxbb__2.0', 'username' => 'root', 'password' => '', 'prefix' => 'forum_'));


// Create a select query and manipulate it a little
$query = $db->select(array('subject' => 't.subject', 'closed' => 't.closed', 'num_replies' => 't.num_replies', 'sticky' => 't.sticky', 'first_post_id' => 't.first_post_id', 'forum_id' => 'f.id AS forum_id', 'forum_name' => 'f.forum_name', 'moderators' => 'f.moderators', 'post_replies' => 'fp.post_replies', 'is_subscribed' => '0 AS is_subscribed'), 'topics AS t');

$query->innerJoin('f', 'forums AS f', 'f.id = t.forum_id');
$query->leftJoin('fp', 'forum_perms AS fp', 'fp.forum_id = f.id AND fp.group_id = :group_id');

$query->where = '(fp.read_forum IS NULL OR fp.read_forum = 1) AND t.id = :tid AND t.moved_to IS NULL';

$params = array(':group_id' => 1, ':tid' => 1);

$query->fields['is_subscribed'] = 's.user_id AS is_subscribed';

$query->leftJoin('s', 'topic_subscriptions AS s', 't.id = s.topic_id AND s.user_id = :user_id');
$params[':user_id'] = 1;
{'fraction_non_alphanumeric': 0.22208067940552018, 'fraction_numerical': 0.005095541401273885, 'mean_word_length': 5.617977528089888, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 48, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '285129', 'n_tokens_mistral': 940, 'n_tokens_neox': 914, 'n_words': 203}