Some cleanup and text improvements

This commit is contained in:
Thomas Hooge 2023-12-01 11:39:55 +01:00
parent de6644302c
commit 399e977b82
10 changed files with 30 additions and 80 deletions

View File

@ -1,35 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View File

@ -1,17 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*~

19
README
View File

@ -1,8 +1,22 @@
sqlquery Plugin for DokuWiki sqlquery Plugin for DokuWiki
Processing query to mysql database and display results as a table. Processing queries to databases and display results as a table.
All documentation for this plugin can be found at This is a improved version which can connect to different hosts
and databases. The defaults are set in the plugin configuration.
Different types, hosts and databases can be set inside the tag:
<sql type=mysql host=myhost db=mydb>
SELECT foo FROM bar ORDER BY baz
<sql>
For security reasons the credentials for database access are only
stored in the main plugin configuration. At the moment there is
only one user configurable so for access to multiple servers.
So the user and password mast be the same across the servers.
Based on sqlquery-plugin from George Pirogov, original documentation
for that base plugin can be found at
https://www.dokuwiki.org/plugin:sqlquery https://www.dokuwiki.org/plugin:sqlquery
If you install this plugin manually, make sure it is installed in If you install this plugin manually, make sure it is installed in
@ -13,6 +27,7 @@ Please refer to http://www.dokuwiki.org/plugins for additional info
on how to install plugins in DokuWiki. on how to install plugins in DokuWiki.
---- ----
Copyright (C) Thomas Hooge <thomas@hoogi.de>
Copyright (C) George Pirogov <i1557@yandex.ru> Copyright (C) George Pirogov <i1557@yandex.ru>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify

View File

@ -1,13 +0,0 @@
# sqlquery
A dokuwiki plugin for processing query to MySQL databases and display results as a table.
This is a improved version which cann connect to different hosts
and databases. The defaults are set in the plugin configuration.
Different types, hosts and databases can be set inside the tag:
```
<sql type=mysql host=myhost db=mydb>
SELECT foo FROM bar ORDER BY baz
<sql>
```
More information at https://www.dokuwiki.org/plugin:sqlquery

View File

@ -8,8 +8,8 @@
// keys need to match the config setting name // keys need to match the config setting name
$lang['type'] = 'DSN-Prefix (Datenbanktyp)'; $lang['type'] = 'DSN-Prefix (Datenbanktyp)';
$lang['Host'] = 'Standard MySQL-Serveradresse (DNS or IP)'; $lang['Host'] = 'Standard-Serveradresse (DNS oder IP)';
$lang['DB'] = 'Standard MySQL-Datenbankname'; $lang['DB'] = 'Standard-Datenbankname';
$lang['user'] = 'Datenbankbenutzername'; $lang['user'] = 'Datenbankbenutzername';
$lang['password'] = 'Datenbankkennwort'; $lang['password'] = 'Datenbankkennwort';

View File

@ -9,8 +9,8 @@
// $lang['fixme'] = 'FIXME'; // $lang['fixme'] = 'FIXME';
$lang['type'] = 'DSN prefix (database type)'; $lang['type'] = 'DSN prefix (database type)';
$lang['Host'] = 'Default MySQL server address (DNS or IP)'; $lang['Host'] = 'Default server address (DNS or IP)';
$lang['DB'] = 'MySQL database name'; $lang['DB'] = 'Default database name';
$lang['user'] = 'Database username'; $lang['user'] = 'Database username';
$lang['password'] = 'Database password'; $lang['password'] = 'Database password';

View File

@ -9,8 +9,8 @@
// $lang['fixme'] = 'FIXME'; // $lang['fixme'] = 'FIXME';
$lang['type'] = 'Префикс DSN (тип базы данных)'; $lang['type'] = 'Префикс DSN (тип базы данных)';
$lang['Host'] = 'Адрес MySQL сервера по умолчанию (DNS или IP)'; $lang['Host'] = 'Адрес сервера по умолчанию (DNS или IP)';
$lang['DB'] = 'Имя базы данных MySQL по умолчанию'; $lang['DB'] = 'Имя базы данных по умолчанию';
$lang['user'] = 'Логин'; $lang['user'] = 'Логин';
$lang['password'] = 'Пароль'; $lang['password'] = 'Пароль';

View File

@ -1,7 +1,6 @@
base sqlquery base sqlquery
author George Pirogov author Thomas Hooge
email i1557@yandex.ru email thomas@hoogi.de
date 2018-12-12 date 2023-12-01
name SQL query plugin (multidb) name SQL query plugin (multidb)
desc Processing query to mysql database and display results as a table. desc Processing queries to databases and display results as a table.
url https://www.dokuwiki.org/plugin:sqlquery

View File

@ -85,11 +85,11 @@ class syntax_plugin_sqlquery extends DokuWiki_Syntax_Plugin {
$password = $this->getConf('password'); $password = $this->getConf('password');
// connect to database // connect to database
$dsn = "{$data['type']}:host={$data['host']};dbname={$data[db]};charset=UTF-8;"; $dsn = "{$data['type']}:host={$data['host']};dbname={$data[db]};charset=UTF8;";
try { try {
$dbh = new PDO($dsn, $user, $password); $dbh = new PDO($dsn, $user, $password);
} catch (PDOException $e) { } catch (PDOException $e) {
$renderer->doc .= "<pre>Unable to connect ro database:" . $e->getMessage() . "</pre>\n"; $renderer->doc .= "<pre>Unable to connect to database:" . $e->getMessage() . "</pre>\n";
return true; return true;
} }
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);