Plugin to auto-include adminer.js when present

Closes #8
This commit is contained in:
Roy-Orbison 2023-08-07 14:39:29 +09:30
parent 343b6bdac3
commit d07786bbb4

15
plugins/adminer.js.php Normal file
View file

@ -0,0 +1,15 @@
<?php
/** Enable auto-detection and inclusion of adminer.js, like adminer.css
* @author Roy Orbitson, https://github.com/Roy-Orbison
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerDotJs {
function head() {
$filename = 'adminer.js';
if (file_exists($filename)) {
echo script_src("$filename?v=" . crc32(file_get_contents($filename))), "\n";
}
}
}