Skip to content
This repository was archived by the owner on Nov 27, 2020. It is now read-only.

Commit 4c71562

Browse files
committed
updated Symfony to 2.3
1 parent 774cda0 commit 4c71562

File tree

3 files changed

+654
-309
lines changed

3 files changed

+654
-309
lines changed

app/SymfonyRequirements.php

Lines changed: 48 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ class Requirement
4141
/**
4242
* Constructor that initializes the requirement.
4343
*
44-
* @param Boolean $fulfilled Whether the requirement is fulfilled
45-
* @param string $testMessage The message for testing the requirement
46-
* @param string $helpHtml The help text formatted in HTML for resolving the problem
47-
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
48-
* @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement
44+
* @param Boolean $fulfilled Whether the requirement is fulfilled
45+
* @param string $testMessage The message for testing the requirement
46+
* @param string $helpHtml The help text formatted in HTML for resolving the problem
47+
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
48+
* @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement
4949
*/
5050
public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false)
5151
{
@@ -117,16 +117,16 @@ class PhpIniRequirement extends Requirement
117117
/**
118118
* Constructor that initializes the requirement.
119119
*
120-
* @param string $cfgName The configuration name used for ini_get()
121-
* @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
120+
* @param string $cfgName The configuration name used for ini_get()
121+
* @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
122122
or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
123-
* @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
123+
* @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
124124
This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
125125
Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
126-
* @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
127-
* @param string|null $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
128-
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
129-
* @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement
126+
* @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
127+
* @param string|null $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
128+
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
129+
* @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement
130130
*/
131131
public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
132132
{
@@ -193,10 +193,10 @@ public function add(Requirement $requirement)
193193
/**
194194
* Adds a mandatory requirement.
195195
*
196-
* @param Boolean $fulfilled Whether the requirement is fulfilled
197-
* @param string $testMessage The message for testing the requirement
198-
* @param string $helpHtml The help text formatted in HTML for resolving the problem
199-
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
196+
* @param Boolean $fulfilled Whether the requirement is fulfilled
197+
* @param string $testMessage The message for testing the requirement
198+
* @param string $helpHtml The help text formatted in HTML for resolving the problem
199+
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
200200
*/
201201
public function addRequirement($fulfilled, $testMessage, $helpHtml, $helpText = null)
202202
{
@@ -206,10 +206,10 @@ public function addRequirement($fulfilled, $testMessage, $helpHtml, $helpText =
206206
/**
207207
* Adds an optional recommendation.
208208
*
209-
* @param Boolean $fulfilled Whether the recommendation is fulfilled
210-
* @param string $testMessage The message for testing the recommendation
211-
* @param string $helpHtml The help text formatted in HTML for resolving the problem
212-
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
209+
* @param Boolean $fulfilled Whether the recommendation is fulfilled
210+
* @param string $testMessage The message for testing the recommendation
211+
* @param string $helpHtml The help text formatted in HTML for resolving the problem
212+
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
213213
*/
214214
public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText = null)
215215
{
@@ -219,15 +219,15 @@ public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText
219219
/**
220220
* Adds a mandatory requirement in form of a php.ini configuration.
221221
*
222-
* @param string $cfgName The configuration name used for ini_get()
223-
* @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
222+
* @param string $cfgName The configuration name used for ini_get()
223+
* @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
224224
or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
225-
* @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
225+
* @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
226226
This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
227227
Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
228-
* @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
229-
* @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
230-
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
228+
* @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
229+
* @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
230+
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
231231
*/
232232
public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
233233
{
@@ -237,15 +237,15 @@ public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence =
237237
/**
238238
* Adds an optional recommendation in form of a php.ini configuration.
239239
*
240-
* @param string $cfgName The configuration name used for ini_get()
241-
* @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
240+
* @param string $cfgName The configuration name used for ini_get()
241+
* @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
242242
or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
243-
* @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
243+
* @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
244244
This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
245245
Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
246-
* @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
247-
* @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
248-
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
246+
* @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
247+
* @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
248+
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
249249
*/
250250
public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
251251
{
@@ -430,8 +430,15 @@ public function __construct()
430430
);
431431

432432
if (version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>=')) {
433+
$timezones = array();
434+
foreach (DateTimeZone::listAbbreviations() as $abbreviations) {
435+
foreach ($abbreviations as $abbreviation) {
436+
$timezones[$abbreviation['timezone_id']] = true;
437+
}
438+
}
439+
433440
$this->addRequirement(
434-
(in_array(date_default_timezone_get(), DateTimeZone::listIdentifiers())),
441+
isset($timezones[date_default_timezone_get()]),
435442
sprintf('Configured default timezone "%s" must be supported by your installation of PHP', date_default_timezone_get()),
436443
'Your default timezone is not supported by PHP. Check for typos in your <strong>php.ini</strong> file and have a look at the list of deprecated timezones at <a href="http://php.net/manual/en/timezones.others.php">http://php.net/manual/en/timezones.others.php</a>.'
437444
);
@@ -503,6 +510,14 @@ function_exists('simplexml_import_dom'),
503510
$this->addPhpIniRequirement(
504511
'xdebug.scream', false, true
505512
);
513+
514+
$this->addPhpIniRecommendation(
515+
'xdebug.max_nesting_level',
516+
create_function('$cfgValue', 'return $cfgValue > 100;'),
517+
true,
518+
'xdebug.max_nesting_level should be above 100 in php.ini',
519+
'Set "<strong>xdebug.max_nesting_level</strong>" to e.g. "<strong>250</strong>" in php.ini<a href="#phpini">*</a> to stop Xdebug\'s infinite recursion protection erroneously throwing a fatal error in your project.'
520+
);
506521
}
507522

508523
$pcreVersion = defined('PCRE_VERSION') ? (float) PCRE_VERSION : null;

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"require": {
88
"php": ">=5.3.3",
9-
"symfony/symfony": "2.2.*",
9+
"symfony/symfony": "2.3.*",
1010
"doctrine/orm": ">=2.2.3,<2.4-dev",
1111
"doctrine/doctrine-bundle": "1.2.*",
1212
"twig/extensions": "1.0.*",

0 commit comments

Comments
 (0)