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

Commit 19fc57a

Browse files
committed
Merge branch '2.6' into 2.7
* 2.6: fixed dep updated VENDORS for 2.6.3 fixed default tests in AppBundle updated VENDORS for 2.5.9
2 parents 919fb17 + 6de5bf2 commit 19fc57a

File tree

3 files changed

+56
-33
lines changed

3 files changed

+56
-33
lines changed

app/SymfonyRequirements.php

Lines changed: 53 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -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 bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false,
122-
or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
120+
* @param string $cfgName The configuration name used for ini_get()
121+
* @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false,
122+
or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
123123
* @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
124-
This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
125-
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 bool $optional Whether this is only an optional recommendation not a mandatory requirement
124+
This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
125+
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 bool $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
{
@@ -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 bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false,
224-
or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
222+
* @param string $cfgName The configuration name used for ini_get()
223+
* @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false,
224+
or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
225225
* @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
226-
This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
227-
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)
226+
This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
227+
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)
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 bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false,
242-
or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
240+
* @param string $cfgName The configuration name used for ini_get()
241+
* @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false,
242+
or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
243243
* @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
244-
This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
245-
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)
244+
This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
245+
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)
249249
*/
250250
public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
251251
{
@@ -590,8 +590,8 @@ function_exists('simplexml_import_dom'),
590590

591591
$this->addRecommendation(
592592
class_exists('DomDocument'),
593-
'PHP-XML module should be installed',
594-
'Install and enable the <strong>PHP-XML</strong> module.'
593+
'PHP-DOM and PHP-XML modules should be installed',
594+
'Install and enable the <strong>PHP-DOM</strong> and the <strong>PHP-XML</strong> modules.'
595595
);
596596

597597
$this->addRecommendation(
@@ -682,10 +682,8 @@ class_exists('Locale'),
682682
);
683683

684684
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
685-
$this->addPhpIniRecommendation(
686-
'realpath_cache_size',
687-
create_function('$cfgValue', 'return (int) $cfgValue > 1000;'),
688-
false,
685+
$this->addRecommendation(
686+
$this->getRealpathCacheSize() > 1000,
689687
'realpath_cache_size should be above 1024 in php.ini',
690688
'Set "<strong>realpath_cache_size</strong>" to e.g. "<strong>1024</strong>" in php.ini<a href="#phpini">*</a> to improve performance on windows.'
691689
);
@@ -714,4 +712,28 @@ class_exists('PDO'),
714712
);
715713
}
716714
}
715+
716+
/**
717+
* Loads realpath_cache_size from php.ini and converts it to int.
718+
*
719+
* (e.g. 16k is converted to 16384 int)
720+
*
721+
* @return int
722+
*/
723+
protected function getRealpathCacheSize()
724+
{
725+
$size = ini_get('realpath_cache_size');
726+
$size = trim($size);
727+
$unit = strtolower(substr($size, -1, 1));
728+
switch ($unit) {
729+
case 'g':
730+
return $size * 1024 * 1024 * 1024;
731+
case 'm':
732+
return $size * 1024 * 1024;
733+
case 'k':
734+
return $size * 1024;
735+
default:
736+
return (int) $size;
737+
}
738+
}
717739
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"symfony/assetic-bundle": "~2.3",
1616
"symfony/swiftmailer-bundle": "~2.3",
1717
"symfony/monolog-bundle": "~2.4",
18-
"sensio/distribution-bundle": "~3.0.12",
18+
"sensio/distribution-bundle": "~3.0,>=3.0.12",
1919
"sensio/framework-extra-bundle": "~3.0",
2020
"incenteev/composer-parameter-handler": "~2.0"
2121
},

src/AppBundle/Tests/Controller/DefaultControllerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ public function testIndex()
1010
{
1111
$client = static::createClient();
1212

13-
$crawler = $client->request('GET', '/');
13+
$crawler = $client->request('GET', '/app/example');
1414

15+
$this->assertEquals(200, $client->getResponse()->getStatusCode());
1516
$this->assertTrue($crawler->filter('html:contains("Homepage")')->count() > 0);
1617
}
1718
}

0 commit comments

Comments
 (0)