DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:sql

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:sql [2012-01-23 09:57] – [Installation] added link also to repository 194.25.90.65plugin:sql [2024-02-01 18:54] (current) 2a01:190:5:1001:af4e:b82e:cc0a:bede
Line 6: Line 6:
 email      : slim.amamou@gmail.com email      : slim.amamou@gmail.com
 type       : syntax type       : syntax
-lastupdate : 2007-05-07+lastupdate : 2023-06-14
 compatible :  compatible : 
 depends    :  depends    : 
Line 13: Line 13:
 tags       : database search mysql sqlite  tags       : database search mysql sqlite 
  
-downloadurl: http://github.com/lupo49/plugin-sql/tarball/master +downloadurl: https://github.com/ALIXSYS/plugin-sql/archive/master.zip 
-sourcerepo:  https://github.com/lupo49/plugin-sql +sourcerepo:  https://github.com/ALIXSYS/plugin-sql 
-bugtracker:  https://github.com/lupo49/plugin-sql/issues+bugtracker:  https://github.com/ALIXSYS/plugin-sql/issues
 ---- ----
 +__The file //plugin.info.txt// is not up to date! And //issues// are not enabled in the repository! Please fix this!__
  
 ===== Installation ===== ===== Installation =====
  
-^  Download   | [[http://github.com/lupo49/plugin-sql/tarball/master|Current archive from github]] | +^  Download   | [[https://github.com/ALIXSYS/plugin-sql/archive/master.zip|Current archive from github]] | 
-^  Repository | [[https://github.com/lupo49/plugin-sql/|Repository on github]] |+^  Repository | [[https://github.com/ALIXSYS/plugin-sql|Repository on github]] |
  
 Use this address to install this plugin by using the plugin manager. Use this address to install this plugin by using the plugin manager.
Line 27: Line 28:
 ==== Requirements ==== ==== Requirements ====
  
-  * [[http://pear.php.net/package/DB|PEAR::DB]] +  * <del>[[http://pear.php.net/package/DB|PEAR::DB]]</del> (Not Anymore) 
-  * On Debian Etch (4.0) hosts install the packages: ''mysql-client php-pear php-db php5-mysql''+  * php-pdo
  
  
Line 73: Line 74:
  
 ==== Changelog ==== ==== Changelog ====
-{{rss>http://github.com/lupo49/plugin-sql/commits/master.atom date}}+{{rss>https://github.com/ALIXSYS/plugin-sql/commits/master.atom date}}
  
 (Old) (Old)
Line 91: Line 92:
   * <del>add an ''inline mode'' for the query result tables, so we can save space displaying them aligned horizontally.</del> --- done.   * <del>add an ''inline mode'' for the query result tables, so we can save space displaying them aligned horizontally.</del> --- done.
   * make it trait multiple queries as a transaction.   * make it trait multiple queries as a transaction.
-  * refactor to use [[http://pear.php.net/package/MDB2|MDB2]] instead of DB.+  * <del>refactor to use [[http://pear.php.net/package/MDB2|MDB2]] instead of DB.</del>
   * <del>have the use of charsets like utf8 or latin1 available</del>   * <del>have the use of charsets like utf8 or latin1 available</del>
 +  * Set the db name, user name and password in the plugin configuration page not the wiki page to remove this information from public view, eg in config set comma separated triplets : mydb1:username1:password1, mydb2:username2,password2. Then the wiki page tag can just refer to which db. The user name and password can be pulled from the connection page to set up the connection keeping the connection more secure.
  
 ===== Known Bugs ===== ===== Known Bugs =====
Line 127: Line 129:
 </code> </code>
  
-**You have to install the [[http://pear.php.net/package/DB|PEAR::DB]] package.**+<del>You have to install the [[http://pear.php.net/package/DB|PEAR::DB]] package. 
 +</del> 
 + 
 +This is not an issue anymore since today  --- [[user>slim|slim]] //2018-11-23 00:38//
  
 ==== Can I use it for Oracle-Queries? ==== ==== Can I use it for Oracle-Queries? ====
Line 157: Line 162:
  
 My DokuWiki platform is Windows 2003 + IIS + PHP 5.2.4. To get the connection to MS SQL Server you need these: My DokuWiki platform is Windows 2003 + IIS + PHP 5.2.4. To get the connection to MS SQL Server you need these:
-  * PHP Extensions: [[http://en.wikipedia.org/wiki/PHP_Extension_Community_Library|PECL]] and [[http://en.wikipedia.org/wiki/PHP_Extension_Community_Library#External_links|PEAR]].+  * PHP Extensions: [[wp>PHP_Extension_Community_Library|PECL]] and [[wp>PHP_Extension_Community_Library#External_links|PEAR]].
   * Im sorry I cannot describe the PECL-installation here. I installed it simultaneously with PHP.   * Im sorry I cannot describe the PECL-installation here. I installed it simultaneously with PHP.
   * PEAR is installed in command prompt((DOS-window)) with ''go-pear.bat'' in ''C:\php''.   * PEAR is installed in command prompt((DOS-window)) with ''go-pear.bat'' in ''C:\php''.
Line 164: Line 169:
   * Check installed PEAR components with: ''PEAR.php list''   * Check installed PEAR components with: ''PEAR.php list''
     * See here for more: [[http://www.easysoft.com/developer/languages/php/pear-db-odbc.html]].     * See here for more: [[http://www.easysoft.com/developer/languages/php/pear-db-odbc.html]].
 +    * Alternatively you can use this [[https://devart.com/odbc/sqlserver/|SQL Server ODBC driver]] here is the  [[https://www.devart.com/odbc/sqlserver/docs/driver_configuration_and_conne.htm|connectivity guide]]
   * Edit PHP.ini to match this:   * Edit PHP.ini to match this:
 <code> <code>
Line 222: Line 228:
      * plugin should use this method to register its handlers with the dokuwiki's event controller      * plugin should use this method to register its handlers with the dokuwiki's event controller
      */      */
-    function register(&$controller) {+    function register(Doku_Event_Handler $controller) {
       $controller->register_hook('ACTION_HEADERS_SEND', 'BEFORE',  $this, 'sql_headers', NULL);       $controller->register_hook('ACTION_HEADERS_SEND', 'BEFORE',  $this, 'sql_headers', NULL);
     }     }
Line 238: Line 244:
 \\ You'll probably need some more logic in the code to determine if the page has any SQL syntax.  The best way to handle that is most likely to utilize the page's [[metadata]] - have your syntax plugin write some metadata concerning the page and its SQL use or its caching requirement and then have the action plugin check the metadata before deciding whether or not to send additional headers. --- //[[chris@jalakai.co.uk|Christopher Smith]] 2006-05-22 11:30// \\ You'll probably need some more logic in the code to determine if the page has any SQL syntax.  The best way to handle that is most likely to utilize the page's [[metadata]] - have your syntax plugin write some metadata concerning the page and its SQL use or its caching requirement and then have the action plugin check the metadata before deciding whether or not to send additional headers. --- //[[chris@jalakai.co.uk|Christopher Smith]] 2006-05-22 11:30//
  
-> I found the problem in [[http://dev.splitbrain.org/reference/dokuwiki/inc/parserutils.php.source.html#l26|p_cached_xhtml()]]. it is trying to get cached instructions unconditionally (ignoring ''$info['cache']''). for me it's a bug : it does not make sense to use cached instructions when it's explicitly asked to not use cache at all. what do you think? (BTW [[http://dev.splitbrain.org/reference/dokuwiki/inc/parserutils.php.source.html#l65|p_cached_instructions()]] is called with ''$info'' as it's third argument when it is declared with only two arguments) --- //[[slim.amamou@gmail.com|Slim Amamou]] 2006-05-23 01:12//+> I found the problem in [[xref>p_cached_xhtml()]]. it is trying to get cached instructions unconditionally (ignoring ''$info['cache']''). for me it's a bug : it does not make sense to use cached instructions when it's explicitly asked to not use cache at all. what do you think? (BTW [[xref>p_cached_instructions()]] is called with ''$info'' as it's third argument when it is declared with only two arguments) --- //[[slim.amamou@gmail.com|Slim Amamou]] 2006-05-23 01:12//
 >> Not a bug. Instructions should be cacheable. ''$info['cache']'' is a renderer value and doesn't exist in the handler. If you need to do something every time the page is required, do it in the render function and standardize the instruction generated by the handle function.  In your case, you might create the SQL statements in the handle() function and then use them to retrieve the data and format it for output in the render() function. --- //[[chris@jalakai.co.uk|Christopher Smith]] 2006-05-23 01:31// >> Not a bug. Instructions should be cacheable. ''$info['cache']'' is a renderer value and doesn't exist in the handler. If you need to do something every time the page is required, do it in the render function and standardize the instruction generated by the handle function.  In your case, you might create the SQL statements in the handle() function and then use them to retrieve the data and format it for output in the render() function. --- //[[chris@jalakai.co.uk|Christopher Smith]] 2006-05-23 01:31//
 >>> Thanks Christopher for your help, the problem is now corrected.  --- //[[slim.amamou@gmail.com|Slim Amamou]] 2006-05-27 00:21// >>> Thanks Christopher for your help, the problem is now corrected.  --- //[[slim.amamou@gmail.com|Slim Amamou]] 2006-05-27 00:21//
Line 257: Line 263:
  
 When I view the source of the page (the HTML source, not the wiki source) I see every cell has a new paragraph inside of it.  This causes a lot of extra whitespace that I don't want (the cells get too big and I have to scroll, lines wrap...).  This goes away if I disable wikitext.  What's happening, and can I disable it while keeping wikitext parsing? --- //[[baron no spam at sequent dot org|Baron]] 2009-09-27// When I view the source of the page (the HTML source, not the wiki source) I see every cell has a new paragraph inside of it.  This causes a lot of extra whitespace that I don't want (the cells get too big and I have to scroll, lines wrap...).  This goes away if I disable wikitext.  What's happening, and can I disable it while keeping wikitext parsing? --- //[[baron no spam at sequent dot org|Baron]] 2009-09-27//
- 
  
  
  
plugin/sql.1327309070.txt.gz · Last modified: 2012-01-23 09:57 by 194.25.90.65

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki