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

Commit 11e416e

Browse files
committed
[2.8] update composer dependencies
1 parent 9e1f2f1 commit 11e416e

File tree

2 files changed

+126
-116
lines changed

2 files changed

+126
-116
lines changed

app/SymfonyRequirements.php

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function getTestMessage()
7777
}
7878

7979
/**
80-
* Returns the help text for resolving the problem
80+
* Returns the help text for resolving the problem.
8181
*
8282
* @return string The help text
8383
*/
@@ -119,10 +119,10 @@ class PhpIniRequirement extends Requirement
119119
*
120120
* @param string $cfgName The configuration name used for ini_get()
121121
* @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
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.
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.
126126
* @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived)
127127
* @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)
128128
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
@@ -221,10 +221,10 @@ public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText
221221
*
222222
* @param string $cfgName The configuration name used for ini_get()
223223
* @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
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.
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.
228228
* @param string $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived)
229229
* @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)
230230
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
@@ -239,10 +239,10 @@ public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence =
239239
*
240240
* @param string $cfgName The configuration name used for ini_get()
241241
* @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
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.
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.
246246
* @param string $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived)
247247
* @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)
248248
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
@@ -542,11 +542,22 @@ function_exists('simplexml_import_dom'),
542542

543543
/* optional recommendations follow */
544544

545-
$this->addRecommendation(
546-
file_get_contents(__FILE__) === file_get_contents(__DIR__.'/../vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/app/SymfonyRequirements.php'),
547-
'Requirements file should be up-to-date',
548-
'Your requirements file is outdated. Run composer install and re-check your configuration.'
549-
);
545+
if (file_exists(__DIR__.'/../vendor/composer')) {
546+
require_once __DIR__.'/../vendor/autoload.php';
547+
548+
try {
549+
$r = new \ReflectionClass('Sensio\Bundle\DistributionBundle\SensioDistributionBundle');
550+
551+
$contents = file_get_contents(dirname($r->getFileName()).'/Resources/skeleton/app/SymfonyRequirements.php');
552+
} catch (\ReflectionException $e) {
553+
$contents = '';
554+
}
555+
$this->addRecommendation(
556+
file_get_contents(__FILE__) === $contents,
557+
'Requirements file should be up-to-date',
558+
'Your requirements file is outdated. Run composer install and re-check your configuration.'
559+
);
560+
}
550561

551562
$this->addRecommendation(
552563
version_compare($installedPhpVersion, '5.3.4', '>='),

0 commit comments

Comments
 (0)