Permalink
Browse files

MINOR Cleaned up tabbing and code formatting in automated task classe…

…s (from r99753)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105526 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 5986bd8 commit df405f2ecd2e7a114a6bc6e2786e064881fb54b9 @chillu chillu committed May 25, 2010
Showing with 23 additions and 26 deletions.
  1. +17 −16 cli/CliController.php
  2. +2 −3 tasks/DailyTask.php
  3. +1 −2 tasks/HourlyTask.php
  4. +2 −3 tasks/ScheduledTask.php
  5. +1 −2 tasks/WeeklyTask.php
View
@@ -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() {}
-?>
+}
View
@@ -11,6 +11,5 @@
* @subpackage cron
*/
class DailyTask extends ScheduledTask {
-
-}
-?>
+
+}
View
@@ -11,5 +11,4 @@
*/
class HourlyTask extends ScheduledTask {
-}
-?>
+}
View
@@ -25,6 +25,5 @@
* @subpackage cron
*/
abstract class ScheduledTask extends CliController {
- // this class exists as a logical extension
-}
-?>
+ // this class exists as a logical extension
+}
View
@@ -11,5 +11,4 @@
*/
class WeeklyTask extends ScheduledTask {
-}
-?>
+}

0 comments on commit df405f2

Please sign in to comment.