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

Commit f45c155

Browse files
committed
merged branch maxromanovsky/app-config-status-code (PR #516)
This PR was squashed before being merged into the master branch (closes #516). Discussion ---------- Added status code to app/check.php This change could be useful in build scripts. `app/check.php` could be executed in order to check that build environment is sane. Changes: 1. Added status code to `app/check.php` 1. Updated `README.md` Commits ------- ded4360 Added status code to app/check.php
2 parents 086d734 + ded4360 commit f45c155

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)