<commit_before><?php

use Elasticsearch\Client;

class BaseController extends Controller {
	
	protected $params = [
		"hosts" => [
			"127.0.0.1:9200",
		],
	];

	public $client;

	public function __construct() {

		// ALL POST/PUT/DELETE REQUIRE CSRF TOKENS.
		$this->beforeFilter('csrf', ['on' => ['post', 'put', 'delete']]);
		$this->client = new Client($this->params);
	}

	protected function getStatus() {
		$status = DB::table('streamstatus')->first();
		$status["dj"] = DB::table("djs")
			->where("id", "=", $status["djid"])
			->first();
		unset($status["djid"]);

		return $status;
	}

	protected function getCurrentSong() {
		return $this->getStatus()["np"];
	}

	/**
	 * Retrieve the current theme's identifier.
	 *
	 * @return string
	 */
	protected function getTheme() {
		// TODO: check database access, DJ column will have theme
		return "default";
	}

	/**
	 * Retrieve a page using the current theme.
	 *
	 * @param string $page
	 * @return string<commit_msg>Change default site theme to "dark" for a bit for feedback<commit_after><?php

use Elasticsearch\Client;

class BaseController extends Controller {
	
	protected $params = [
		"hosts" => [
			"127.0.0.1:9200",
		],
	];

	public $client;

	public function __construct() {

		// ALL POST/PUT/DELETE REQUIRE CSRF TOKENS.
		$this->beforeFilter('csrf', ['on' => ['post', 'put', 'delete']]);
		$this->client = new Client($this->params);
	}

	protected function getStatus() {
		$status = DB::table('streamstatus')->first();
		$status["dj"] = DB::table("djs")
			->where("id", "=", $status["djid"])
			->first();
		unset($status["djid"]);

		return $status;
	}

	protected function getCurrentSong() {
		return $this->getStatus()["np"];
	}

	/**
	 * Retrieve the current theme's identifier.
	 *
	 * @return string
	 */
	protected function getTheme() {
		// TODO: check database access, DJ column will have theme
		return "dark";
	}

	/**
	 * Retrieve a page using the current theme.
	 *
	 * @param string $page
	 * @return string
{'fraction_non_alphanumeric': 0.1813627254509018, 'fraction_numerical': 0.01002004008016032, 'mean_word_length': 3.676814988290398, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3084298', 'n_tokens_mistral': 743, 'n_tokens_neox': 650, 'n_words': 169}