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

Added status code to app/check.php #516

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ Execute the `check.php` script from the command line:

php app/check.php

`app/check.php` returns status code (`0` if all Mandatory requirements were
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mandatory

met, `1` otherwise) and thus can be added to build script.

Access the `config.php` script from a browser:

http://localhost/path/to/symfony/app/web/config.php
Expand Down
7 changes: 7 additions & 0 deletions app/check.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@

echo_title('Mandatory requirements');

$checkPassed = true;
foreach ($symfonyRequirements->getRequirements() as $req) {
/** @var $req Requirement */
echo_requirement($req);
if (! $req->isFulfilled()) {
$checkPassed = false;
}
}

echo_title('Optional recommendations');
Expand All @@ -35,6 +40,8 @@
echo_requirement($req);
}

exit($checkPassed ? 0 : 1);

/**
* Prints a Requirement instance
*/
Expand Down