<commit_before><?php


namespace ReferralIngester\Command;
use PhpDruidIngest\ReferralBatchIngester;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * IngestCommand runs ReferralBatchIngester
 *
 * @author <NAME> <<EMAIL>>
 */
class ReferralIngestCommand extends IngestCommand
{

    public function __construct($dbConfig) {
        $this->host = $dbConfig['host'];
        $this->user = $dbConfig['user'];
        $this->pass = $dbConfig['pass'];
        $this->db = $dbConfig['db'];
        parent::__construct();
    }


    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        parent::configure();
        $this
            ->setName('referral-ingest')
            ->setDescription('Run referral ingestion task for the given time window')
            ->setDefinition($this->createDefinition())
            ->setHelp(<<<HELPBLURB
Examples:
Dates:
\t<info>php ingest.php referral-ingest 2008-01-01 2009-01-01</info>
Dates with Time:
\t<info>php ingest.php referral-ingest 2008-01-01T01:30:00 2009-01-01T04:20:00 -v</info>

HELPBLURB
            );
        ;
    }


    protected function ingest($formattedStartTime, $formattedEndTime, InputInterface $input, OutputInterface $output)
    {
        $ingester = new ReferralBatchIngester();
        $ingester->setMySqlCredentials($this->host, $this->user, $this->pass, $this->db);

        try {

            $response = $ingester->ingest( $formattedStartTime, $formattedEndTime );
            var_dump( $response );

        } catch ( \Exception $e ) {
            throw $e;
        }

    }

}<commit_msg>Better involving current response of ingest task<commit_after><?php


namespace ReferralIngester\Command;
use PhpDruidIngest\ReferralBatchIngester;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * IngestCommand runs ReferralBatchIngester
 *
 * @author <NAME> <<EMAIL>>
 */
class ReferralIngestCommand extends IngestCommand
{

    public function __construct($dbConfig) {
        $this->host = $dbConfig['host'];
        $this->user = $dbConfig['user'];
        $this->pass = $dbConfig['pass'];
        $this->db = $dbConfig['db'];
        parent::__construct();
    }


    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        parent::configure();
        $this
            ->setName('referral-ingest')
            ->setDescription('Run referral ingestion task for the given time window')
            ->setDefinition($this->createDefinition())
            ->setHelp(<<<HELPBLURB
Examples:
Dates:
\t<info>php ingest.php referral-ingest 2008-01-01 2009-01-01</info>
Dates with Time:
\t<info>php ingest.php referral-ingest 2008-01-01T01:30:00 2009-01-01T04:20:00 -v</info>

HELPBLURB
            );
        ;
    }


    protected function ingest($formattedStartTime, $formattedEndTime, InputInterface $input, OutputInterface $output)
    {
        $ingester = new ReferralBatchIngester();
        $ingester->setMySqlCredentials($this->host, $this->user, $this->pass, $this->db);

        try {

            $response = $ingester->ingest( $formattedStartTime, $formattedEndTime );

            $output->writeln( $response );

        } catch ( \Exception $e ) {
            throw $e;
        }

    }

}
{'fraction_non_alphanumeric': 0.13845693779904306, 'fraction_numerical': 0.02631578947368421, 'mean_word_length': 2.796821793416572, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 48, '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': '5655067', 'n_tokens_mistral': 1110, 'n_tokens_neox': 1008, 'n_words': 192}