1<?php 2/** 3 * DokuWiki Plugin randomtable (Helper Component) 4 * 5 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 6 * @author Oscar Merida <oscar@oscarm.org> 7 */ 8class helper_plugin_randomtables_helper extends \dokuwiki\Extension\Plugin 9{ 10 public function getDB(): ?helper_plugin_sqlite 11 { 12 /** @var helper_plugin_sqlite $sqlite */ 13 $sqlite = plugin_load('helper', 'sqlite'); 14 15 if(!$sqlite){ 16 msg('This plugin requires the sqlite plugin. Please install it', -1); 17 return null; 18 } 19 // initialize the database connection 20 if(!$sqlite->init('randomtables', DOKU_PLUGIN . 'randomtables/db/')){ 21 return null; 22 } 23 24 return $sqlite; 25 } 26} 27 28