<commit_before><?php

namespace Mihaeu\Tarantula\Console;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

use Mihaeu\Tarantula\Crawler;
use Mihaeu\Tarantula\HttpClient;
use Mihaeu\Tarantula\Action\SaveHashedResultAction;
use Mihaeu\Tarantula\Action\MinifyHtmlAction;

class CrawlCommand extends Command
{
    protected function configure()
    {
        $this
            ->setName('crawl')
            ->setDescription('Crawls a website and applies actions for each hit.')
            ->addArgument(
                'url', InputArgument::REQUIRED, 'The starting point for the crawling process.'
            )
            ->addOption(
                'depth', 'd', InputOption::VALUE_OPTIONAL, 'How deep shall we go? (-1 = infinite)', 1
            )
            ->addOption(
                'user', 'u',  InputOption::VALUE_OPTIONAL, 'Username for HTTP basic auth.'
            )
            ->addOption(
                'password', 'p', InputOption::VALUE_OPTIONAL, 'Password for HTTP basic auth.'
            )
            ->addOption(
                'save-hashed', 's', InputOption::VALUE_OPTIONAL, 'Writable directory in which the crawled files are stored.', sys_get_temp_dir()
            )
            ->addOption(
                'minify-html', 'm', InputOption::VALUE_NONE, 'Minify HTML of the crawled results.'
            );<commit_msg>Added mirror option to crawl command.<commit_after><?php

namespace Mihaeu\Tarantula\Console;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

use Mihaeu\Tarantula\Crawler;
use Mihaeu\Tarantula\HttpClient;
use Mihaeu\Tarantula\Action\SaveHashedResultAction;
use Mihaeu\Tarantula\Action\MinifyHtmlAction;

class CrawlCommand extends Command
{
    protected function configure()
    {
        $this
            ->setName('crawl')
            ->setDescription('Crawls a website and applies actions for each hit.')
            ->addArgument(
                'url', InputArgument::REQUIRED, 'The starting point for the crawling process.'
            )
            ->addOption(
                'depth', 'd', InputOption::VALUE_OPTIONAL, 'How deep shall we go? (-1 = infinite)', 1
            )
            ->addOption(
                'user', 'u',  InputOption::VALUE_OPTIONAL, 'Username for HTTP basic auth.'
            )
            ->addOption(
                'password', 'p', InputOption::VALUE_OPTIONAL, 'Password for HTTP basic auth.'
            )
            ->addOption(
                'mirror', null, InputOption::VALUE_OPTIONAL, 'Mirror the crawled files to a local directory.', sys_get_temp_dir()
            )
            ->addOption(
                'save-hashed', 's', InputOption::VALUE_OPTIONAL, 'Save crawled results using hashed filenames.', sys_get_temp_dir()
            )
            ->addOption(
                'minify-html', 'm', InputOption::VALUE_NONE, 'Minify HTML of the crawled results.'
            );
{'fraction_non_alphanumeric': 0.10820668693009118, 'fraction_numerical': 0.0012158054711246201, 'mean_word_length': 2.4642105263157896, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, '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': '7050162', 'n_tokens_mistral': 928, 'n_tokens_neox': 906, 'n_words': 221}