Skip to content

Plugin for Adminer to format binary-formatted uuids to human-readable format.

License

Notifications You must be signed in to change notification settings

burithetech/adminer-uuid-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Uuid support for Adminer

Plugin for Adminer to convert binary-stored UUIDs to human-readable UUID format.

Tested on Adminer for MySQL 4.8.1 with MariaDB. Needs PHP 7.4 or newer.

Features

  • Converts binary-stored UUIDs to human-readable format in Select view.
  • Support for search human-readable UUID format in Search section.
  • Can be restricted for what columns can be used
    • by table names (reg-ex)
    • by column names (reg-ex)
    • by column types (reg-ex)
    • by column comment (reg-ex)
    • By default this plugin is applied to all binary(16) columns.
  • Optional conversion to lowercase or uppercase human-readable UUID format.

Known limitations (future improvements)

  • Support for "IN" (multiple IDs) in search & better sanitizing
  • Support for quick-edit
  • Support for edit

Screenshot

Screenshot

Default options

<?php
$options = [
    'convert_to_lowercase' => true,
    'applicable_to' => [
        'table_names' => '/.*/',
        'column_names' => '/.*/',
        'column_types' => '/^binary\(16\)$/i',
        'comments' => '/.*/'
    ],
];

Setup

Due to original AdminerPlugin limitations this plugin needs to extend original Adminer class and then can be used by AdminerPlugin which should extends from this AdminerUuidPlugin.

Setup without plugin.php

  1. Download original adminer.php
  2. Download this plugin
  3. Create index.php in the same directory with this code:
<?php
function adminer_object() {
    include_once "./AdminerUuidPlugin.php";
    
    return new AdminerUuidPlugin();
}

// Original Adminer
include_once "./adminer.php";

Setup with plugin.php

  1. Download original adminer.php
  2. Download original plugins/plugin.php
  3. Create index.php in the same directory with code from official Adminer plugin documentation.
  4. Modify plugins/plugin.php to extend it from AdminerUuidPlugin instead of Adminer itself.
class AdminerPlugin extends AdminerUuidPlugin {
// ...

About

Plugin for Adminer to format binary-formatted uuids to human-readable format.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages