aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/cron/task/base.php
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2010-10-29 11:40:18 +0200
committerOleg Pudeyev <oleg@bsdpower.com>2011-02-12 22:05:52 -0500
commit132d2c2bd85bac6ed87ea3c57de27a9675192f29 (patch)
tree56f6c4afd50300bd368ddd23b47e946d9a8f4316 /phpBB/includes/cron/task/base.php
parentbd58fa49c000e99d049cbd96306315e1bd35b938 (diff)
downloadforums-132d2c2bd85bac6ed87ea3c57de27a9675192f29.tar
forums-132d2c2bd85bac6ed87ea3c57de27a9675192f29.tar.gz
forums-132d2c2bd85bac6ed87ea3c57de27a9675192f29.tar.bz2
forums-132d2c2bd85bac6ed87ea3c57de27a9675192f29.tar.xz
forums-132d2c2bd85bac6ed87ea3c57de27a9675192f29.zip
[feature/system-cron] adjust some last filenames to make autoloading work
PHPBB3-9596
Diffstat (limited to 'phpBB/includes/cron/task/base.php')
-rw-r--r--phpBB/includes/cron/task/base.php59
1 files changed, 59 insertions, 0 deletions
diff --git a/phpBB/includes/cron/task/base.php b/phpBB/includes/cron/task/base.php
new file mode 100644
index 0000000000..ba399c18b1
--- /dev/null
+++ b/phpBB/includes/cron/task/base.php
@@ -0,0 +1,59 @@
+<?php
+/**
+*
+* @package phpBB3
+* @version $Id$
+* @copyright (c) 2010 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* Cron task base class. Provides sensible defaults for cron tasks
+* and partially implements cron task interface, making writing cron tasks easier.
+*
+* At a minimum, subclasses must override the run() method.
+*
+* Cron tasks need not inherit from this base class. If desired,
+* they may implement cron task interface directly.
+*
+* @package phpBB3
+*/
+abstract class phpbb_cron_task_base implements phpbb_cron_task
+{
+ /**
+ * Returns whether this cron task can run, given current board configuration.
+ *
+ * For example, a cron task that prunes forums can only run when
+ * forum pruning is enabled.
+ */
+ public function is_runnable()
+ {
+ return true;
+ }
+
+ /**
+ * Returns whether this cron task should run now, because enough time
+ * has passed since it was last run.
+ */
+ public function should_run()
+ {
+ return true;
+ }
+
+ /**
+ * Returns whether this cron task can be run in shutdown function.
+ */
+ public function is_shutdown_function_safe()
+ {
+ return true;
+ }
+}