Giter VIP home page Giter VIP logo

communicationbundle's Introduction

PetStoreBundle Codacy Badge

This repository is for creating PHP Symfony flex bundles. The Common Gateway ecosystem uses this template for rapid development to extend Gateway functionlity outside of the Core.

The first section is about installing plugins. The latter part is about custom plugins to extend Common Gateway functionality.

Installation with the Common Gateway admin user-interface

Once a bundle is set up correctly (like this repository), the Common Gateway can discover the bundle without additional configuration. Head to the Plugins tab to search, select and install plugins.

Installing with PHP commands

To execute the following command, you will need Composer or a dockerized installation that already has PHP and Composer.

The Composer method in the terminal and root folder:

for the installation of the plugin

$composer require common-gateway/pet-store-bundle:dev-main

for the installation of schemas

`$php bin/console commongateway:install common-gateway/pet-store-bundle

The dockerized method in the terminal and root folder:

for the installation of the plugin

$docker-compose exec php composer require common-gateway/pet-store-bundle:dev-main

for the installation of schemas

$docker-compose exec php bin/console commongateway:install common-gateway/pet-store-bundle


Creating your Bundle

This section is for developers who want to build plugins to extend Common Gateway functionality without adding to the core codebase.

The following knowledge is assumed and/or installed:

Composer Packagist Docker Schema.json Basic knowledge of the Common Gateway

Using this template

This template is for rapid Symfony bundle development and meant as a model to base your custom plugin on. Follow the next steps to create your plugin within 45 minutes or less

  1. Login on GitHub

  2. Use this template

  3. Name your Bundle (CamelCase). The bundle needs to end with Bundle as per Symfony naming conventions.

  4. Press the green button Create repository from template

  5. Update file names and namespace to your fitting :

    • Open composer.json, and change the name to your fitting. The first word should be the namespace, and the second the bundle's name.

    Note: this is kebab-case. Also read: naming your package

    • Check the autoload field to be set accordingly.
    • Open PetStoreBundle.php and change the Bundle name and namespace. The namespace should be the same as your package name in composer.json but in CamelCase. So common-gateway/pet-store-bundle becomes CommonGateway/CommunicationBundle
    • Rename the /Service and /ActionHandler accordingly (or delete if not used).
    • Rename the /DependencyInjection/PetStoreExtension.php to your BundleNameExtension.php
    • Rename the /Resources/config/services.yaml namespaces

Adding schemas

You can load json schemas as Entities from your /Schema folder to use in the Common Gateway and work with objects based on your schemas.

You can add existing schemas or create your own and add them to the/Schema folder. There is an example shown here in /Schema/example.json.

The following properties are required, and without them, the Gateway won't recognize the schema as valid:

- `version` can start on '0.1.0.' 

without this property, you can't update schemes

- `$schema` (https://json-schema.org/draft/2020-12/schema)
- `$id` (https://opencatalogi.nl/{Your scheme name}.schema.json)

Unique $id to be relatable to other schemas.

- `type` must be 'object'
- `properties` must be schema properties

Once you add schemas to the repository, you can also add objects/data for those schemas. There is an example shown in the /Data folder.

communicationbundle's People

Contributors

rubenvdlinde avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.