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 a3e5ddd + 8415426 commit 1f341ac
Show file tree
Hide file tree
Showing 8 changed files with 287 additions and 155 deletions.
34 changes: 12 additions & 22 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
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)
* Two-side customer data synchronization with Magento
* Improvements to Customer view
* Improvements to Magento data view
* Fixed issue Broken widgets in merged Account view
* 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 @@ -7,27 +18,6 @@ This changelog references the relevant changes (new features, changes and bugs)
* Improvements to display of Magento data
* Fixed issue Broken widgets in merged Account view

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

* 1.1.0 (2014-04-28)
* Magento order completion
* Magento order creation
* Dashboard management

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 #1049 – Problems with import of several Magento orders per cart
* Issue #944 – Problems with import of Magento orders from Admin website
* Issue #971 – Orders and Shopping Cart grids on the Account view are not clickable
* Issue #970 – Artifacts on the Account view page
* Issue #934 – Contact widget is not working correctly
* Issue #931 – ACL is not implemented correctly for Calls and Emails on Magento-related entity pages

CHANGELOG for 1.0.0
===================
This changelog references the relevant changes (new features, changes and bugs) done in 1.0.0 versions.
Expand All @@ -54,7 +44,7 @@ This changelog references the relevant changes (new features, changes and bugs)
* Improved Workflow
* Improved Dashboard
* Magento import performance improvements
* Other improvements in channels, contacts
* Other improvements in channnels, contacts

CHANGELOG for 1.0.0-beta6
===================
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
234 changes: 198 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 @@ -163,10 +180,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 @@ -180,9 +197,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 @@ -192,9 +214,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 @@ -204,9 +229,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 @@ -222,28 +263,149 @@ 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 $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;
}

return (float) $val;
$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 1f341ac

Please sign in to comment.