brunetton / adminer-tables_fuzzy_search

Adminer plugin for fuzzy search (filter) in tables list
1 stars 0 forks source link
adminer fuzzy-search

Presentation

AdminerTablesFuzzySearch is a plugin for Adminer that add a fuzzy search function on current DB tables. This is really useful when working on hudge databases with tons of tables.

screenshot

Usage

Installation

  1. Download and install Adminer tool

  2. Create plugins folder next to adminer.php

  3. Download plugins.php, this file is needed to load plugins; and place it into plugins folder

  4. Download adminer-tables_fuzzy_search.php and place it into plugins folder

    File structure will be:

    - adminer.php
    - plugins
        - plugin.php
        - adminer-tables_fuzzy_search.php
        - ... (other plugins you've already installed)
  5. Edit or create index.php file next to adminer.php and configure plugins and add new AdminerTablesFuzzySearch() to $plugins array :

<?php

    function adminer_object()
    {
        // required to run any plugin
        include_once "./plugins/plugin.php";

        // autoloader
        foreach (glob("plugins/*.php") as $filename) {
            include_once "./$filename";
        }

        $plugins = array(
            // specify enabled plugins here
            new AdminerTablesFuzzySearch(),
        );

        return new AdminerPlugin($plugins);
    }

    // include original Adminer or Adminer Editor
    include "./adminer.php";

Final file structure will be:

- adminer.php
- index.php
- plugins
    - plugin.php
    - adminer-tables_fuzzy_search.php
    - ...

Credits

All fuzzy search is done with the excellent Ben Ripkens's fuzzy.js library.