';
$sqlcommandform = true;
/** @var $DBI helper_plugin_sqlite */
$DBI =& plugin_load('helper', 'sqlite');
if($_REQUEST['version'] == 'sqlite2') {
if(helper_plugin_sqlite_adapter::isSqlite3db($conf['metadir'].'/'.$_REQUEST['db'].'.sqlite')) {
msg('This is a database in sqlite3 format.', 2);
msg(
'This plugin needs your database file has the extension ".sqlite3"
instead of ".sqlite" before it will be recognized as sqlite3 database.', 2
);
$form = new Doku_Form(array('method'=> 'post'));
$form->addHidden('page', 'sqlite');
$form->addHidden('sqlite_rename', 'go');
$form->addHidden('db', $_REQUEST['db']);
$form->addElement(form_makeButton('submit', 'admin', sprintf($this->getLang('rename2to3'), hsc($_REQUEST['db']))));
$form->printForm();
if($DBI->existsPDOSqlite()) $sqlcommandform = false;
} else {
if($DBI->existsPDOSqlite()) {
$sqlcommandform = false;
msg('This is a database in sqlite2 format.', 2);
if($DBI->existsSqlite2()) {
$form = new Doku_Form(array('method'=> 'post'));
$form->addHidden('page', 'sqlite');
$form->addHidden('sqlite_convert', 'go');
$form->addHidden('db', $_REQUEST['db']);
$form->addElement(form_makeButton('submit', 'admin', sprintf($this->getLang('convert2to3'), hsc($_REQUEST['db']))));
$form->printForm();
} else {
msg(
'Before PDO sqlite can handle this format, it needs a conversion to the sqlite3 format.
Because PHP sqlite extension is not available,
you should manually convert "'.hsc($_REQUEST['db']).'.sqlite" in the meta directory to "'.hsc($_REQUEST['db']).'.sqlite3".
See for info about the conversion '.$this->external_link('http://www.sqlite.org/version3.html').'.', -1
);
}
}
}
} else {
if(!$DBI->existsPDOSqlite()) {
$sqlcommandform = false;
msg('A database in sqlite3 format needs the PHP PDO sqlite plugin.', -1);
}
}
if($sqlcommandform) {
echo '