aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/SymfonyRequirements.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/SymfonyRequirements.php')
-rw-r--r--app/SymfonyRequirements.php41
1 files changed, 26 insertions, 15 deletions
diff --git a/app/SymfonyRequirements.php b/app/SymfonyRequirements.php
index cbcf1c8e..caabe407 100644
--- a/app/SymfonyRequirements.php
+++ b/app/SymfonyRequirements.php
@@ -77,7 +77,7 @@ class Requirement
77 } 77 }
78 78
79 /** 79 /**
80 * Returns the help text for resolving the problem 80 * Returns the help text for resolving the problem.
81 * 81 *
82 * @return string The help text 82 * @return string The help text
83 */ 83 */
@@ -119,10 +119,10 @@ class PhpIniRequirement extends Requirement
119 * 119 *
120 * @param string $cfgName The configuration name used for ini_get() 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, 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 122 * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
123 * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. 123 * @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. 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. 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) 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) 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) 128 * @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 @@ class RequirementCollection implements IteratorAggregate
221 * 221 *
222 * @param string $cfgName The configuration name used for ini_get() 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, 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 224 * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
225 * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. 225 * @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. 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. 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) 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) 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) 230 * @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 @@ class RequirementCollection implements IteratorAggregate
239 * 239 *
240 * @param string $cfgName The configuration name used for ini_get() 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, 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 242 * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
243 * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. 243 * @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. 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. 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) 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) 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) 248 * @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 @@ class SymfonyRequirements extends RequirementCollection
542 542
543 /* optional recommendations follow */ 543 /* optional recommendations follow */
544 544
545 $this->addRecommendation( 545 if (file_exists(__DIR__.'/../vendor/composer')) {
546 file_get_contents(__FILE__) === file_get_contents(__DIR__.'/../vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/app/SymfonyRequirements.php'), 546 require_once __DIR__.'/../vendor/autoload.php';
547 'Requirements file should be up-to-date', 547
548 'Your requirements file is outdated. Run composer install and re-check your configuration.' 548 try {
549 ); 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 }
550 561
551 $this->addRecommendation( 562 $this->addRecommendation(
552 version_compare($installedPhpVersion, '5.3.4', '>='), 563 version_compare($installedPhpVersion, '5.3.4', '>='),