Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/dev/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrebenchuk committed Oct 28, 2013
2 parents cec060d + 8453230 commit 00e4fde
Show file tree
Hide file tree
Showing 16 changed files with 628 additions and 253 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -16,6 +16,7 @@ build/
/web/js
/web/uploads/users/*
/web/media/cache
/web/build.js
/app/config/parameters.yml
/app/config/parameters_test.yml
*~
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,10 @@
CHANGELOG for 1.0.0-beta2
===================
This changelog references the relevant changes (new features, changes and bugs) done in 1.0.0-beta2 versions.

* 1.0.0-beta1 (2013-10-28)
* Oro Platform Beta 2 dependency changes

CHANGELOG for 1.0.0-beta1
===================
This changelog references the relevant changes (new features, changes and bugs) done in 1.0.0-beta1 versions.
Expand Down
48 changes: 5 additions & 43 deletions app/AppKernel.php
@@ -1,49 +1,14 @@
<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
use Oro\Bundle\DistributionBundle\OroKernel;

class AppKernel extends OroKernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
//new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
new JMS\JobQueueBundle\JMSJobQueueBundle(),
new JMS\SerializerBundle\JMSSerializerBundle($this),
new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
new FOS\RestBundle\FOSRestBundle(),
new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
new BeSimple\SoapBundle\BeSimpleSoapBundle(),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
new Escape\WSSEAuthenticationBundle\EscapeWSSEAuthenticationBundle(),
new Liip\ImagineBundle\LiipImagineBundle(),
new Bazinga\ExposeTranslationBundle\BazingaExposeTranslationBundle(),
new APY\JsFormValidationBundle\APYJsFormValidationBundle(),
new Genemu\Bundle\FormBundle\GenemuFormBundle(),
new A2lix\TranslationFormBundle\A2lixTranslationFormBundle(),
new JDare\ClankBundle\JDareClankBundle(),
new Lexik\Bundle\MaintenanceBundle\LexikMaintenanceBundle(),
new Sylius\Bundle\FlowBundle\SyliusFlowBundle(),

// CRM bundles
new OroCRM\Bundle\AccountBundle\OroCRMAccountBundle(),
new OroCRM\Bundle\ContactBundle\OroCRMContactBundle(),
new OroCRM\Bundle\DashboardBundle\OroCRMDashboardBundle(),
new OroCRM\Bundle\SalesBundle\OroCRMSalesBundle(),
new OroCRM\Bundle\ReportBundle\OroCRMReportBundle(),
);
$bundles = array();

if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
Expand All @@ -55,10 +20,7 @@ public function registerBundles()
$bundles[] = new Oro\Bundle\TestFrameworkBundle\OroTestFrameworkBundle();
}

// BAP bundles
$bundles = array_merge($bundles, Oro\Bundle\PlatformBundle\OroPlatformBundle::registeredBundles($this));

return $bundles;
return array_merge(parent::registerBundles(), $bundles);
}

public function registerContainerConfiguration(LoaderInterface $loader)
Expand Down
194 changes: 194 additions & 0 deletions app/OroRequirements.php
@@ -0,0 +1,194 @@
<?php

require_once __DIR__ . '/SymfonyRequirements.php';

use Symfony\Component\Process\ProcessBuilder;

/**
* 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();

$phpVersion = phpversion();
$gdVersion = defined('GD_VERSION') ? (float) GD_VERSION : null;
$curlVersion = function_exists('curl_version') ? curl_version() : null;
$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'),
'mcrypt_encrypt() should be available',
'Install and enable the <strong>Mcrypt</strong> extension.'
);

$this->addRecommendation(
class_exists('SoapClient'),
'SOAP extension should be installed (API calls)',
'Install and enable the <strong>SOAP</strong> extension.'
);

$this->addRecommendation(
null !== $curlVersion && (float) $curlVersion['version'] >= 7.0,
'cURL extension must be at least 7.0',
'Install and enable the <strong>cURL</strong> extension.'
);

// Windows specific checks
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
$this->addRecommendation(
function_exists('finfo_open'),
'finfo_open() should be available',
'Install and enable the <strong>Fileinfo</strong> extension.'
);

$this->addRecommendation(
class_exists('COM'),
'COM extension should be installed',
'Install and enable the <strong>COM</strong> extension.'
);
}

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

$this->addPhpIniRequirement(
'memory_limit',
function ($cfgValue) use ($mem) {
return $mem >= 256 * 1024 * 1024 || -1 == $mem;
},
false,
'memory_limit should be at least 256M',
'Set the "<strong>memory_limit</strong>" setting in php.ini<a href="#phpini">*</a> to at least "256M".'
);

$this->addOroRequirement(
$jreExists,
'Java Runtime Environment must be installed',
'Install the <strong>JRE</strong>.'
);

$this->addOroRequirement(
is_writable($baseDir . '/web/uploads'),
'web/uploads/ directory must be writable',
'Change the permissions of the "<strong>web/uploads/</strong>" directory so that the web server can write into it.'
);

$this->addOroRequirement(
is_writable($baseDir . '/web/bundles'),
'web/bundles/ directory must be writable',
'Change the permissions of the "<strong>web/bundles/</strong>" directory so that the web server can write into it.'
);
}

/**
* Adds an Oro specific requirement.
*
* @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)
*/
public function addOroRequirement($fulfilled, $testMessage, $helpHtml, $helpText = null)
{
$this->add(new OroRequirement($fulfilled, $testMessage, $helpHtml, $helpText, false));
}

