0

I'm trying to use the single-file Adminer version (this one to be specific) from my codebase. That codebase is needed to perform some checks before accessing Adminer.

Composer autoloading in my application leads to the following issue when trying to use Adminer: Fatal error: Cannot redeclare h() (previously declared in /usr/local/apache2/htdocs/apps/vb/vendor/cakephp/core/functions.php:41

I tried to rename h() in the adminer file to something like h_adminer(), but then the stylesheet seems to become corrupt (maybe charset related?).

Some of my classes need to be loaded, so I can't just get rid of the autoloader, or I'd need to manually load all classes & dependencies I need (not ideal).

Any suggestions to best deal with this issue are most welcome. Thanks!

GlennM
  • 300
  • 1
  • 14
  • So you are _not_ trying to use it stand-alone, but have it "embedded" into your cakephp application somehow? – CBroe Oct 05 '22 at 08:01
  • @CBroe Yes, I'm accessing the single-file version but need some additional checks from my application to be done before accessing it. – GlennM Oct 05 '22 at 08:06
  • Add namespace to Adminer all classes and functions, then you will not have that issue – Justinas Oct 05 '22 at 08:12
  • @Justinas Editing the file to include namespacing still gives the same issue with the CSS, so I think that's the main issue to resolve. `?file=default.css&version=4.8.1` doesn't return readable CSS anymore. – GlennM Oct 05 '22 at 08:29

0 Answers0