-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adminer-pematon: init at 4.12 #358530
adminer-pematon: init at 4.12 #358530
Conversation
8cf5626
to
b68d27a
Compare
@@ -0,0 +1,35 @@ | |||
<?php | |||
|
|||
namespace nixos { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opinionated: I would modify this into something more functional, like:
<?php
declare(strict_types=1);
namespace nixos {
use AdminerPlugin;
use function sprintf;
function adminer_object(): object
{
require_once __DIR__ . '/plugins/plugin.php';
if (!file_exists(__DIR__ . '/plugins.json')) {
return new AdminerPlugin();
}
$plugins = array_map(
static function (string $name): ?object {
$plugin = sprintf('%s/plugins/%s.php', __DIR__, $name);
if (!is_readable($plugin)) {
return null;
}
require $plugin;
preg_match_all('/(\w+)/', $name, $matches);
return new sprintf('Adminer%s', implode('', array_map('ucfirst', $matches[1])));
},
json_decode(file_get_contents(sprintf('%s/plugins.json', __DIR__), true))
);
return new AdminerPlugin(array_filter($plugins));
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks, tested and it works.
One thing I might add though, do you know perhaps a way to override to use adminer-theme?
I am currently removing the index.php provided by this package, and adding an index.php with modifications for adminer theme.
This is an active fork of adminer by pematon. Seems to be in rapid development. The index.php is required for plugins to work, and the upstream provides an example, but not a ".php" file. We need to modify it for NixOS use anyway. Co-authored-by: Pol Dellaiera <[email protected]> Signed-off-by: John Titor <[email protected]>
b68d27a
to
33f9043
Compare
Successfully created backport PR for |
Link: https://github.com/pematon/adminer
This is an active fork of adminer by pematon.
Seems to be in rapid development.
The index.php is required for plugins to work, and the upstream provides an example, but not a ".php" file in the src. We need to modify it for NixOS use anyway.
The index.php file is the same one used by
adminerevo
, I wasn't sure if I should reference a file out of the package's dir, so I copied it here.Closes #353454
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.