Skip to content

elgarfo/adminer-docker-mongodb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

adminer 5.3.0 docker image with mongodb support

original sources: https://github.com/TimWolla/docker-adminer/tree/51202fad34e0f5ec140451e9b6bdba9d1068e329

problem

setting ADMINER_PLUGINS=drivers/mongo does not work. loading other plugins from plugins/ works fine.

after disabling the sanity check in line 8 of plugin-loader.php, entrypoint.sh complains because it cannot write to directory plugins-enabled/001-drivers/. which is nothing to wonder about, as it does not exist. and even if that is fixed (by creating it beforehand), then plugin-loader.php will refuse to load the plugin because it contains more than one class.

my solution

adminer comes with its own plugin loading methods. if \Adminer\Plugins is instanced with null as parameter, it will load plugins automatically from adminer-plugins directory.

so i decided to:

  • change the plugin loading code in index.php and let adminer load plugins by itself. (see index.php line 26)
  • change entrypoint.sh to only call plugin-loader.php with the plugin name as parameter. (see entrypoint.sh line 14)
  • remove all the previous plugin-loader.php code (apart from the sanity checks at the top), and replace it with code that symlinks plugins-files from plugins/ to adminer-plugins/
  • add mongodb php extension installation commands to Dockerfile

result

using the demo compose.yml, and starting the container with docker compose up -d adminer, i can now successfully connect to mongodb and use other plugins too.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published