sfDbQuickAccessPlugin - 0.9.0

Admin interface for quick database access.

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source

sfDbQuickAccess plugin

The sfDbQuickAccessPlugin is a symfony plugin that provides an easy interface to quickly find and access tables from your configured database(s).

Features

  • Searching for tables and table fields by names or partial names
  • Deep linking to a web based database admin interface, such as phpmyadmin
  • Perfectly combinable with keyword search in browsers like firefox to jump directly to table structures and db-admin (so typing something like db product into your browser leads you directly to a list of tables containing the string "product" with instant access to their structure and searching/modification possibilities)

So, in brief, this can simplify your life:

  • if you have databases with many tables
  • if you often have to check
    • which fields a table contains
    • which tables exist in your db (with a certain name pattern)
    • which fields exist in your db with a certain name pattern
  • if you often have to search or modify data directly in your database

Installation

  • Install the plugin (via a package)

    symfony plugin:install sfDbQuickAccessPlugin
    
  • Activate the plugin in the config/ProjectConfiguration.class.php

    class ProjectConfiguration extends sfProjectConfiguration
    {
      public function setup()
      {
        $this->enablePlugins(array(
          ... 
          'sfDbQuickAccessPlugin',
          ...
        ));
      }
    }
  • Enable the module in your backend (you don't want to use that in the frontend!) in apps/backend/config/settings.yml so you can access the search interface in your app

    all:
      .settings:
        enabled_modules: [..., sfDbQuickAccessSearch, ...]
    
  • Publish the plugin's assets (some styles, javascripts and icons) through

    symfony plugin:publish-assets
    
  • Configure your admin type and admin base path in apps/backend/config/app.yml

    all:
      (...)
      db_quick_access:
        # the type of admin (currently only phpmyadmin is supported)
        admin_type: phpmyadmin
        # the base path to your e.g. phpmyadmin    
        admin_base_path: https://www.yourdomain.com/phpmyadmin 
    
    dev:
      (...)
      db_quick_access:
        admin_base_path: http://127.0.0.1/phpmyadmin
    
    staging:
      (...)
      db_quick_access:
        admin_base_path: https://staging.yourdomain.com/phpmyadmin
    
  • Clear you cache

    symfony cc
    
  • Now the interface can be reached using the following url

    • http://path-to-your-symfony-backend/db-quick-access/search
  • Optional step: Add keyword searches to your browser, e.g.

    • Search table fields in your dev db, with a keyword such as flddev

      http://local.yourdomain.com/backend_dev.php/db-quick-access/search?database_name=your-db-name&search_substr=%S&search_type=search+field

    • Search tables in your prod db, with a keyword such as tblprod

      http://www.yourdomain.com/backend.php/db-quick-access/search?database_name=your-db-name&search_substr=%S&search_type=search+table

    Of course you have to adapt your paths and database name, depending on the environment. If you have only one database configured, you may omit the database name.

Warning: Be sure that you don't enable the module for a non secured app, to avoid making your database structure public!

Limitations

In its initial release it's only available for doctrine and has only phpMyAdmin (for MySQL) configured.