Skip to content

Instantly share code, notes, and snippets.

@aiiddqd
Created October 1, 2018 15:55
Show Gist options
  • Save aiiddqd/42320e2356c8d78e98252aa0a86ec704 to your computer and use it in GitHub Desktop.
Save aiiddqd/42320e2356c8d78e98252aa0a86ec704 to your computer and use it in GitHub Desktop.
Adminer > 3.6.3 auto login for my Vagrant config
<?php
if(empty($_GET['username']) ){
$_GET['username'] = 'vagrant';
}
function adminer_object() {
class AdminerSoftware extends Adminer {
function credentials() {
return array('localhost', 'vagrant', 'password');
}
function database() {
// database name, will be escaped by Adminer
return 'vagrant';
}
function login($login, $pass){
return true;
}
}
return new AdminerSoftware;
}
require_once './adminer.php';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment