Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/dev/1.2' into 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrebenchuk committed May 29, 2014
2 parents 7e4c5ad + 7117e76 commit 574d63f
Show file tree
Hide file tree
Showing 8 changed files with 300 additions and 126 deletions.
33 changes: 32 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
CHANGELOG for 1.2.0
===================
This changelog references the relevant changes (new features, changes and bugs) done in 1.2.0 versions.

* 1.2.0 (2014-05-28)
* Ability to delete Channels
* Workflow view
* Reset of Workflow data
* Line charts in Reports
* Fixed issues with Duplicated emails
* Fixed Issue Use of SQL keywords as extended entity field names
* Fixed Issue Creating one-to-many relationship on custom entity that inverses many-to-one relationship fails
* Fixed Community requests

CHANGELOG for 1.2.0-rc1
===================
This changelog references the relevant changes (new features, changes and bugs) done in 1.2.0 RC1 versions.
Expand All @@ -20,6 +34,24 @@ This changelog references the relevant changes (new features, changes and bugs)
* Fixed broken WSSE authentication
* Fixed Incorrectly calculated totals in grids

CHANGELOG for 1.0.1
===================
This changelog references the relevant changes (new features, changes and bugs) done in 1.0.1 versions.

* 1.0.1 (2014-04-18)
* Issue #3979 – Problems with DB server verification on install
* Issue #3916 – Memory consumption is too high on installation
* Issue #3918 – Problems with installation of packages from console
* Issue #3841 – Very slow installation of packages
* Issue #3916 – Installed application is not working correctly because of knp-menu version
* Issue #3839 – Cache regeneration is too slow
* Issue #3525 – Broken filters on Entity Configuration grid
* Issue #3974 – Settings are not saved in sidebar widgets
* Issue #3962 – Workflow window opens with a significant delay
* Issue #2203 – Incorrect timezone processing in Calendar
* Issue #3909 – Multi-selection filters might be too long
* Issue #3899 – Broken link from Opportunity to related Contact Request

CHANGELOG for 1.0.0
===================
This changelog references the relevant changes (new features, changes and bugs) done in 1.0.0 versions.
Expand Down Expand Up @@ -85,7 +117,6 @@ CHANGELOG for 1.0.0-beta4
This changelog references the relevant changes (new features, changes and bugs) done in 1.0.0-beta4 versions.

* 1.0.0-beta4 (2013-11-21)
* Removed install.bat/install.sh
* Grid refactoring
* Form validation improvements
* Make all entities as Extended
Expand Down
1 change: 1 addition & 0 deletions app/DistributionKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public function registerBundles()
new Oro\Bundle\HelpBundle\OroHelpBundle(),
new Lexik\Bundle\MaintenanceBundle\LexikMaintenanceBundle(),
new Oro\Bundle\PlatformBundle\OroPlatformBundle(),
new Oro\Bundle\InstallerBundle\OroInstallerBundle(),
);

if (in_array($this->getEnvironment(), array('dev'))) {
Expand Down
233 changes: 197 additions & 36 deletions app/OroRequirements.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,31 @@
*/
class OroRequirements extends SymfonyRequirements
{
const REQUIRED_PHP_VERSION = '5.4.4';
const REQUIRED_GD_VERSION = '2.0';
const REQUIRED_PHP_VERSION = '5.4.4';
const REQUIRED_GD_VERSION = '2.0';
const REQUIRED_CURL_VERSION = '7.0';
const REQUIRED_ICU_VERSION = '3.8';
const REQUIRED_ICU_VERSION = '3.8';

const EXCLUDE_REQUIREMENTS_MASK = '/5\.3\.(3|4|8|16)|5\.4\.0/';

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

$nodeExists = new ProcessBuilder(array('node', '--version'));
$nodeExists = $nodeExists->getProcess();

if (isset($_SERVER['PATH'])) {
$nodeExists->setEnv(['PATH' => $_SERVER['PATH']]);
}
$nodeExists->run();
while ($nodeExists->isRunning()) {
// waiting for process to finish
}

$phpVersion = phpversion();
$gdVersion = defined('GD_VERSION') ? GD_VERSION : null;
$curlVersion = function_exists('curl_version') ? curl_version() : null;
$icuVersion = Intl::getIcuVersion();
$nodeExists = $nodeExists->getErrorOutput() === null;

$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(
'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)
);

Expand Down Expand Up @@ -96,6 +89,30 @@ class_exists('COM'),
);
}

// Unix specific checks
if (!defined('PHP_WINDOWS_VERSION_BUILD')) {
$this->addRequirement(
$this->checkFileNameLength(),
'Cache folder should not be inside encrypted directory',
'Move <strong>app/cache</strong> folder outside encrypted directory.'
);
}

// Web installer specific checks
if ('cli' !== PHP_SAPI) {
$output = $this->checkCliRequirements();

$requirement = new CliRequirement(
!$output,
'Requirements validation for PHP CLI',
$output ? 'FAILED' : 'OK'
);

$requirement->setOutput($output);

$this->add($requirement);
}

$baseDir = realpath(__DIR__ . '/..');
$mem = $this->getBytes(ini_get('memory_limit'));

Expand All @@ -110,7 +127,7 @@ function ($cfgValue) use ($mem) {
);

