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

Commit ded4360

Browse files
maxromanovskyfabpot
authored andcommitted
Added status code to app/check.php
1 parent 086d734 commit ded4360

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ Execute the `check.php` script from the command line:
5252

5353
php app/check.php
5454

55+
`app/check.php` returns status code (`0` if all mandatory requirements were
56+
met, `1` otherwise) and thus can be added to build script.
57+
5558
Access the `config.php` script from a browser:
5659

5760
http://localhost/path/to/symfony/app/web/config.php

app/check.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,13 @@
2525

2626
echo_title('Mandatory requirements');
2727

28+
$checkPassed = true;
2829
foreach ($symfonyRequirements->getRequirements() as $req) {
30+
/** @var $req Requirement */
2931
echo_requirement($req);
32+
if (! $req->isFulfilled()) {
33+
$checkPassed = false;
34+
}
3035
}
3136

3237
echo_title('Optional recommendations');
@@ -35,6 +40,8 @@
3540
echo_requirement($req);
3641
}
3742

43+
exit($checkPassed ? 0 : 1);
44+
3845
/**
3946
* Prints a Requirement instance
4047
*/

0 commit comments

Comments
 (0)