Skip to content

Commit

Permalink
Update sf
Browse files Browse the repository at this point in the history
  • Loading branch information
NoUseFreak committed Oct 25, 2015
1 parent 21e9fb4 commit 0ef16ef
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 98 deletions.
43 changes: 34 additions & 9 deletions app/SymfonyRequirements.php
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,12 @@ public function __construct()
);
}

$this->addRequirement(
function_exists('iconv'),
'iconv() must be available',
'Install and enable the <strong>iconv</strong> extension.'
);

$this->addRequirement(
function_exists('json_encode'),
'json_encode() must be available',
Expand Down Expand Up @@ -542,11 +548,22 @@ function_exists('simplexml_import_dom'),

/* optional recommendations follow */

$this->addRecommendation(
file_get_contents(__FILE__) === file_get_contents(__DIR__.'/../vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/app/SymfonyRequirements.php'),
'Requirements file should be up-to-date',
'Your requirements file is outdated. Run composer install and re-check your configuration.'
);
if (file_exists(__DIR__.'/../vendor/composer')) {
require_once __DIR__.'/../vendor/autoload.php';

try {
$r = new \ReflectionClass('Sensio\Bundle\DistributionBundle\SensioDistributionBundle');

$contents = file_get_contents(dirname($r->getFileName()).'/Resources/skeleton/app/SymfonyRequirements.php');
} catch (\ReflectionException $e) {
$contents = '';
}
$this->addRecommendation(
file_get_contents(__FILE__) === $contents,
'Requirements file should be up-to-date',
'Your requirements file is outdated. Run composer install and re-check your configuration.'
);
}

$this->addRecommendation(
version_compare($installedPhpVersion, '5.3.4', '>='),
Expand Down Expand Up @@ -627,20 +644,20 @@ function_exists('posix_isatty'),
}

$this->addRecommendation(
class_exists('Locale'),
extension_loaded('intl'),
'intl extension should be available',
'Install and enable the <strong>intl</strong> extension (used for validators).'
);

if (class_exists('Collator')) {
if (extension_loaded('intl')) {
// in some WAMP server installations, new Collator() returns null
$this->addRecommendation(
null !== new Collator('fr_FR'),
'intl extension should be correctly configured',
'The intl extension does not behave properly. This problem is typical on PHP 5.3.X x64 WIN builds.'
);
}

if (class_exists('Locale')) {
// check for compatible ICU versions (only done when you have the intl extension)
if (defined('INTL_ICU_VERSION')) {
$version = INTL_ICU_VERSION;
} else {
Expand All @@ -659,6 +676,14 @@ class_exists('Locale'),
'intl ICU version should be at least 4+',
'Upgrade your <strong>intl</strong> extension with a newer ICU version (4+).'
);

$this->addPhpIniRecommendation(
'intl.error_level',
create_function('$cfgValue', 'return (int) $cfgValue === 0;'),
true,
'intl.error_level should be 0 in php.ini',
'Set "<strong>intl.error_level</strong>" to "<strong>0</strong>" in php.ini<a href="#phpini">*</a> to inhibit the messages when an error occurs in ICU functions.'
);
}

$accelerator =
Expand Down
10 changes: 5 additions & 5 deletions app/check.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
}

if ($checkPassed) {
echo_block('success', 'OK', 'Your system is ready to run Symfony2 projects', true);
echo_block('success', 'OK', 'Your system is ready to run Symfony2 projects');
} else {
echo_block('error', 'ERROR', 'Your system is not ready to run Symfony2 projects', true);
echo_block('error', 'ERROR', 'Your system is not ready to run Symfony2 projects');

echo_title('Fix the following mandatory requirements', 'red');

Expand Down Expand Up @@ -80,7 +80,7 @@ function get_error_message(Requirement $requirement, $lineSize)
return;
}

$errorMessage = wordwrap($requirement->getTestMessage(), $lineSize - 3, PHP_EOL.' ').PHP_EOL;
$errorMessage = wordwrap($requirement->getTestMessage(), $lineSize - 3, PHP_EOL.' ').PHP_EOL;
$errorMessage .= ' > '.wordwrap($requirement->getHelpText(), $lineSize - 5, PHP_EOL.' > ').PHP_EOL;

return $errorMessage;
Expand Down Expand Up @@ -121,8 +121,8 @@ function echo_block($style, $title, $message)
echo PHP_EOL.PHP_EOL;

echo_style($style, str_repeat(' ', $width).PHP_EOL);
echo_style($style, str_pad(' ['.$title.']', $width, ' ', STR_PAD_RIGHT).PHP_EOL);
echo_style($style, str_pad($message, $width, ' ', STR_PAD_RIGHT).PHP_EOL);
echo_style($style, str_pad(' ['.$title.']', $width, ' ', STR_PAD_RIGHT).PHP_EOL);
echo_style($style, str_pad($message, $width, ' ', STR_PAD_RIGHT).PHP_EOL);
echo_style($style, str_repeat(' ', $width).PHP_EOL);
}

Expand Down
13 changes: 6 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@
"clastic/user-bundle": "self.version"
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.6.*",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "~1.2",
"twig/extensions": "~1.0",
"php": ">=5.3.9",
"symfony/symfony": "2.7.*",
"doctrine/orm": "^2.4.8",
"doctrine/doctrine-bundle": "~1.4",
"symfony/assetic-bundle": "~2.3",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~3.0.12",
"sensio/framework-extra-bundle": "~3.0",
"sensio/distribution-bundle": "~4.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "~2.0",

"white-october/pagerfanta-bundle": "~1.0",
Expand Down
108 changes: 31 additions & 77 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0ef16ef

Please sign in to comment.