Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 35 lines 728 B view raw
1<?php 2 3namespace nixos { 4 function adminer_object() { 5 require_once(__DIR__ . '/plugins/plugin.php'); 6 7 $plugins = []; 8 if (file_exists(__DIR__ . '/plugins.json')) { 9 $names = json_decode(file_get_contents(__DIR__ . '/plugins.json'), true); 10 11 foreach ($names as $name) { 12 $plugin = __DIR__ . '/plugins/' . $name . '.php'; 13 if (is_readable($plugin)) { 14 require($plugin); 15 16 preg_match_all('/(\w+)/', $name, $matches); 17 18 $className = 'Adminer'. implode('', array_map('ucfirst', $matches[1])); 19 20 $plugins[] = new $className; 21 } 22 } 23 } 24 25 return new \AdminerPlugin($plugins); 26 } 27} 28 29namespace { 30 function adminer_object() { 31 return \nixos\adminer_object(); 32 } 33 34 require(__DIR__ . '/adminer.php'); 35}