<commit_before><?php
namespace ProjectRena\Task;

use Cilex\Command\Command;
use ProjectRena\Lib;
use ProjectRena\RenaApp;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * Class UpdateTask
 *
 * @package ProjectRena\Task
 */
class UpdateTask extends Command
{
				/**
				 *
				 */
				protected function configure()
				{
								$this->setName("update")
												->setDescription("Updates the project (Composer and RenaApp)");
				}

				/**
				 * @param InputInterface $input
				 * @param OutputInterface $output
				 *
				 * @return int|null|void
				 */
				protected function execute(InputInterface $input, OutputInterface $output)
				{
								$app = RenaApp::getInstance();
								// Check if composer is in the dir
								if(!file_exists(__DIR__ . "/../../composer.phar"))
								{
												$output->writeln("Composer doesn't exist, downloading it");
												$composer = $app->cURL->getData("https://getcomposer.org/composer.phar", 0);
												file_put_contents(__DIR__ . "/../../composer.phar", $composer);
								}
								$output->writeln("Updating composer");
								exec("php " . __DIR__ . "/../../composer.phar update -o");

								// Check if phpunit.phar is in the dir
								if(!file_exists(__DIR__ . "/../../phpunit.phar"))
								{
												$output->writeln("PHPUnit doesn't exist, downloading it");
												$composer = $app->cURL->getData("https://phar.phpunit.de/phpunit.phar", 0);
												file_put_contents(__DIR__ . "/../../phpunit.phar", $composer);
								}
								$output->writeln("Running unit tests");
								var_dump(exec("php " . __DIR__ . "/../../phpunit.phar --bootstrap=" . __DIR__ . "/../../tests/init.php " . __DIR__ . "/../../tests/*"));<commit_msg>Update the updater, altho now the paths are hardcoded.. oops<commit_after><?php
namespace ProjectRena\Task;

use Cilex\Command\Command;
use ProjectRena\Lib;
use ProjectRena\RenaApp;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * Class UpdateTask
 *
 * @package ProjectRena\Task
 */
class UpdateTask extends Command
{
				/**
				 *
				 */
				protected function configure()
				{
								$this->setName("update")
												->setDescription("Updates the project (Composer and RenaApp)");
				}

				/**
				 * @param InputInterface $input
				 * @param OutputInterface $output
				 *
				 * @return int|null|void
				 */
				protected function execute(InputInterface $input, OutputInterface $output)
				{
								$app = RenaApp::getInstance();
								// Check if composer is in the dir
								if(!file_exists(__DIR__ . "/../../composer.phar"))
								{
												$output->writeln("Composer doesn't exist, downloading it");
												$composer = $app->cURL->getData("https://getcomposer.org/composer.phar", 0);
												file_put_contents(__DIR__ . "/../../composer.phar", $composer);
								}
								$output->writeln("Updating composer");
								exec("php " . __DIR__ . "/../../composer.phar update -o");

								// Check if phpunit.phar is in the dir
								if(!file_exists(__DIR__ . "/../../phpunit.phar"))
								{
												$output->writeln("PHPUnit doesn't exist, downloading it");
												$composer = $app->cURL->getData("https://phar.phpunit.de/phpunit.phar", 0);
												file_put_contents(__DIR__ . "/../../phpunit.phar", $composer);
								}
								$output->writeln("Running unit tests");
								exec("php " . __DIR__ . "/../../phpunit.phar --coverage-html=/storage/www/projectRenaDocs/tests/ --bootstrap=" . __DIR__ . "/../../tests/init.php " . __DIR__ . "/../../tests/*");
								chdir("/storage/www/projectRenaDocs/");
								exec("git add *");
								exec("git commit -m 'Update tests'");
								exec("git push");
{'fraction_non_alphanumeric': 0.16910994764397905, 'fraction_numerical': 0.0010471204188481676, 'mean_word_length': 2.3312990409764605, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '626574', 'n_tokens_mistral': 1611, 'n_tokens_neox': 1138, 'n_words': 229}