<commit_before><?php
require('bootstrap.php');

class ScavengerHandler
{
    /* Request Params
    ToCountry
    MediaContentType0
    ToState
    SmsMessageSid
    NumMedia
    ToCity
    FromZip
    SmsSid
    FromState
    SmsStatus
    FromCity
    Body
    FromCountry
    To
    ToZip
    MessageSid
    AccountSid
    From
    MediaUrl0
    ApiVersion
    */
    var $entityManager = null;
    var $message = null;
    var $globals = array('authGlobals' => array(
                            array("regex" => "/(start)/i", "smsresponse" => "Your adventure is now starting!", "startedresponse" => "You have already started your adventure!", "mmsresponse" => null),
                            array("regex" => "/(time)/i", "smsresponse" => "The time is at hand!")
                            ),
                        'noAuthGlobals' => array(
                            array('regex' => "/.*/", "smsresponse" => "You don't appear the be registered.")
                            )
                     );

    function __construct($incomingMessage, $em)
    {
        $this->message = $incomingMessage;
        $this->entityManager = $em;

        $data = array('from' => $this->message["From"], 'to' => $this->message["To"], 'value' => $this->message["Body"]);
        LogMessage($data, $em);
    }

    public function CreateResponse()
    {
        $response_body = "<Response/>";
        $body = $this->message["Body"];
        $fromPhone = $this->message["From"];

        $user = $this->_findUserByFrom($fromPhone);

        //check to make sure that they are a valid sender
        if (isset($user))
        {
            //Get the clue that that user is on
            $dummy = $this->_findCurrentClueByUser($user);

            $curClue = null;
            if (isset($dummy))
            {
                $curClue = $dummy->getClue();
            }

            if (isset($curClue))
            {
                //Check for global commands then the correct answer

                //Check if they sent a correct Answer
                // $global_result = $this->_checkGlobals($body, true, true, $curClue);
                $responseFound = false;

                if (preg_match("/^clue/i", trim($body)))
                {
                    $responseFound = true;
                    $response_body = $curClue->getValue();
                    var_dump($response_body);
                }
                elseif (preg_match("/^restart/i", trim($body))) {<commit_msg>Oops.  Debug removed.<commit_after><?php
require('bootstrap.php');

class ScavengerHandler
{
    /* Request Params
    ToCountry
    MediaContentType0
    ToState
    SmsMessageSid
    NumMedia
    ToCity
    FromZip
    SmsSid
    FromState
    SmsStatus
    FromCity
    Body
    FromCountry
    To
    ToZip
    MessageSid
    AccountSid
    From
    MediaUrl0
    ApiVersion
    */
    var $entityManager = null;
    var $message = null;
    var $globals = array('authGlobals' => array(
                            array("regex" => "/(start)/i", "smsresponse" => "Your adventure is now starting!", "startedresponse" => "You have already started your adventure!", "mmsresponse" => null),
                            array("regex" => "/(time)/i", "smsresponse" => "The time is at hand!")
                            ),
                        'noAuthGlobals' => array(
                            array('regex' => "/.*/", "smsresponse" => "You don't appear the be registered.")
                            )
                     );

    function __construct($incomingMessage, $em)
    {
        $this->message = $incomingMessage;
        $this->entityManager = $em;

        $data = array('from' => $this->message["From"], 'to' => $this->message["To"], 'value' => $this->message["Body"]);
        LogMessage($data, $em);
    }

    public function CreateResponse()
    {
        $response_body = "<Response/>";
        $body = $this->message["Body"];
        $fromPhone = $this->message["From"];

        $user = $this->_findUserByFrom($fromPhone);

        //check to make sure that they are a valid sender
        if (isset($user))
        {
            //Get the clue that that user is on
            $dummy = $this->_findCurrentClueByUser($user);

            $curClue = null;
            if (isset($dummy))
            {
                $curClue = $dummy->getClue();
            }

            if (isset($curClue))
            {
                //Check for global commands then the correct answer

                //Check if they sent a correct Answer
                // $global_result = $this->_checkGlobals($body, true, true, $curClue);
                $responseFound = false;

                if (preg_match("/^clue/i", trim($body)))
                {
                    $responseFound = true;
                    $response_body = $curClue->getValue();
                }
                elseif (preg_match("/^restart/i", trim($body))) {
{'fraction_non_alphanumeric': 0.1330089213300892, 'fraction_numerical': 0.0008110300081103001, 'mean_word_length': 1.6197557089750398, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 55, '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': '7108397', 'n_tokens_mistral': 1395, 'n_tokens_neox': 1345, 'n_words': 323}