<commit_before><?php

namespace Wpbootstrap;

/**
 * Class Utils
 * @package Wpbootstrap
 *
 * Simple Utilities used from other classes. Assumes that localsettings.json is defined and valid.
 *
 */
class Utils
{
    /**
     * @var bool
     */
    private $wpIncluded = false;

    /**
     * @var \Monolog\Logger
     */
    private $log;

    /**
     * @var Settings
     */
    private $localSettings;

    /**
     * Utils constructor.
     */
    public function __construct()
    {
        $container = Container::getInstance();
        $this->log = $container->getLog();
        $this->localSettings = $container->getLocalSettings();
    }

    /**
     * Executes and logs external commands
     *
     * @param $cmd
     */
    public function exec($cmd)
    {
        $this->log->addDebug("Executing: $cmd");
        exec($cmd);
    }

    /**
     * Returns the wp-cli command with correct path
     *
     * @return string
     */
    public function getWpCommand()
    {
        $wpcmd = 'wp --path='.$this->localSettings->wppath.' --allow-root --quiet ';

        return $wpcmd;
    }
<commit_msg>writing exec output to log (DEBUG) and removed --quite from wpcmd<commit_after><?php

namespace Wpbootstrap;

/**
 * Class Utils
 * @package Wpbootstrap
 *
 * Simple Utilities used from other classes. Assumes that localsettings.json is defined and valid.
 *
 */
class Utils
{
    /**
     * @var bool
     */
    private $wpIncluded = false;

    /**
     * @var \Monolog\Logger
     */
    private $log;

    /**
     * @var Settings
     */
    private $localSettings;

    /**
     * Utils constructor.
     */
    public function __construct()
    {
        $container = Container::getInstance();
        $this->log = $container->getLog();
        $this->localSettings = $container->getLocalSettings();
    }

    /**
     * Executes and logs external commands
     *
     * @param $cmd
     */
    public function exec($cmd)
    {
        $this->log->addDebug("Executing: $cmd");
        $output = [];
        exec($cmd, $output);
        if (count($output) > 0) {
            foreach ($output as $row) {
                $this->log->addDebug("Output: $row");
            }
        }
    }

    /**
     * Returns the wp-cli command with correct path
     *
     * @return string
     */
    public function getWpCommand()
    {

        $wpcmd = 'wp --path='.$this->localSettings->wppath.' --allow-root ';

        return $wpcmd;
    }

{'fraction_non_alphanumeric': 0.1430317848410758, 'fraction_numerical': 0.00040749796251018743, 'mean_word_length': 1.871345029239766, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 22, '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': '1721203', 'n_tokens_mistral': 749, 'n_tokens_neox': 728, 'n_words': 176}