<commit_before><?php
namespace PhpBrew\Command;

use Phar;
use PhpBrew\Config;

class InitCommand extends \CLIFramework\Command
{
    public function brief()
    {
        return 'Initialize phpbrew config file.';
    }

    public function options($opts)
    {
        $opts->add('c|config:', 'The config file which should be used.');
    }

    public function execute()
    {
        // $currentVersion;
        $root = Config::getPhpbrewRoot();
        $home = Config::getPhpbrewHome();
        $buildDir = Config::getBuildDir();
        $buildPrefix = Config::getInstallPrefix();
        // $versionBuildPrefix = Config::getVersionInstallPrefix($version);
        // $versionBinPath     = Config::getVersionBinPath($version);

        if (!file_exists($root)) {
            mkdir($root, 0755, true);
        }

        $paths = array();
        $paths[] = $home;
        $paths[] = $root;
        $paths[] = $buildDir;
        $paths[] = $buildPrefix;
        foreach($paths as $p) {
            $this->logger->info("Checking directory $p");
            if (!file_exists($p)) {
                $this->logger->info("Creating directory $p");
                mkdir($p, 0755, true);
            } else {
                $this->logger->info("Directory $p is already created.");
            }
        }

        $this->logger->info('Creating .metadata_never_index to prevent SpotLight indexing');
        $indexFiles = array(
            $root . DIRECTORY_SEPARATOR . '.metadata_never_index',
            $home . DIRECTORY_SEPARATOR . '.metadata_never_index',
        );
        foreach ($indexFiles as $indexFile) {
            if (!file_exists($indexFile)) {
                touch($indexFile); // prevent spotlight index here
            }
        }<commit_msg>Add {PHPBREW_ROOT}/register to init command<commit_after><?php
namespace PhpBrew\Command;

use Phar;
use PhpBrew\Config;

class InitCommand extends \CLIFramework\Command
{
    public function brief()
    {
        return 'Initialize phpbrew config file.';
    }

    public function options($opts)
    {
        $opts->add('c|config:', 'The config file which should be used.');
    }

    public function execute()
    {
        // $currentVersion;
        $root = Config::getPhpbrewRoot();
        $home = Config::getPhpbrewHome();
        $buildDir = Config::getBuildDir();
        $buildPrefix = Config::getInstallPrefix();
        // $versionBuildPrefix = Config::getVersionInstallPrefix($version);
        // $versionBinPath     = Config::getVersionBinPath($version);

        if (!file_exists($root)) {
            mkdir($root, 0755, true);
        }

        $paths = array();
        $paths[] = $home;
        $paths[] = $root;
        $paths[] = $root . DIRECTORY_SEPARATOR . 'register';
        $paths[] = $buildDir;
        $paths[] = $buildPrefix;
        foreach($paths as $p) {
            $this->logger->info("Checking directory $p");
            if (!file_exists($p)) {
                $this->logger->info("Creating directory $p");
                mkdir($p, 0755, true);
            } else {
                $this->logger->info("Directory $p is already created.");
            }
        }

        $this->logger->info('Creating .metadata_never_index to prevent SpotLight indexing');
        $indexFiles = array(
            $root . DIRECTORY_SEPARATOR . '.metadata_never_index',
            $home . DIRECTORY_SEPARATOR . '.metadata_never_index',
        );
        foreach ($indexFiles as $indexFile) {
            if (!file_exists($indexFile)) {
                touch($indexFile); // prevent spotlight index here
            }
        }
{'fraction_non_alphanumeric': 0.13858921161825727, 'fraction_numerical': 0.004426002766251729, 'mean_word_length': 2.0879590093936806, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '3086690', 'n_tokens_mistral': 1035, 'n_tokens_neox': 993, 'n_words': 220}