<commit_before><?php

namespace Controllers;

use Knob\Controllers\AjaxController as KnobAjaxController;
use Knob\Libs\Ajax;
use Knob\I18n\I18n;
use Knob\Libs\KeysRequest;
use Knob\Models\Post;
use Knob\Models\Term;
use Knob\Models\Archive;

/**
 * AJAX Controller
 *
 * @author <NAME>
 */
class AjaxController extends KnobAjaxController {

	/**
	 * Listen the home petition
	 *
	 * @param array $_datas
	 * @return array JSON
	 */
	private function jsonShowMore($_datas) {
		$postsWhereKey = $_datas['postsWhereKey'];
		$postsWhereValue = $_datas['postsWhereValue'];
		$limit = $_datas['limit'];
		$offset = $_datas['offset'];

		$getPostsBy = Post::getFuncBy($postsWhereKey);<commit_msg>Remove KnobAjaxController<commit_after><?php

namespace Controllers;

use Knob\Libs\Ajax;
use Knob\I18n\I18n;
use Knob\Libs\KeysRequest;
use Knob\Models\Post;
use Knob\Models\Term;
use Knob\Models\Archive;

// Load WP.
// We have to require this file, in other case we cant call to the WP functions
require_once (APP_DIR . '/../../../../wp-load.php');

/**
 * AJAX Controller
 *
 * @author <NAME>
 */
class AjaxController extends BaseController {

	/**
	 * -------------------------------------
	 * Main Controller for AJAX request
	 * -------------------------------------
	 */
	public function main() {
		$json = [
			'code' => 504
		]; // Error default

		$submit = $_REQUEST['submit'];

		// check if we don't have any submit
		if (!$submit) {
			die('');
		}

		$json = $this->getJsonBySubmit($submit, $_REQUEST);

		// cast the content to UTF-8
		$json['content'] = mb_convert_encoding($json['content'], "UTF-8");
		echo json_encode($json);
	}

	/**
	 * Listen the home petition
	 *
	 * @param array $_datas
	 * @return array JSON
	 */
	private function jsonShowMore($_datas) {
		$postsWhereKey = $_datas['postsWhereKey'];
		$postsWhereValue = $_datas['postsWhereValue'];
		$limit = $_datas['limit'];
		$offset = $_datas['offset'];

		$getPostsBy = Post::getFuncBy($postsWhereKey);
{'fraction_non_alphanumeric': 0.1867408906882591, 'fraction_numerical': 0.006578947368421052, 'mean_word_length': 3.2978260869565217, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3848413', 'n_tokens_mistral': 705, 'n_tokens_neox': 633, 'n_words': 155}