/**
* Get the list of mandatory requirements (all requirements excluding PhpIniRequirement)
*
* @return array
*/
public function getMandatoryRequirements()
{
return array_filter($this->getRequirements(), function ($requirement) {
return !($requirement instanceof PhpIniRequirement) && !($requirement instanceof OroRequirement);
});
}

/**
* Get the list of PHP ini requirements
*
* @return array
*/
public function getPhpIniRequirements()
{
return array_filter($this->getRequirements(), function ($requirement) {
return $requirement instanceof PhpIniRequirement;
});
}

/**
* Get the list of Oro specific requirements
*
* @return array
*/
public function getOroRequirements()
{
return array_filter($this->getRequirements(), function ($requirement) {
return $requirement instanceof OroRequirement;
});
}

/**
* @param string $val
* @return int
*/
protected function getBytes($val)
{
if (empty($val)) {
return 0;
}

preg_match('/([\-0-9]+)[\s]*([a-z]*)$/i', trim($val), $matches);

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

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

return (float) $val;
}
}

class OroRequirement extends Requirement
{
}
Binary file added app/Resources/java/js.jar
Binary file not shown.
28 changes: 28 additions & 0 deletions app/Resources/translations/install.en.yml
@@ -0,0 +1,28 @@
title: Oro Application installation

welcome:
header: Welcome to Oro Installer
content: This wizard will guide you through the setup process.
button: Begin Installation

process:
step:
check:
header: System requirements check
invalid: Some of the requirements are not met and the installation process cannot continue. Please check below for the minimum requirements to Install Oro.
phpchanges: Changes to the <strong>php.ini</strong> file must be done in "<strong>%path%</strong>".
phpcreate: To change settings, create a "<strong>php.ini</strong>".
table:
mandatory: Mandatory requirements
php: PHP settings
oro: Oro specific requirements
optional: Optional recommendations
check: Check
configure: Configuration
schema: Database initialization
setup: Administration setup
final: Finish

button:
next: Next
refresh: Refresh
33 changes: 33 additions & 0 deletions app/config/config.yml
Expand Up @@ -19,6 +19,7 @@ framework:
name: BAPID
handler_id: %session_handler%
save_path: %kernel.root_dir%/cache/sessions
gc_maxlifetime: 3600
fragments:
enabled: true
path: /_fragment # used for controller action in template
Expand Down Expand Up @@ -253,3 +254,35 @@ oro_entity_extend:

apy_js_form_validation:
check_modes: [submit]

oro_require_js:
config:
# @see http://requirejs.org/docs/api.html#config
waitSeconds: 0
# enforceDefine: true
# scriptType: 'text/javascript'
build_path: "js/oro.min.js"
building_timeout: 3600
build:
# @see https://github.com/jrburke/r.js/blob/master/build/example.build.js
optimize: "uglify2"
preserveLicenseComments: true
# generateSourceMaps: true
# useSourceUrl: true
# it's better to set "node" as js_engine, if nodejs is installed
js_engine: "java -Xss10m -Xms512m -Xmx1024m -cp %kernel.root_dir%/Resources/java/js.jar org.mozilla.javascript.tools.shell.Main"

oro_help:
defaults:
server: http://help.orocrm.com/
prefix: Third_Party
vendors:
Oro:
prefix: ~
alias: Platform
OroCRM:
prefix: ~
alias: CRM
routes:
oro_default:
uri: CRM/OroCRMDashboardBundle
6 changes: 0 additions & 6 deletions app/config/config_perf.yml

This file was deleted.

4 changes: 2 additions & 2 deletions app/config/parameters.yml.dist
Expand Up @@ -14,8 +14,8 @@ parameters:
websocket_host: "127.0.0.1"
websocket_port: 8080

session_handler: ~
session_handler: session.handler.native_file

locale: en
secret: ThisTokenIsNotSoSecretChangeIt
installed: false
installed: ~

0 comments on commit 00e4fde

Please sign in to comment.