From b96facf0af8257345bd88bba428fa6087dedd1a2 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 8 Aug 2011 17:19:56 +0200 Subject: [PATCH] New plugin: SQL log --- adminer/plugin.php | 1 + plugins/sql-log.php | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 plugins/sql-log.php 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); + } + +}