Menu

Best way to embed Adminer in a separate php application

Developers
2019-12-03
2020-01-30
  • Gaetano Giunta

    Gaetano Giunta - 2019-12-03

    Hello
    I am the developer behind a multi-database-sql-testing tool: https://github.com/gggeek/db-3v4l
    Although it is still pretty rough, it is now at the point where it could benefit from having some kind of GUI.
    Since I am a great fan of Adminer, I thought I would incorporate it as part of the web interface.
    I have started looking at the existing Adminer plugins, and it seems that by making make use of some of them, I could achieve the level of customisation that I want (eg. customizing the list of available db servers, allow data dump and import in different formats, etc...).
    However, I am a bit reluctant to include both adminer and the plugins as 'binary drops' in my codebase, as I would have to update them manually whenever there is a new version released.
    I have tried installing Adminer using Composer, which would be much nicer for both build automation and me being able to understand the adminer code and trobleshoot problems.
    Unfortunately, on 1st attempt (of install via composer), all I got was a fatal error for a missing page_footer function, and looking at the adminer source code it seemed to hint heavily that composer installation is tuned for developers of adminers itself (and hence not suited for embedding it in a 3rd party app).

    What would you recommend for this scenario?

     
  • Gaetano Giunta

    Gaetano Giunta - 2019-12-07

    Status update: for now, I went with embedding in my app the single-file version of Adminer, along with a couple of plugins.

    As an enhancement, I'm thinking to add in the future a php/shell script to run automatically on exection of composer update (a post-update script) to check if a new version of adminer is available and if so to download and install it automatically...

    In the meanwhile, I do keep around the source-code version as well, installed via composer, as it is useful for troubleshooting / debugging the integration.

     
  • Jakub Vrána

    Jakub Vrána - 2020-01-30

    The Composer package is mainted by a community, not me. I personally use Git submodules for including other projects.

     

Log in to post a comment.