https://github.com/yiisoft/requirements
Requirements checker
https://github.com/yiisoft/requirements
hacktoberfest optionalforframeworkannounce requirements yii3
Last synced: about 1 year ago
JSON representation
Requirements checker
- Host: GitHub
- URL: https://github.com/yiisoft/requirements
- Owner: yiisoft
- License: bsd-3-clause
- Created: 2019-07-18T08:21:14.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-28T17:24:02.000Z (almost 2 years ago)
- Last Synced: 2024-10-29T14:35:33.493Z (over 1 year ago)
- Topics: hacktoberfest, optionalforframeworkannounce, requirements, yii3
- Language: PHP
- Homepage: https://www.yiiframework.com/
- Size: 115 KB
- Stars: 23
- Watchers: 18
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
Yii Requirements Checker
[](https://packagist.org/packages/yiisoft/requirements)
[](https://packagist.org/packages/yiisoft/requirements)
[](https://github.com/yiisoft/requirements/actions/workflows/build.yml)
[](https://codecov.io/gh/yiisoft/requirements)
[](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/requirements/master)
[](https://github.com/yiisoft/requirements/actions/workflows/static.yml?query=branch%3Amaster)
[](https://shepherd.dev/github/yiisoft/requirements)
The package allows to check if a certain set of defined requirements is met.
## Requirements
- PHP 7.4 or higher.
## General usage
Requirements checker could be used either from web or from command line. First, create `requirements.php` file:
```php
'PHP version',
'mandatory' => true,
'condition' => version_compare(PHP_VERSION, '7.4.0', '>='),
'by' => 'Yii Framework',
'memo' => 'PHP 7.4.0 or higher is required.',
],
[
'name' => 'PDO MySQL extension',
'mandatory' => false,
'condition' => extension_loaded('pdo_mysql'),
'by' => 'All DB-related classes',
'memo' => 'Required for MySQL database.',
],
[
'name' => 'Intl extension',
'mandatory' => false,
'condition' => $requirementsChecker->checkPhpExtensionVersion('intl', '1.0.2', '>='),
'by' => 'Internationalization support',
'memo' => 'PHP Intl extension 1.0.2 or higher is required.'
],
];
$result = $requirementsChecker
->check($config)
->getResult();
$requirementsChecker->render();
exit($result['summary']['errors'] === 0 ? 0 : 1);
```
And now it could be either put to webroot or executed as:
```shell
php requirements.php
```
## Documentation
- [Internals](docs/internals.md)
If you need help or have a question, the [Yii Forum](https://forum.yiiframework.com/c/yii-3-0/63) is a good place for that.
You may also check out other [Yii Community Resources](https://www.yiiframework.com/community).
## License
The Yii Requirements Checker is free software. It is released under the terms of the BSD License.
Please see [`LICENSE`](./LICENSE.md) for more information.
Maintained by [Yii Software](https://www.yiiframework.com/).
### Support the project
[](https://opencollective.com/yiisoft)
### Follow updates
[](https://www.yiiframework.com/)
[](https://twitter.com/yiiframework)
[](https://t.me/yii3en)
[](https://www.facebook.com/groups/yiitalk)
[](https://yiiframework.com/go/slack)