<commit_before><?php

namespace CodeDay\Http\Controllers;

use CodeDay\Models;

class EventController extends Controller
{
    public function __construct()
    {
        $visitor_info = Models\Ip::find(\Request::getClientIp());

        if (!\Route::input('event')) {
            \App::abort(404);
        }

        \View::share('event', \Route::input('event'));
        \View::share('visitor', $visitor_info);
        \View::share('loaded_batch', Models\Batch::current());
    }

    public function getIndex()
    {
        return \View::make('event', [
            'is_mobile' => preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER['HTTP_USER_AGENT']),
        ]);
    }

    public function getPast()
    {
        return redirect()->to(config('showcase.api_base').'/region/'.\Route::input('event')->region_id);
    }

    public function getSchedule()
    {
        return json_encode(\Route::input('event')->schedule);
    }

    public function getSchoolsRegister()
    {
        return \View::make('schools-register');
    }

    public function getIcs()
    {
        return response()->view('event-ics')->header('Content-Type', 'text/plain');
    }

    public function getDisambiguation()
    {
        return \View::make('disambiguation');
    }

    public function getRegister()
    {
        $event = \Route::input('event');
        if (!$event->registration_info['is_open'] || $event->registration_info['remaining'] == 0) {
            return \Redirect::to('/'.$event->webname);
        }

        return \View::make('register');
    }<commit_msg>Redirect past<commit_after><?php

namespace CodeDay\Http\Controllers;

use CodeDay\Models;

class EventController extends Controller
{
    public function __construct()
    {
        $visitor_info = Models\Ip::find(\Request::getClientIp());

        if (!\Route::input('event')) {
            \App::abort(404);
        }

        \View::share('event', \Route::input('event'));
        \View::share('visitor', $visitor_info);
        \View::share('loaded_batch', Models\Batch::current());
    }

    public function getIndex()
    {
        return \View::make('event', [
            'is_mobile' => preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER['HTTP_USER_AGENT']),
        ]);
    }

    public function getPast()
    {
        return redirect()->to(config('showcase.api_base').'region/'.\Route::input('event')->region_id);
    }

    public function getSchedule()
    {
        return json_encode(\Route::input('event')->schedule);
    }

    public function getSchoolsRegister()
    {
        return \View::make('schools-register');
    }

    public function getIcs()
    {
        return response()->view('event-ics')->header('Content-Type', 'text/plain');
    }

    public function getDisambiguation()
    {
        return \View::make('disambiguation');
    }

    public function getRegister()
    {
        $event = \Route::input('event');
        if (!$event->registration_info['is_open'] || $event->registration_info['remaining'] == 0) {
            return \Redirect::to('/'.$event->webname);
        }

        return \View::make('register');
    }
{'fraction_non_alphanumeric': 0.17770452502247527, 'fraction_numerical': 0.00239736290080911, 'mean_word_length': 2.9409681227863045, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '6802030', 'n_tokens_mistral': 1037, 'n_tokens_neox': 994, 'n_words': 141}