<commit_before><?php
App::uses('AppController', 'Controller');
App::import('Plugin/WebSocket/Lib/Network/Http', 'WebSocket', array('file'=>'WebSocket.php'));
$websocket = new WebSocket(array('port' => 8080, 'scheme'=>'ws'));
/**
 * Events Controller
 *
 * @property Event $Event
 * @property PaginatorComponent $Paginator
 */
class EventsController extends AppController {

	
/**
 * Components
 *
 * @var array
 */
	public $components = array('Paginator');

/**
 * index method
 *
 * @return void
 */
	public function index() {
		$this->Event->recursive = 0;
		$now = date('Y-m-d H:i:s', time());
		$previousDay = date('Y-m-d H:i:s', strtotime('-1 day', time()));
		$this->Paginator->settings = array('conditions' => 
			array('Event.scheduled_date BETWEEN ? AND ?' => array($previousDay, $now)),
			'limit' => '2');
		$this->set('events', $this->Paginator->paginate());
	}

/**
 * view method
 *
 * @throws NotFoundException
 * @param string $id
 * @return void
 */
	public function view($id = null) {
		if (!$this->Event->exists($id)) {
			throw new NotFoundException(__('Invalid event'));
		}
		$options = array('conditions' => array('Event.' . $this->Event->primaryKey => $id));
		$this->set('event', $this->Event->find('first', $options));
	}

/**
 * add method
 *
 * @return void
 */
	public function add() {
		if ($this->request->is('post')) {
			$this->Event->create();
			if ($this->Event->save($this->request->data)) {
				$this->Session->setFlash(__('The event has been saved.'));
				return $this->redirect(array('action' => 'index'));<commit_msg>Updated the SQL query to match the one in server.js<commit_after><?php
App::uses('AppController', 'Controller');
App::import('Plugin/WebSocket/Lib/Network/Http', 'WebSocket', array('file'=>'WebSocket.php'));
$websocket = new WebSocket(array('port' => 8080, 'scheme'=>'ws'));
/**
 * Events Controller
 *
 * @property Event $Event
 * @property PaginatorComponent $Paginator
 */
class EventsController extends AppController {

	
/**
 * Components
 *
 * @var array
 */
	public $components = array('Paginator');

/**
 * index method
 *
 * @return void
 */
	public function index() {
		$this->Event->recursive = 0;
		$now = date('Y-m-d H:i:s', time());
		$previousDay = date('Y-m-d H:i:s', strtotime('-1 day', time()));
		$this->Paginator->settings = array('conditions' => 
			array('Event.scheduled_date BETWEEN ? AND ?' => 
				array('DATE_SUB(CURDATE(), INTERVAL 1 DAY)', 'NOW()')),
			'limit' => '2',
			'order' => array('Event.id ASC'));
		$this->set('events', $this->Paginator->paginate());
	}

/**
 * view method
 *
 * @throws NotFoundException
 * @param string $id
 * @return void
 */
	public function view($id = null) {
		if (!$this->Event->exists($id)) {
			throw new NotFoundException(__('Invalid event'));
		}
		$options = array('conditions' => array('Event.' . $this->Event->primaryKey => $id));
		$this->set('event', $this->Event->find('first', $options));
	}

/**
 * add method
 *
 * @return void
 */
	public function add() {
		if ($this->request->is('post')) {
			$this->Event->create();
			if ($this->Event->save($this->request->data)) {
				$this->Session->setFlash(__('The event has been saved.'));
				return $this->redirect(array('action' => 'index'));
{'fraction_non_alphanumeric': 0.22194668319900807, 'fraction_numerical': 0.0046497210167389955, 'mean_word_length': 4.333884297520661, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 72, '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': '5654910', 'n_tokens_mistral': 1131, 'n_tokens_neox': 1062, 'n_words': 226}