<commit_before><?php

require_once __DIR__ . '/SymfonyRequirements.php';

use Symfony\Component\Process\Process;
use Symfony\Component\Intl\Intl;

/**
 * This class specifies all requirements and optional recommendations that are necessary to run the Oro Application.
 */
class OroRequirements extends SymfonyRequirements
{
    const REQUIRED_PHP_VERSION = '5.4.4';

    public function __construct()
    {
        parent::__construct();

        $jreExists = new Process('java -version');
        $jreExists->run();

        $phpVersion  = phpversion();
        $gdVersion   = defined('GD_VERSION') ? (float) GD_VERSION : null;
        $curlVersion = function_exists('curl_version') ? curl_version() : null;
        $icuVersion  = Intl::getIcuVersion();
        $jreExists   = strpos($jreExists->getErrorOutput(), 'java version') !== false;

        $this->addOroRequirement(
            version_compare($phpVersion, self::REQUIRED_PHP_VERSION, '>='),
            sprintf('PHP version must be at least %s (%s installed)', self::REQUIRED_PHP_VERSION, $phpVersion),
            sprintf('You are running PHP version "<strong>%s</strong>", but Oro needs at least PHP "<strong>%s</strong>" to run.
                Before using Oro, upgrade your PHP installation, preferably to the latest version.',
                $phpVersion, self::REQUIRED_PHP_VERSION),
            sprintf('Install PHP %s or newer (installed version is %s)', self::REQUIRED_PHP_VERSION, $phpVersion)
        );

        $this->addOroRequirement(
            null !== $gdVersion && $gdVersion >= 2.0,
            'GD extension must be at least 2.0',
            'Install and enable the <strong>JSON</strong> extension.'
        );

        $this->addOroRequirement(
            function_exists('mcrypt_encrypt'),<commit_msg>Fix JRE check in installer<commit_after><?php

require_once __DIR__ . '/SymfonyRequirements.php';

use Symfony\Component\Process\ProcessBuilder;
use Symfony\Component\Intl\Intl;

/**
 * This class specifies all requirements and optional recommendations that are necessary to run the Oro Application.
 */
class OroRequirements extends SymfonyRequirements
{
    const REQUIRED_PHP_VERSION = '5.4.4';

    public function __construct()
    {
        parent::__construct();

        $jreExists = new ProcessBuilder(array('java', '-version'));
        $jreExists = $jreExists->getProcess();

        $jreExists->run();
        while ($jreExists->isRunning()) {
            // waiting for process to finish
        }

        $phpVersion  = phpversion();
        $gdVersion   = defined('GD_VERSION') ? (float) GD_VERSION : null;
        $curlVersion = function_exists('curl_version') ? curl_version() : null;
        $icuVersion  = Intl::getIcuVersion();
        $jreExists   = strpos($jreExists->getErrorOutput(), 'java version') !== false;

        $this->addOroRequirement(
            version_compare($phpVersion, self::REQUIRED_PHP_VERSION, '>='),
            sprintf('PHP version must be at least %s (%s installed)', self::REQUIRED_PHP_VERSION, $phpVersion),
            sprintf('You are running PHP version "<strong>%s</strong>", but Oro needs at least PHP "<strong>%s</strong>" to run.
                Before using Oro, upgrade your PHP installation, preferably to the latest version.',
                $phpVersion, self::REQUIRED_PHP_VERSION),
            sprintf('Install PHP %s or newer (installed version is %s)', self::REQUIRED_PHP_VERSION, $phpVersion)
        );

        $this->addOroRequirement(
            null !== $gdVersion && $gdVersion >= 2.0,
            'GD extension must be at least 2.0',
            'Install and enable the <strong>JSON</strong> extension.'
        );

        $this->addOroRequirement(
            function_exists('mcrypt_encrypt'),
{'fraction_non_alphanumeric': 0.12280701754385964, 'fraction_numerical': 0.003721424774056353, 'mean_word_length': 2.9736008447729674, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 31, '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': '5359485', 'n_tokens_mistral': 1059, 'n_tokens_neox': 1042, 'n_words': 276}