geeksltd / pangolin.symfony
api for pangolin
Installs: 1 520
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=8.1
- ext-apcu: *
- api-platform/core: ^3.0
- composer/package-versions-deprecated: 1.11.99.2
- doctrine/annotations: ^1.0
- doctrine/doctrine-bundle: ^2.4
- doctrine/doctrine-fixtures-bundle: ^3.4
- doctrine/doctrine-migrations-bundle: ^3.1
- doctrine/orm: ^2.9
- nelmio/cors-bundle: ^2.1
- phpdocumentor/reflection-docblock: ^5.3
- symfony/asset: ^6.1
- symfony/cache: ^6.1
- symfony/expression-language: ^6.1
- symfony/flex: ^2
- symfony/framework-bundle: ^6.1
- symfony/property-access: ^6.1
- symfony/property-info: ^6.1
- symfony/proxy-manager-bridge: ^6.1
- symfony/security-bundle: ^6.1
- symfony/serializer: ^6.1
- symfony/twig-bundle: ^6.1
- symfony/uid: ^6.1
- symfony/validator: ^6.1
README
Tutorial on how to install apcu on windows machine
Make sure to install these packages first
composer req annotation api
Install the package through composer
composer require geeksltd/pangolin.symfony --dev
Enable pangolin bundle in your config/bundles.php file
Simply add this PangolinBundle class to the array as bellow.Pangolin bundle only is available on dev and test environment.
// config/bundles.php return [ Geeks\Pangolin\PangolinBundle::class => ['dev' => true, 'test' => true], ];
This Project contains controllers and routes. you must enable pangolin routes in your main routes.yaml file
# config/routes.yaml pangolin_bundle: resource: '@PangolinBundle/Resources/config/routes.yaml'
Enable Debug menu in your symfony application
{% include '@Pangolin/debug/debug.html.twig' %}
-----------------------------------------------------------
! Important note : Make sure to create a database that ends with .temp
. it is a must in this package.Otherwise, following api won't work
-----------------------------------------------------------
Available apis
1 )GET /cmd/db-restart
This api drops and recreates the current the database and runs all migrations and fixtures.
Response Examples :
{ "message": "All operations successfully completed", "status": true }
Or
{ "message": "Database name does not contain .temp suffix", "status": false }
-----------------------------------------------------------
2 )GET /cmd/get-db-changes
Get the latest executed sql queries. all the queries will be wiped out once the api is called
Response Examples :
{ "data": [ { "log": "INSERT INTO product (title, code, type) VALUES ('product_name', 'code1', 'car')" }, { "log": "INSERT INTO user (title) VALUES ('ranger')" } ] }
Or
{ "data": null }
-----------------------------------------------------------
3 )POST /cmd/db-run-changes
This api expects the previous json response above as a json request and runs all the queries. Make sure to add Content-Type : application/json in your header.
Response Examples :
{ "message": "All queries have been executed successfully", "status": true }
-----------------------------------------------------------
4 )GET /cmd/outbox
This route displays a list of available mails in the database based on interface implemented by an entity
-----------------------------------------------------------
5 )GET /cmd/local-date?date=2/2/2021&time=20:20:20
This api expects a get request
Response Examples :
{ "message": "Local time has been updated.", "status": true, "data": "2/2/2021 20:20:20" }