Commit 2cef3fb4 by Simon Champion

Refactored messages to the processing classes. Added classes for completion…

Refactored messages to the processing classes. Added classes for completion steps as these also need messages.
parent 406a91a8
<?php
/*
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Recalc/AbstractFinalStep.php
Description: Base class for final step classes in the recal processes.
This program 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.
This program 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.
More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../');
exit;
}
abstract class Q2A_Recalc_AbstractFinalStep extends Q2A_Recalc_AbstractStep
{
protected $isFinalStep = true;
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/AbstractStep.php
Description: Base class for step classes in the recal processes.
This program is free software; you can redistribute it and/or
......@@ -30,6 +30,7 @@ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly
abstract class Q2A_Recalc_AbstractStep
{
protected $state;
protected $isFinalStep = false;
public function __construct(Q2A_Recalc_State $state)
{
......@@ -38,6 +39,34 @@ abstract class Q2A_Recalc_AbstractStep
abstract public function doStep();
public function getMessage()
{
return '';
}
public function isFinalStep()
{
return $this->isFinalStep;
}
/**
* Return the translated language ID string replacing the progress and total in it.
* @access private
* @param string $langId Language string ID that contains 2 placeholders (^1 and ^2)
* @param int $progress Amount of processed elements
* @param int $total Total amount of elements
*
* @return string Returns the language string ID with their placeholders replaced with
* the formatted progress and total numbers
*/
protected function progressLang($langId, $progress, $total)
{
return strtr(qa_lang($langId), array(
'^1' => qa_format_number((int)$progress),
'^2' => qa_format_number((int)$total),
));
}
static public function factory(Q2A_Recalc_State $state)
{
$class = $state->getOperationClass();
......
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/BlobsToDB.php
Description: Recalc class for the start of the blobs to database process.
This program is free software; you can redistribute it and/or
......@@ -33,5 +33,4 @@ class Q2A_Recalc_BlobsToDB extends Q2A_Recalc_AbstractStep
$this->state->transition('doblobstodb_move');
return false;
}
}
<?php
/*
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Recalc/BlobsToDBComplete.php
Description: Recalc class for the end of the blobs to database process.
This program 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.
This program 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.
More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../');
exit;
}
class Q2A_Recalc_BlobsToDBComplete extends Q2A_Recalc_BlobsToDiskComplete
{
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/BlobsToDBMove.php
Description: Recalc processing class for the blobs to database process.
This program is free software; you can redistribute it and/or
......@@ -48,4 +48,8 @@ class Q2A_Recalc_BlobsToDBMove extends Q2A_Recalc_AbstractStep
return true;
}
public function getMessage()
{
return $this->progressLang('admin/blobs_move_moved', $this->state->done, $this->state->length);
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/BlobsToDisk.php
Description: Recalc class for the start of the blobs to disk process.
This program is free software; you can redistribute it and/or
......@@ -33,5 +33,4 @@ class Q2A_Recalc_BlobsToDisk extends Q2A_Recalc_AbstractStep
$this->state->transition('doblobstodisk_move');
return false;
}
}
<?php
/*
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Recalc/BlobsToDiskComplete.php
Description: Recalc class for the end of the blobs to disk process.
This program 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.
This program 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.
More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../');
exit;
}
class Q2A_Recalc_BlobsToDiskComplete extends Q2A_Recalc_ReindexPostsComplete
{
public function getMessage()
{
return qa_lang('admin/blobs_move_complete');
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/BlobsToDiskMove.php
Description: Recalc processing class for the blobs to disk process.
This program is free software; you can redistribute it and/or
......@@ -49,4 +49,8 @@ class Q2A_Recalc_BlobsToDiskMove extends Q2A_Recalc_AbstractStep
return true;
}
public function getMessage()
{
return $this->progressLang('admin/blobs_move_moved', $this->state->done, $this->state->length);
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/CacheClear.php
Description: Recalc class for the start of the cache clear process.
This program is free software; you can redistribute it and/or
......@@ -33,5 +33,4 @@ class Q2A_Recalc_CacheClear extends Q2A_Recalc_AbstractStep
$this->state->transition('docacheclear_process');
return false;
}
}
<?php
/*
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Recalc/CacheClearComplete.php
Description: Recalc class for the end of the cache clear process.
This program 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.
This program 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.
More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../');
exit;
}
class Q2A_Recalc_CacheClearComplete extends Q2A_Recalc_ReindexPostsComplete
{
public function getMessage()
{
return qa_lang('admin/caching_delete_complete');
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/CacheClearProcess.php
Description: Recalc processing class for the cache clear process.
This program is free software; you can redistribute it and/or
......@@ -45,4 +45,8 @@ class Q2A_Recalc_CacheClearProcess extends Q2A_Recalc_AbstractStep
return true;
}
public function getMessage()
{
return $this->progressLang('admin/caching_delete_progress', $this->state->done, $this->state->length);
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/CacheTrim.php
Description: Recalc class for the start of the cache trim process.
This program is free software; you can redistribute it and/or
......@@ -33,5 +33,4 @@ class Q2A_Recalc_CacheTrim extends Q2A_Recalc_AbstractStep
$this->state->transition('docachetrim_process');
return false;
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/CacherTrimProcess.php
Description: Recalc processing class for the cache trim process.
This program is free software; you can redistribute it and/or
......
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/DeleteHidden.php
Description: Recalc class for the start of the delete hidden process.
This program is free software; you can redistribute it and/or
......@@ -33,5 +33,4 @@ class Q2A_Recalc_DeleteHidden extends Q2A_Recalc_AbstractStep
$this->state->transition('dodeletehidden_comments');
return false;
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/DeleteHiddenAnswers.php
Description: Recalc processing class for the delete hidden process.
This program is free software; you can redistribute it and/or
......@@ -47,4 +47,8 @@ class Q2A_Recalc_DeleteHiddenAnswers extends Q2A_Recalc_AbstractStep
return true;
}
public function getMessage()
{
return $this->progressLang('admin/hidden_answers_deleted', $this->state->done, $this->state->length);
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/DeleteHiddenComments.php
Description: Recalc processing class for the delete hidden process.
This program is free software; you can redistribute it and/or
......@@ -47,4 +47,8 @@ class Q2A_Recalc_DeleteHiddenComments extends Q2A_Recalc_AbstractStep
return true;
}
public function getMessage()
{
return $this->progressLang('admin/hidden_commenrs_deleted', $this->state->done, $this->state->length);
}
}
<?php
/*
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Recalc/DeleteHiddenComplete.php
Description: Recalc class for the end of the delete hidden process.
This program 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.
This program 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.
More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../');
exit;
}
class Q2A_Recalc_DeleteHiddenComplete extends Q2A_Recalc_ReindexPostsComplete
{
public function getMessage()
{
return qa_lang('admin/delete_hidden_complete');
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/DeleteHiddenQuestions.php
Description: Recalc processing class for the delete hidden process.
This program is free software; you can redistribute it and/or
......@@ -47,4 +47,8 @@ class Q2A_Recalc_DeleteHiddenQuestions extends Q2A_Recalc_AbstractStep
return true;
}
public function getMessage()
{
return $this->progressLang('admin/hidden_questions_deleted', $this->state->done, $this->state->length);
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/RecalcCategories.php
Description: Recalc class for the start of the recalc categories process.
This program is free software; you can redistribute it and/or
......@@ -33,5 +33,4 @@ class Q2A_Recalc_RecalcCategories extends Q2A_Recalc_AbstractStep
$this->state->transition('dorecalccategories_postcount');
return false;
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/RecalcCategoriesBackPaths.php
Description: Recalc processing class for the recalc categories process.
This program is free software; you can redistribute it and/or
......@@ -45,4 +45,8 @@ class Q2A_Recalc_RecalcCategoriesBackPaths extends Q2A_Recalc_AbstractStep
return true;
}
public function getMessage()
{
return $this->progressLang('admin/recalc_categories_backpaths', $this->state->done, $this->state->length);
}
}
<?php
/*
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Recalc/RecalcCategoriesComplete.php
Description: Recalc class for the end of the recalc categories process.
This program 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.
This program 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.
More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../');
exit;
}
class Q2A_Recalc_RecalcCategoriesComplete extends Q2A_Recalc_ReindexPostsComplete
{
public function getMessage()
{
return qa_lang('admin/recalc_categories_complete');
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/RecalcCategoriesPostCount.php
Description: Recalc processing class for the recalc categories process.
This program is free software; you can redistribute it and/or
......@@ -36,5 +36,4 @@ class Q2A_Recalc_RecalcCategoriesPostCount extends Q2A_Recalc_AbstractStep
$this->state->transition('dorecalccategories_postupdate');
return false;
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/RecalcCategoriesPostUpdate.php
Description: Recalc processing class for the recalc categories process.
This program is free software; you can redistribute it and/or
......@@ -47,4 +47,8 @@ class Q2A_Recalc_RecalcCategoriesPostUpdate extends Q2A_Recalc_AbstractStep
return true;
}
public function getMessage()
{
return $this->progressLang('admin/recalc_categories_updated', $this->state->done, $this->state->length);
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/RecalcCategoriesRecount.php
Description: Recalc processing class for the recalc categories process.
This program is free software; you can redistribute it and/or
......@@ -47,4 +47,8 @@ class Q2A_Recalc_RecalcCategoriesRecount extends Q2A_Recalc_AbstractStep
return true;
}
public function getMessage()
{
return $this->progressLang('admin/recalc_categories_recounting', $this->state->done, $this->state->length);
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/RecalcPoints.php
Description: Main recalculation class.
This program is free software; you can redistribute it and/or
......@@ -92,7 +92,7 @@ class Q2A_Recalc_RecalcMain
{
$step = Q2A_Recalc_AbstractStep::factory($this->state);
if (!$step) {
if (!$step || $step->isFinalStep()) {
$this->state->setState();
return false;
}
......@@ -106,24 +106,6 @@ class Q2A_Recalc_RecalcMain
}
/**
* Return the translated language ID string replacing the progress and total in it.
* @access private
* @param string $langId Language string ID that contains 2 placeholders (^1 and ^2)
* @param int $progress Amount of processed elements
* @param int $total Total amount of elements
*
* @return string Returns the language string ID with their placeholders replaced with
* the formatted progress and total numbers
*/
private function progressLang($langId, $progress, $total)
{
return strtr(qa_lang($langId), array(
'^1' => qa_format_number($progress),
'^2' => qa_format_number($total),
));
}
/**
* Return a string which gives a user-viewable version of $state
* @return string
*/
......@@ -131,121 +113,7 @@ class Q2A_Recalc_RecalcMain
{
require_once QA_INCLUDE_DIR . 'app/format.php';
$this->state->done = (int) $this->state->done;
$this->state->length = (int) $this->state->length;
switch ($this->state->operation) {
case 'doreindexcontent_postcount':
case 'dorecountposts_postcount':
case 'dorecalccategories_postcount':
case 'dorefillevents_qcount':
$message = qa_lang('admin/recalc_posts_count');
break;
case 'doreindexcontent_pagereindex':
$message = $this->progressLang('admin/reindex_pages_reindexed', $this->state->done, $this->state->length);
break;
case 'doreindexcontent_postreindex':
$message = $this->progressLang('admin/reindex_posts_reindexed', $this->state->done, $this->state->length);
break;
case 'doreindexposts_complete':
$message = qa_lang('admin/reindex_posts_complete');
break;
case 'doreindexposts_wordcount':
$message = $this->progressLang('admin/reindex_posts_wordcounted', $this->state->done, $this->state->length);
break;
case 'dorecountposts_votecount':
$message = $this->progressLang('admin/recount_posts_votes_recounted', $this->state->done, $this->state->length);
break;
case 'dorecountposts_acount':
$message = $this->progressLang('admin/recount_posts_as_recounted', $this->state->done, $this->state->length);
break;
case 'dorecountposts_complete':
$message = qa_lang('admin/recount_posts_complete');
break;
case 'dorecalcpoints_usercount':
$message = qa_lang('admin/recalc_points_usercount');
break;
case 'dorecalcpoints_recalc':
$message = $this->progressLang('admin/recalc_points_recalced', $this->state->done, $this->state->length);
break;
case 'dorecalcpoints_complete':
$message = qa_lang('admin/recalc_points_complete');
break;
case 'dorefillevents_refill':
$message = $this->progressLang('admin/refill_events_refilled', $this->state->done, $this->state->length);
break;
case 'dorefillevents_complete':
$message = qa_lang('admin/refill_events_complete');
break;
case 'dorecalccategories_postupdate':
$message = $this->progressLang('admin/recalc_categories_updated', $this->state->done, $this->state->length);
break;
case 'dorecalccategories_recount':
$message = $this->progressLang('admin/recalc_categories_recounting', $this->state->done, $this->state->length);
break;
case 'dorecalccategories_backpaths':
$message = $this->progressLang('admin/recalc_categories_backpaths', $this->state->done, $this->state->length);
break;
case 'dorecalccategories_complete':
$message = qa_lang('admin/recalc_categories_complete');
break;
case 'dodeletehidden_comments':
$message = $this->progressLang('admin/hidden_comments_deleted', $this->state->done, $this->state->length);
break;
case 'dodeletehidden_answers':
$message = $this->progressLang('admin/hidden_answers_deleted', $this->state->done, $this->state->length);
break;
case 'dodeletehidden_questions':
$message = $this->progressLang('admin/hidden_questions_deleted', $this->state->done, $this->state->length);
break;
case 'dodeletehidden_complete':
$message = qa_lang('admin/delete_hidden_complete');
break;
case 'doblobstodisk_move':
case 'doblobstodb_move':
$message = $this->progressLang('admin/blobs_move_moved', $this->state->done, $this->state->length);
break;
case 'doblobstodisk_complete':
case 'doblobstodb_complete':
$message = qa_lang('admin/blobs_move_complete');
break;
case 'docachetrim_process':
case 'docacheclear_process':
$message = $this->progressLang('admin/caching_delete_progress', $this->state->done, $this->state->length);
break;
case 'docacheclear_complete':
$message = qa_lang('admin/caching_delete_complete');
break;
default:
$message = '';
break;
}
return $message;
$step = Q2A_Recalc_AbstractStep::factory($this->state);
return $step ? $step->getMessage() : '';
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/RecalcPoints.php
Description: Recalc class for the start of the recalc points process.
This program is free software; you can redistribute it and/or
......
<?php
/*
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Recalc/RecalcPointsComplete.php
Description: Recalc class for the end of the recalc points process.
This program 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.
This program 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.
More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../');
exit;
}
class Q2A_Recalc_RecalcPointsComplete extends Q2A_Recalc_ReindexPostsComplete
{
public function getMessage()
{
return qa_lang('admin/recalc_points_complete');
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/RecalcPointsRecalc.php
Description: Recalc processing class for the recalc points process.
This program is free software; you can redistribute it and/or
......@@ -55,4 +55,8 @@ class Q2A_Recalc_RecalcPointsRecalc extends Q2A_Recalc_AbstractStep
}
}
public function getMessage()
{
return $this->progressLang('admin/recalc_points_recalced', $this->state->done, $this->state->length);
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/RecalcPointsUserCount.php
Description: Recalc processing class for the recalc points process.
This program is free software; you can redistribute it and/or
......@@ -36,4 +36,8 @@ class Q2A_Recalc_RecalcPointsUserCount extends Q2A_Recalc_AbstractStep
return false;
}
public function getMessage()
{
return qa_lang('admin/recalc_points_usercount');
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/RecountPosts.php
Description: Recalc class for the start of the recount posts process.
This program is free software; you can redistribute it and/or
......
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/RecountPostsACount.php
Description: Recalc processing class for the recount posts process.
This program is free software; you can redistribute it and/or
......@@ -47,4 +47,8 @@ class Q2A_Recalc_RecountPostsACount extends Q2A_Recalc_AbstractStep
return true;
}
public function getMessage()
{
return $this->progressLang('admin/recount_posts_as_recounted', $this->state->done, $this->state->length);
}
}
<?php
/*
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Recalc/RecountPostsComplete.php
Description: Recalc class for the end of the recount posts process.
This program 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.
This program 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.
More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../');
exit;
}
class Q2A_Recalc_RecountPostsComplete extends Q2A_Recalc_ReindexPostsComplete
{
public function getMessage()
{
return qa_lang('admin/recount_posts_complete');
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/RecountPostsPostCount.php
Description: Recalc processing class for the recount posts process.
This program is free software; you can redistribute it and/or
......@@ -40,4 +40,8 @@ class Q2A_Recalc_RecountPostsPostCount extends Q2A_Recalc_AbstractStep
return false;
}
public function getMessage()
{
return qa_lang('admin/recalc_posts_count');
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/RecountPostsVoteCount.php
Description: Recalc processing class for the recount posts process.
This program is free software; you can redistribute it and/or
......@@ -46,4 +46,8 @@ class Q2A_Recalc_RecountPostsVoteCount extends Q2A_Recalc_AbstractStep
return true;
}
public function getMessage()
{
return $this->progressLang('admin/recount_posts_votes_recounted', $this->state->done, $this->state->length);
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/RefillEvents.php
Description: Recalc class for the start of the refill events process.
This program is free software; you can redistribute it and/or
......
<?php
/*
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Recalc/RefillEventsComplete.php
Description: Recalc class for the end of the refill events process.
This program 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.
This program 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.
More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../');
exit;
}
class Q2A_Recalc_RefillEventsComplete extends Q2A_Recalc_ReindexPostsComplete
{
public function getMessage()
{
return qa_lang('admin/refill_events_complete');
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/RefillEventsQCount.php
Description: Recalc processing class for the refill events process.
This program is free software; you can redistribute it and/or
......@@ -35,4 +35,8 @@ class Q2A_Recalc_RefillEventsQCount extends Q2A_Recalc_AbstractStep
return false;
}
public function getMessage()
{
return qa_lang('admin/recalc_posts_count');
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/RefillEventsRefill.php
Description: Recalc processing class for the refill events process.
This program is free software; you can redistribute it and/or
......@@ -128,4 +128,8 @@ class Q2A_Recalc_RefillEventsRefill extends Q2A_Recalc_AbstractStep
return true;
}
public function getMessage()
{
return $this->progressLang('admin/refill_events_refilled', $this->state->done, $this->state->length);
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/ReindexContent.php
Description: Recalc class for the start of the reindex content process.
This program is free software; you can redistribute it and/or
......
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/ReindexContentPageReindex.php
Description: Recalc processing class for the reindex content process.
This program is free software; you can redistribute it and/or
......@@ -64,4 +64,8 @@ class Q2A_Recalc_ReindexContentPageReindex extends Q2A_Recalc_AbstractStep
return true;
}
public function getMessage()
{
return $this->progressLang('admin/reindex_pages_reindexed', $this->state->done, $this->state->length);
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/ReindexContentPostCount.php
Description: Recalc processing class for the reindex content process.
This program is free software; you can redistribute it and/or
......@@ -38,4 +38,8 @@ class Q2A_Recalc_ReindexContentPostCount extends Q2A_Recalc_AbstractStep
return false;
}
public function getMessage()
{
return qa_lang('admin/recalc_posts_count');
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/ReindexContentPostReindex.php
Description: Recalc processing class for the reindex content process.
This program is free software; you can redistribute it and/or
......@@ -56,4 +56,8 @@ class Q2A_Recalc_ReindexContentPostReindex extends Q2A_Recalc_AbstractStep
return true;
}
public function getMessage()
{
return $this->progressLang('admin/reindex_posts_reindexed', $this->state->done, $this->state->length);
}
}
<?php
/*
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Recalc/ReindexPostsComplete.php
Description: Recalc class for the end of the reindex posts process.
This program 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.
This program 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.
More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../');
exit;
}
class Q2A_Recalc_ReindexPostsComplete extends Q2A_Recalc_AbstractFinalStep
{
public function doStep()
{
throw new Exception('Do not process the completion step.');
}
public function getMessage()
{
return qa_lang('admin/reindex_posts_complete');
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/ReindexContentWordCount.php
Description: Recalc processing class for the reindex content process.
This program is free software; you can redistribute it and/or
......@@ -47,4 +47,8 @@ class Q2A_Recalc_ReindexPostsWordCount extends Q2A_Recalc_AbstractStep
return true;
}
public function getMessage()
{
return $this->progressLang('admin/reindex_posts_wordcounted', $this->state->done, $this->state->length);
}
}
......@@ -3,8 +3,8 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
File: qa-include/Q2A/Recalc/State.php
Description: Class holding state of the current recalculation process.
This program is free software; you can redistribute it and/or
......@@ -65,7 +65,17 @@ class Q2A_Recalc_State
'docachetrim' => 'CacheTrim',
'docacheclear' => 'CacheClear',
'docachetrim_process' => 'CacheClearProcess',
'docacheclear_process' => 'CacheClearProcess'
'docacheclear_process' => 'CacheClearProcess',
'doreindexposts_complete' => 'ReindexPostsComplete',
'dorecountposts_complete' => 'RecountPostsComplete',
'dorecalcpoints_complete' => 'RecalcPointsComplete',
'dorefillevents_complete' => 'RefillEventsComplete',
'dorecalccategories_complete' => 'RecalcCategoriesComplete',
'dodeletehidden_complete' => 'DeleteHiddenComplete',
'doblobstodisk_complete' => 'BlobsToDiskComplete',
'doblobstodb_complete' => 'BlobsToDBComplete',
'docacheclear_complete' => 'CacheClearComplete',
);
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment