|
From: <var...@us...> - 2021-08-06 14:42:29
|
Revision: 10454
http://sourceforge.net/p/phpwiki/code/10454
Author: vargenau
Date: 2021-08-06 14:42:27 +0000 (Fri, 06 Aug 2021)
Log Message:
-----------
functions rebuild and check: return status; display status in WikiAdminUtils
Modified Paths:
--------------
trunk/lib/WikiDB/backend/dbaBase.php
trunk/lib/WikiDB/backend/file.php
trunk/lib/WikiDB/backend.php
trunk/lib/plugin/WikiAdminUtils.php
Modified: trunk/lib/WikiDB/backend/dbaBase.php
===================================================================
--- trunk/lib/WikiDB/backend/dbaBase.php 2021-08-06 14:40:18 UTC (rev 10453)
+++ trunk/lib/WikiDB/backend/dbaBase.php 2021-08-06 14:42:27 UTC (rev 10454)
@@ -113,11 +113,15 @@
function rebuild($args = false)
{
if (!empty($args['all'])) {
- parent::rebuild();
+ $result = parent::rebuild();
+ if ($result == false) {
+ return false;
+ }
}
// rebuild backlink table
$this->_linkdb->rebuild();
$this->optimize();
+ return true;
}
function check($args = false)
Modified: trunk/lib/WikiDB/backend/file.php
===================================================================
--- trunk/lib/WikiDB/backend/file.php 2021-08-06 14:40:18 UTC (rev 10453)
+++ trunk/lib/WikiDB/backend/file.php 2021-08-06 14:42:27 UTC (rev 10454)
@@ -686,6 +686,7 @@
function check($args = false)
{
//trigger_error("check: Not Implemented", E_USER_WARNING);
+ return true;
}
/**
@@ -699,6 +700,7 @@
function rebuild($args = false)
{
//trigger_error("rebuild: Not Implemented", E_USER_WARNING);
+ return true;
}
function _parse_searchwords($search)
Modified: trunk/lib/WikiDB/backend.php
===================================================================
--- trunk/lib/WikiDB/backend.php 2021-08-06 14:40:18 UTC (rev 10453)
+++ trunk/lib/WikiDB/backend.php 2021-08-06 14:42:27 UTC (rev 10454)
@@ -494,6 +494,7 @@
*/
function check($args = false)
{
+ return true;
}
/**
@@ -530,6 +531,7 @@
$this->set_links($pagename, $links);
$this->unlock(array('version', 'page', 'recent', 'link', 'nonempty'));
}
+ return true;
}
function _parse_searchwords($search)
Modified: trunk/lib/plugin/WikiAdminUtils.php
===================================================================
--- trunk/lib/plugin/WikiAdminUtils.php 2021-08-06 14:40:18 UTC (rev 10453)
+++ trunk/lib/plugin/WikiAdminUtils.php 2021-08-06 14:42:27 UTC (rev 10454)
@@ -156,9 +156,9 @@
}
}
$pages->free();
- if (!$count)
+ if (!$count) {
return _("No pages with bad names had to be deleted.");
- else {
+ } else {
return HTML(fmt("Deleted %d pages with invalid names:", $count),
HTML::div(array('class' => 'align-left'), $list));
}
@@ -210,8 +210,12 @@
{
longer_timeout(180);
$dbh = $request->getDbh();
- //FIXME: display result.
- return $dbh->_backend->check($args);
+ $result = $dbh->_backend->check($args);
+ if ($result) {
+ return _("Database check was successful.");
+ } else {
+ return _("Database check failed.");
+ }
}
private function _do_db_rebuild($request, $args)
@@ -218,8 +222,12 @@
{
longer_timeout(240);
$dbh = $request->getDbh();
- //FIXME: display result.
- return $dbh->_backend->rebuild($args);
+ $result = $dbh->_backend->rebuild($args);
+ if ($result) {
+ return _("Database rebuild was successful.");
+ } else {
+ return _("Database rebuild failed.");
+ }
}
// pagelist with enable/disable button
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|