From: Jakub Vrana Date: Mon, 8 Aug 2011 15:19:56 +0000 (+0200) Subject: New plugin: SQL log X-Git-Tag: v3.3.3~27 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=b96facf0af8257345bd88bba428fa6087dedd1a2;p=adminer.git New plugin: SQL log --- diff --git a/adminer/plugin.php b/adminer/plugin.php index 84198adb..082817d3 100644 --- a/adminer/plugin.php +++ b/adminer/plugin.php @@ -12,6 +12,7 @@ function adminer_object() { // specify enabled plugins here new AdminerDumpZip, new AdminerDumpXml, + //~ new AdminerSqlLog("past-" . rtrim(`git describe --tags --abbrev=0`) . ".sql"), //~ new AdminerEditCalendar("\n\n\n\n\n\n\n\n\n", "../externals/jquery-ui/ui/i18n/jquery.ui.datepicker-%s.js"), //~ new AdminerTinymce("../externals/tinymce/jscripts/tiny_mce/tiny_mce_dev.js"), //~ new AdminerWymeditor(array("../externals/wymeditor/src/jquery/jquery.js", "../externals/wymeditor/src/wymeditor/jquery.wymeditor.js", "../externals/wymeditor/src/wymeditor/jquery.wymeditor.explorer.js", "../externals/wymeditor/src/wymeditor/jquery.wymeditor.mozilla.js", "../externals/wymeditor/src/wymeditor/jquery.wymeditor.opera.js", "../externals/wymeditor/src/wymeditor/jquery.wymeditor.safari.js")), diff --git a/plugins/sql-log.php b/plugins/sql-log.php new file mode 100644 index 00000000..6310a73f --- /dev/null +++ b/plugins/sql-log.php @@ -0,0 +1,28 @@ +filename = $filename; + } + + function messageQuery($query) { + $fp = fopen($this->filename, "a"); + flock($fp, LOCK_EX); + fwrite($fp, $query); + fwrite($fp, "\n\n"); + flock($fp, LOCK_UN); + fclose($fp); + } + +}