Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reiterus/mcx-info-symfony
Information card of the Russian Federation Agriculture Ministry as Symfony Bundle
https://github.com/reiterus/mcx-info-symfony
agriculture bundle reiterus symfony symfony-bundle
Last synced: 18 days ago
JSON representation
Information card of the Russian Federation Agriculture Ministry as Symfony Bundle
- Host: GitHub
- URL: https://github.com/reiterus/mcx-info-symfony
- Owner: reiterus
- License: mit
- Created: 2022-07-04T06:46:36.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-02T04:23:55.000Z (over 1 year ago)
- Last Synced: 2024-10-07T03:07:05.836Z (about 1 month ago)
- Topics: agriculture, bundle, reiterus, symfony, symfony-bundle
- Language: PHP
- Homepage:
- Size: 72.3 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Card of the Russia Agriculture Ministry
Summary information on the Ministry of Agriculture of the Russian Federation
as a Symfony bundle that provides a REST API URL
with response in json format.Default URL: `/bundle/mcx/info/index`
All data was obtained from the public Internet resource of the ministry.
[![screenshot from the website Agriculture Ministry](picture.png)](https://mcx.gov.ru)
Some of the response content can be manipulated:
- main data (main): title, address, site, etc
- officials of the ministry (persons)
- contactsThe `app` directory contains ready-to-use files,
which need to be moved to the appropriate directories
your project, which will lead to the completion of the default information.# Response
The output can be show in two formats:
- in one line
- beautifully formatted
```json
{
"title": "Министерство сельского хозяйства Российской Федерации",
"description": "Федеральный орган исполнительной власти...",
"address": "107996, Москва, Орликов переулок, 1\/11",
"site": "https:\/\/mcx.gov.ru",
"contacts": [
"Тел.: +7 (495) 607-80-00",
"Факс: +7 (495) 607-83-62",
"[email protected]"
],
"persons": [
[
"Патрушев Дмитрий Николаевич",
"Министр сельского хозяйства Российской Федерации",
"[email protected]",
"Тел.: +7 (495) 607-80-00",
"Факс: +7 (495) 607-83-62"
],
[
"..."
]
]
}
```# Usage
URL setting
```yaml
# connecting config with route
reiterus_mcx_info:
resource: '@McxInfoBundle/Resources/config/routes.xml'
prefix: /bundle/mcx/info
```Package setup
```yaml
# adding contacts and formatting the output
reiterus_mcx_info:
contacts:
- 'Тел.: +7 (495) 607-80-00'
- 'Факс: +7 (495) 607-83-62'
- '[email protected]'
pretty: true# addition of personalities through a service with a specific tag
services:
app.reiterus_mcx_info_persons:
class: App\Util\McxPersons
tags:
- { name: 'tag_mcx_info_persons' }
```# Installation
You can install the bundle in two waysFrom packagist.org
```shell
composer require reiterus/mcx-info-symfony
```From GitHub repository
```json
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/reiterus/mcx-info-symfony.git"
}
]
}
```# Tests
To run tests with visual code coverage, launch the command as follows:
```shell
XDEBUG_MODE=coverage ./vendor/phpunit/phpunit/phpunit \
--configuration phpunit.xml \
--testsuite default \
--coverage-html coverage/
```Test results will be saved in the `coverage` directory.
![Coverage](coverage.png)
**Tip**: `vendor/bin/phpunit --generate-configuration`
# License
This library is released under the [MIT license](LICENSE).