From: <var...@us...> - 2022-01-27 11:58:55
|
Revision: 10948 http://sourceforge.net/p/phpwiki/code/10948 Author: vargenau Date: 2022-01-27 11:58:52 +0000 (Thu, 27 Jan 2022) Log Message: ----------- Remove PearDB_sqlite Modified Paths: -------------- trunk/locale/Makefile trunk/tests/unit/runme_all trunk/tests/unit/test.php Removed Paths: ------------- trunk/lib/WikiDB/backend/PearDB_sqlite.php Deleted: trunk/lib/WikiDB/backend/PearDB_sqlite.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_sqlite.php 2022-01-27 08:04:14 UTC (rev 10947) +++ trunk/lib/WikiDB/backend/PearDB_sqlite.php 2022-01-27 11:58:52 UTC (rev 10948) @@ -1,123 +0,0 @@ -<?php -/** - * Copyright © 2004 Matthew Palmer - * Copyright © 2004 Reini Urban - * - * This file is part of PhpWiki. - * - * PhpWiki is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * PhpWiki is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with PhpWiki; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * SPDX-License-Identifier: GPL-2.0-or-later - * - */ - -/** - * SQLite PearDB backend by Matthew Palmer - * The SQLite DB will gain popularity with the current MySQL vs PHP license drama. - * It's in core since PHP-5.0, MySQL not anymore. - * - * Initial setup: - * sqlite -init /tmp/phpwiki-sqlite.db - * sqlite /tmp/phpwiki-sqlite.db < schemas/sqlite.sql - */ - -require_once 'lib/WikiDB/backend/PearDB.php'; - -//TODO: create tables on virgin wiki -/* - $db = &new DB_sqlite(); - $db->connect($DBParams['dsn'], array('persistent'=> true) ); - $result = $db->query("CREATE TABLE $table (comment varchar(50), - datetime varchar(50));"); -*/ - -class WikiDB_backend_PearDB_sqlite - extends WikiDB_backend_PearDB -{ - /* - * Pack tables. - */ - function optimize() - { - return true; - // NOP - } - - /* - * Lock tables. - */ - protected function _lock_tables($write_lock = true) - { - // NOP - SQLite does all locking automatically - } - - /* - * Release all locks. - */ - protected function _unlock_tables() - { - // NOP - } - - /* - * Serialize data - */ - function _serialize($data) - { - if (empty($data)) - return ''; - assert(is_array($data)); - return base64_encode(serialize($data)); - } - - /* - * Unserialize data - */ - function _unserialize($data) - { - if (empty($data)) - return array(); - // Base64 encoded data does not contain colons. - // (only alphanumerics and '+' and '/'.) - if (substr($data, 0, 2) == 'a:') - return unserialize($data); - return unserialize(base64_decode($data)); - } - - // same as DB::getSpecialQuery('tables') - /* - function sqlite_list_tables (&$dblink) { - $tables = array (); - $sql = "SELECT name FROM sqlite_master WHERE (type = 'table')"; - if ($res = sqlite_query ($dblink, $sql)) { - while (sqlite_has_more($res)) { - $tables[] = sqlite_fetch_single($res); - } - } - return $tables; - } - */ - - function _table_exists(&$dblink, $table) - { - $sql = "SELECT count(name) FROM sqlite_master WHERE ((type = 'table') and (name = '$table'))"; - if ($res = sqlite_query($dblink, $sql)) { - return sqlite_fetch_single($res) > 0; - } else { - return false; // or throw exception - } - } - -} Modified: trunk/locale/Makefile =================================================================== --- trunk/locale/Makefile 2022-01-27 08:04:14 UTC (rev 10947) +++ trunk/locale/Makefile 2022-01-27 11:58:52 UTC (rev 10948) @@ -321,7 +321,6 @@ ${POT_FILE}: .././lib/WikiDB/backend/PearDB_oci8.php ${POT_FILE}: .././lib/WikiDB/backend/PearDB_pgsql.php ${POT_FILE}: .././lib/WikiDB/backend/PearDB.php -${POT_FILE}: .././lib/WikiDB/backend/PearDB_sqlite.php ${POT_FILE}: .././lib/WikiDB/backend.php ${POT_FILE}: .././lib/WikiDB/dba.php ${POT_FILE}: .././lib/WikiDB/file.php Modified: trunk/tests/unit/runme_all =================================================================== --- trunk/tests/unit/runme_all 2022-01-27 08:04:14 UTC (rev 10947) +++ trunk/tests/unit/runme_all 2022-01-27 11:58:52 UTC (rev 10948) @@ -7,7 +7,7 @@ fi for db in file dba SQL \ - PearDB_mysql PearDB_pgsql PearDB_sqlite \ + PearDB_mysql PearDB_pgsql \ PDO_mysql PDO_pgsql PDO_sqlite do php -Cq -d register_argc_argv=1 test.php debug=1 level=10 db=$db | \ Modified: trunk/tests/unit/test.php =================================================================== --- trunk/tests/unit/test.php 2022-01-27 08:04:14 UTC (rev 10947) +++ trunk/tests/unit/test.php 2022-01-27 11:58:52 UTC (rev 10948) @@ -85,7 +85,7 @@ 'dba', 'SQL', // default backend defined in the config.ini DSN // specific backends (need to be setup as db=test_phpwiki) - 'PearDB_pgsql', 'PearDB_sqlite', 'PearDB_mysql', + 'PearDB_pgsql', 'PearDB_mysql', ); if ((int)substr(phpversion(), 1) >= 5) array_push($database_backends, 'PDO_pqsql', 'PDO_sqlite', 'PDO_mysql'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |