From df405f2ecd2e7a114a6bc6e2786e064881fb54b9 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 25 May 2010 02:58:59 +0000 Subject: [PATCH] MINOR Cleaned up tabbing and code formatting in automated task classes (from r99753) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105526 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- cli/CliController.php | 33 +++++++++++++++++---------------- tasks/DailyTask.php | 5 ++--- tasks/HourlyTask.php | 3 +-- tasks/ScheduledTask.php | 5 ++--- tasks/WeeklyTask.php | 3 +-- 5 files changed, 23 insertions(+), 26 deletions(-) diff --git a/cli/CliController.php b/cli/CliController.php index 4ebeb172b..7c3758b98 100755 --- a/cli/CliController.php +++ b/cli/CliController.php @@ -10,26 +10,27 @@ * @subpackage cron */ abstract class CliController extends Controller { - function init() { + + function init() { parent::init(); // Unless called from the command line, all CliControllers need ADMIN privileges - if(!Director::is_cli() && !Permission::check("ADMIN")) return Security::permissionFailure(); - } - - function index() { - foreach( ClassInfo::subclassesFor( $this->class ) as $subclass ) { - echo $subclass . "\n"; - - $task = new $subclass(); + if(!Director::is_cli() && !Permission::check("ADMIN")) { + return Security::permissionFailure(); + } + } + + function index() { + foreach(ClassInfo::subclassesFor($this->class) as $subclass) { + echo $subclass . "\n"; + $task = new $subclass(); $task->init(); - $task->process(); - } - } - + $task->process(); + } + } + /** * Overload this method to contain the task logic. */ - function process() {} -} + function process() {} -?> +} \ No newline at end of file diff --git a/tasks/DailyTask.php b/tasks/DailyTask.php index 05803fc8b..805dba2c5 100755 --- a/tasks/DailyTask.php +++ b/tasks/DailyTask.php @@ -11,6 +11,5 @@ * @subpackage cron */ class DailyTask extends ScheduledTask { - -} -?> \ No newline at end of file + +} \ No newline at end of file diff --git a/tasks/HourlyTask.php b/tasks/HourlyTask.php index 0f9d704cd..8bd8a2424 100644 --- a/tasks/HourlyTask.php +++ b/tasks/HourlyTask.php @@ -11,5 +11,4 @@ */ class HourlyTask extends ScheduledTask { -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/tasks/ScheduledTask.php b/tasks/ScheduledTask.php index 4d49ca3c0..5346a5c84 100755 --- a/tasks/ScheduledTask.php +++ b/tasks/ScheduledTask.php @@ -25,6 +25,5 @@ * @subpackage cron */ abstract class ScheduledTask extends CliController { - // this class exists as a logical extension -} -?> \ No newline at end of file + // this class exists as a logical extension +} \ No newline at end of file diff --git a/tasks/WeeklyTask.php b/tasks/WeeklyTask.php index bcfe56b73..47ca5d147 100755 --- a/tasks/WeeklyTask.php +++ b/tasks/WeeklyTask.php @@ -11,5 +11,4 @@ */ class WeeklyTask extends ScheduledTask { -} -?> \ No newline at end of file +} \ No newline at end of file