<commit_before><?php
    require_once 'lib/Devtools/Log.php';

    class Hook {
        private $log;
        private $testCount;
        private $repository;
        private $docRoot;
        private $payload;
        private $config;
        public $output;

        public function __construct($options)
        {
            $this->_config($options);

            $this->log = new \Devtools\Log($this->config['file']);

            if($this->checkIP() && $this->getPayload())
            {
                $this->repository = $this->payload->repository->name;
                $this->docRoot = $this->config['docroot'].escapeshellcmd($this->repository);

                $pathExists = is_dir($this->docRoot);
                $this->log->file('is_dir('.$this->docRoot.')', $pathExists);

                if($pathExists) {
                    $this->updateRepo();
                }
            }
        }

        private function _config($options)
        {
            $defaults = [
                'docroot'=>'/var/www/',
                'file'=>'Hook.log'
            ];

            foreach($options as $option=>$value) {
                if(array_key_exists($option, $defaults))
                    $defaults[$option]=$value;
                else
                    $this->log->file($option." is not a valid option for ".__CLASS__);
            }

            $this->config = $defaults;
   <commit_msg>Changes default log file to hook.log<commit_after><?php
    require_once 'lib/Devtools/Log.php';

    class Hook {
        private $log;
        private $testCount;
        private $repository;
        private $docRoot;
        private $payload;
        private $config;
        public $output;

        public function __construct($options)
        {
            $this->_config($options);

            $this->log = new \Devtools\Log($this->config['file']);

            if($this->checkIP() && $this->getPayload())
            {
                $this->repository = $this->payload->repository->name;
                $this->docRoot = $this->config['docroot'].escapeshellcmd($this->repository);

                $pathExists = is_dir($this->docRoot);
                $this->log->file('is_dir('.$this->docRoot.')', $pathExists);

                if($pathExists) {
                    $this->updateRepo();
                }
            }
        }

        private function _config($options)
        {
            $defaults = [
                'docroot'=>'/var/www/',
                'file'=>'hook.log'
            ];

            foreach($options as $option=>$value) {
                if(array_key_exists($option, $defaults))
                    $defaults[$option]=$value;
                else
                    $this->log->file($option." is not a valid option for ".__CLASS__);
            }

            $this->config = $defaults;
   
{'fraction_non_alphanumeric': 0.14667604642982765, 'fraction_numerical': 0.0, 'mean_word_length': 1.4795117698343505, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4830929', 'n_tokens_mistral': 770, 'n_tokens_neox': 729, 'n_words': 127}