Developed with love by KnpLabs Hire us for your project!
10

data-dictionary

by mherrera05

Bundle to expose database composition as data dictionary.

Symfony Bundle

Packagist GitHub tag Codacy grade Packagist SensioLabsInsight

Introduction

Data Dictionary is a Symfony Bundle that offers database composition of project rendered as HTML format, making it easy for developers to read field name, data type and comments.

Requirements

  • PHP 5.3 or higher
  • Symfony 2.x or 3.x
  • Doctrine Symfony Bundle ~1.4
  • Doctrine ORM ^2.4.8
  • Twig ^1.0||^2.0

Installation & Usage

This is a Symfony Bundle with dependency on Doctrine, you can install it via composer.

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

$ composer require mherrera05/data-dictionary "dev-master"
รณ 
$ composer require mherrera05/data-dictionary ">=1.0"

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new DataDictionaryBundle\DataDictionaryBundle(),
        );

        // ...
    }

    // ...
}

Step 3: Import resources from Bundle

Import bundle resources adding resources in routing.yml.

data_dictionary:
    resource: "@DataDictionaryBundle/Resources/config/routing.yml"
    prefix:   /

If you prefer, you can add a prefix for URL.

Step 4: Add vendor templates

Add vendor templates directory as path in twig configuration config.yml.

twig:
    ...
    paths:
        '%kernel.root_dir%/../vendor/mherrera05/data-dictionary/Resources/views': 'DataDictionaryBundle'

Usage

Step 1: Import model to json files

Once installed and enabled the Bundle, you can execute the command:

$ php app/console data:dictionary:import {bundle-name}

This command will export database tables and fields composition to .json files.

Use the name of bundle where you want to put the json files. Example, Doctrine creates orm.yml from database on your base bundle.

Step 2: Call URL

Once files have been imported, just call the URL on web browser.

/app.php/data-dictionary
  • Merge branch 'release/v1.2.0'
    By Miguel, 9 months ago
  • Fixing Sension labs medal in markdown
    By Miguel, 9 months ago
  • Merge branch 'release/v1.2.0'
    By Miguel, 9 months ago
  • Fixed Sensio labs violations
    By Miguel, 9 months ago
  • Merge tag 'v1.1.2' into develop
    By mherrera05, 9 months ago
  • Merge branch 'hotfix/v1.1.2'
    By mherrera05, 9 months ago
  • Field comment validates if comment is in options parameters
    By mherrera05, 9 months ago
  • Merge branch 'develop'
    By Miguel, 9 months ago
  • Readme updated, codacy shield added and bundle name
    By Miguel, 9 months ago
  • Merge branch 'hotfix/v1.1.1' into develop
    By Miguel, 9 months ago
  • Merge branch 'hotfix/v1.1.1'
    By Miguel, 9 months ago
  • Readme updated, codacy corrections and shield added
    By Miguel, 9 months ago
  • Manages vendor twig in config file
    By Miguel, 9 months ago
  • Merge branch 'release/v1.1.0'
    By Miguel, 9 months ago
  • Merge branch 'feature/readme-build' into develop
    By Miguel, 9 months ago
  • Readme file finished
    By Miguel, 9 months ago
  • Building readme markdown file
    By Miguel, 9 months ago
  • Show view updated with decimal and longblob types
    By Miguel, 9 months ago
  • Merge branch 'hotfix/v1.0.1' into develop
    By Miguel, 9 months ago
  • Merge branch 'hotfix/v1.0.1'
    By Miguel, 9 months ago
  • Fixed composer
    By Miguel, 9 months ago
  • Merge branch 'develop'
    By Miguel, 9 months ago
  • Updating requeriments in composer
    By Miguel, 9 months ago
  • Updating composer for master brancg
    By Miguel, 9 months ago
  • Conflict resolved
    By Miguel, 9 months ago
  • Updating changes
    By Miguel, 9 months ago
  • Updating composer
    By Miguel, 9 months ago
  • Updating composer
    By Miguel, 9 months ago
  • Trying with composer
    By Miguel, 9 months ago
  • Merge branch 'release/v1.0.0'
    By Miguel, 9 months ago