<commit_before><?php
/**
 * PHPCI - Continuous Integration for PHP
 *
 * @copyright    Copyright 2014, Block 8 Limited.
 * @license      https://github.com/Block8/PHPCI/blob/master/LICENSE.md
 * @link         https://www.phptesting.org/
 */

namespace PHPCI\Plugin;

use PHPCI;
use PHPCI\Builder;
use PHPCI\Model\Build;
use PHPCI\Helper\Lang;

/**
* Docker Plugin - Provides access to Docker functionality.
* @author       <NAME> <<EMAIL>>
* @package      PHPCI
* @subpackage   Plugins
*/
class Docker implements PHPCI\Plugin
{
    protected $phpci;
    protected $build;

    protected $commands;
    protected $resetModified = false;

    /**
     * Set up the plugin, configure options, etc.
     *
     * $options['directory'] Output Directory. Default: %BUILDPATH%
     * $options['playbook'] Path of playbook file
     * $options['inventory'] Path of inventory file. Defaults to ansible default
     *
     * @param Builder $phpci
     * @param Build $build
     * @param array $options
     * @throws \Exception
     */
    public function __construct(Builder $phpci, Build $build, array $options = array())
    {
        $this->phpci = $phpci;
        $this->build = $build;

        if (array_key_exists('reset_modified', $options)) {
            $this->resetModified = (bool)$options['reset_modified'];
        }
    }

    /**
    * Executes Docker
    */
    public function execute()
    {
        $build = $this->build;
        $path = $this->phpci->buildPath;

        $commit = strtolower($build->getId());

        $dockerLocation = $this->phpci->findBinary('docker');

        if (!$dockerLocation) {
            $this->phpci->logFailure(Lang::get('could_not_find', 'docker'));
            return false;
        }

        if ($this->resetModified) {
            $this->phpci->log('Reseting modified time');
            $this->phpci->executeCommand('find %s | fgrep -v ./.git/ | xargs touch -t 200001010000.00', $path);
        }

        $cmd = $dockerLocation . ' build --pull --rm -t build-%s %s';

        $this->phpci->log('Running docker build');

        $this->phpci->log(sprintf($cmd, $commit, $path));

        return $this->phpci->executeCommand($cmd, $commit, $path);
    }
}
<commit_msg>Wrapped in script to force a PTY on docker build.<commit_after><?php
/**
 * PHPCI - Continuous Integration for PHP
 *
 * @copyright    Copyright 2014, Block 8 Limited.
 * @license      https://github.com/Block8/PHPCI/blob/master/LICENSE.md
 * @link         https://www.phptesting.org/
 */

namespace PHPCI\Plugin;

use PHPCI;
use PHPCI\Builder;
use PHPCI\Model\Build;
use PHPCI\Helper\Lang;

/**
* Docker Plugin - Provides access to Docker functionality.
* @author       <NAME> <<EMAIL>>
* @package      PHPCI
* @subpackage   Plugins
*/
class Docker implements PHPCI\Plugin
{
    protected $phpci;
    protected $build;

    protected $commands;
    protected $resetModified = false;

    /**
     * Set up the plugin, configure options, etc.
     *
     * $options['directory'] Output Directory. Default: %BUILDPATH%
     * $options['playbook'] Path of playbook file
     * $options['inventory'] Path of inventory file. Defaults to ansible default
     *
     * @param Builder $phpci
     * @param Build $build
     * @param array $options
     * @throws \Exception
     */
    public function __construct(Builder $phpci, Build $build, array $options = array())
    {
        $this->phpci = $phpci;
        $this->build = $build;

        if (array_key_exists('reset_modified', $options)) {
            $this->resetModified = (bool)$options['reset_modified'];
        }
    }

    /**
    * Executes Docker
    */
    public function execute()
    {
        $build = $this->build;
        $path = $this->phpci->buildPath;

        $commit = strtolower($build->getId());

        $dockerLocation = $this->phpci->findBinary('docker');

        if (!$dockerLocation) {
            $this->phpci->logFailure(Lang::get('could_not_find', 'docker'));
            return false;
        }

        if ($this->resetModified) {
            $this->phpci->log('Reseting modified time');
            $this->phpci->executeCommand('find %s | fgrep -v ./.git/ | xargs touch -t 200001010000.00', $path);
        }

        $cmd = $dockerLocation . ' build --pull --rm -t build-%s %s';

        $this->phpci->log('Running docker build');

        $this->phpci->log(sprintf($cmd, $commit, $path));

        return $this->phpci->executeCommand(sprintf('script -q -c "%s" /dev/null', $cmd), $commit, $path);
    }
}

{'fraction_non_alphanumeric': 0.15093085106382978, 'fraction_numerical': 0.008865248226950355, 'mean_word_length': 2.482253086419753, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 53, 'https://': 4, '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': '775749', 'n_tokens_mistral': 1429, 'n_tokens_neox': 1356, 'n_words': 334}