$this->addRecommendation(
$nodeExists,
$this->checkNodeExists(),
'NodeJS should be installed',
'Install the <strong>NodeJS</strong>.'
);
Expand Down Expand Up @@ -165,10 +182,10 @@ function ($cfgValue) use ($mem) {
/**
* Adds an Oro specific requirement.
*
* @param Boolean $fulfilled Whether the requirement is fulfilled
* @param Boolean $fulfilled Whether the requirement is fulfilled
* @param string $testMessage The message for testing the requirement
* @param string $helpHtml The help text formatted in HTML for resolving the problem
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
* @param string $helpHtml The help text formatted in HTML for resolving the problem
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
*/
public function addOroRequirement($fulfilled, $testMessage, $helpHtml, $helpText = null)
{
Expand All @@ -182,9 +199,14 @@ public function addOroRequirement($fulfilled, $testMessage, $helpHtml, $helpText
*/
public function getMandatoryRequirements()
{
return array_filter($this->getRequirements(), function ($requirement) {
return !($requirement instanceof PhpIniRequirement) && !($requirement instanceof OroRequirement);
});
return array_filter(
$this->getRequirements(),
function ($requirement) {
return !($requirement instanceof PhpIniRequirement)
&& !($requirement instanceof OroRequirement)
&& !($requirement instanceof CliRequirement);
}
);
}

/**
Expand All @@ -194,9 +216,12 @@ public function getMandatoryRequirements()
*/
public function getPhpIniRequirements()
{
return array_filter($this->getRequirements(), function ($requirement) {
return $requirement instanceof PhpIniRequirement;
});
return array_filter(
$this->getRequirements(),
function ($requirement) {
return $requirement instanceof PhpIniRequirement;
}
);
}

/**
Expand All @@ -206,9 +231,25 @@ public function getPhpIniRequirements()
*/
public function getOroRequirements()
{
return array_filter($this->getRequirements(), function ($requirement) {
return $requirement instanceof OroRequirement;
});
return array_filter(
$this->getRequirements(),
function ($requirement) {
return $requirement instanceof OroRequirement;
}
);
}

/**
* @return array
*/
public function getCliRequirements()
{
return array_filter(
$this->getRequirements(),
function ($requirement) {
return $requirement instanceof CliRequirement;
}
);
}

/**
Expand All @@ -224,28 +265,148 @@ protected function getBytes($val)
preg_match('/([\-0-9]+)[\s]*([a-z]*)$/i', trim($val), $matches);

if (isset($matches[1])) {
$val = (int) $matches[1];
$val = (int)$matches[1];
}

switch (strtolower($matches[2])) {
case 'g':
case 'gb':
$val *= 1024;
// no break
// no break
case 'm':
case 'mb':
$val *= 1024;
// no break
// no break
case 'k':
case 'kb':
$val *= 1024;
// no break
// no break
}

return (float)$val;
}

/**
* {@inheritdoc}
*/
public function getRequirements()
{
$requirements = parent::getRequirements();

foreach ($requirements as $key => $requirement) {
$testMessage = $requirement->getTestMessage();
if (preg_match_all(self::EXCLUDE_REQUIREMENTS_MASK, $testMessage, $matches)) {
unset($requirements[$key]);
}
}

return $requirements;
}

/**
* {@inheritdoc}
*/
public function getRecommendations()
{
$recommendations = parent::getRecommendations();

foreach ($recommendations as $key => $recommendation) {
$testMessage = $recommendation->getTestMessage();
if (preg_match_all(self::EXCLUDE_REQUIREMENTS_MASK, $testMessage, $matches)) {
unset($recommendations[$key]);
}
}

return (float) $val;
return $recommendations;
}

/**
* @return bool
*/
protected function checkNodeExists()
{
$nodeExists = new ProcessBuilder(array('node', '--version'));
$nodeExists = $nodeExists->getProcess();

if (isset($_SERVER['PATH'])) {
$nodeExists->setEnv(['PATH' => $_SERVER['PATH']]);
}
$nodeExists->run();

return $nodeExists->getErrorOutput() === null;
}

/**
* @return bool
*/
protected function checkFileNameLength()
{
$getConf = new ProcessBuilder(array('getconf', 'NAME_MAX', __DIR__));
$getConf = $getConf->getProcess();

if (isset($_SERVER['PATH'])) {
$getConf->setEnv(['PATH' => $_SERVER['PATH']]);
}
$getConf->run();

if ($getConf->getErrorOutput()) {
// getconf not installed
return true;
}

$fileLength = trim($getConf->getOutput());

return $fileLength == 255;
}

/**
* @return null|string
*/
protected function checkCliRequirements()
{
if (class_exists('\Oro\Bundle\InstallerBundle\Process\PhpExecutableFinder')) {
$finder = new \Oro\Bundle\InstallerBundle\Process\PhpExecutableFinder();
$command = sprintf(
'%s %sconsole oro:platform:check-requirements --env=%s',
$phpExec = $finder->find(),
__DIR__ . DIRECTORY_SEPARATOR,
'prod'
);

$process = new \Symfony\Component\Process\Process($command);
$process->run();

return $process->getOutput();
}

return null;
}
}

class OroRequirement extends Requirement
{
}

class CliRequirement extends Requirement
{
/**
* @var string
*/
protected $output;

/**
* @return string
*/
public function getOutput()
{
return $this->output;
}

/**
* @param string $output
*/
public function setOutput($output)
{
$this->output = $output;
}
}
1 change: 1 addition & 0 deletions app/Resources/translations/install.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ process:
oro: Oro specific requirements
optional: Optional recommendations
check: Check
cli: PHP CLI
configure: Configuration
schema: Database initialization
setup: Administration setup
Expand Down
1 change: 1 addition & 0 deletions app/config/dist/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ framework:
handler_id: %session_handler%
save_path: %kernel.root_dir%/cache/sessions
gc_maxlifetime: 3600
cookie_httponly: true
fragments:
enabled: true
path: /_fragment # used for controller action in template
Expand Down
Loading

0 comments on commit 574d63f

Please sign in to comment.