sensio/SensioDistributionBundle — pull request #64 by theunraveler (2012-09-19 02:17:42+00:00)
Title: Adding app-specific requirements to app/check.php

Hello,

This pull request defines an `AppRequirements.php.dist` file that users can optionally rename and edit in order to specify app-specific requirements.

For example:
If my app requires the memcache PHP extension, I can rename `app/AppRequirements.php.dist` to `app/AppRequirements.php`, and specify my requirements in the same way that Symfony can in `SymfonyRequirements.php`

```php
class AppRequirements extends RequirementCollection
{
public function __construct()
{
$this->addRequirement(
class_exists('Memcache'),
'memcache extension should be installed',
'You must install the memcache extension (used for caching users)'
);

$this->addRecommendation(
// My recommendation.
);
}
}
```

These requirements and recommendations will be displayed along with the usual requirements when the user runs `app/check.php`. However, they will be prefixed with "App requirement: " and "App recommendation: " so that it is obvious what is a requirement/recommendation of Symfony versus the app.

If there is no `app/AppRequirements.php` file, the check is ignore, and things work just as they otherwise do.