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
This commit is contained in:
Ingo Schommer 2010-05-25 02:58:59 +00:00
parent 5986bd859d
commit df405f2ecd
5 changed files with 23 additions and 26 deletions

View File

@ -10,16 +10,18 @@
* @subpackage cron * @subpackage cron
*/ */
abstract class CliController extends Controller { abstract class CliController extends Controller {
function init() { function init() {
parent::init(); parent::init();
// Unless called from the command line, all CliControllers need ADMIN privileges // Unless called from the command line, all CliControllers need ADMIN privileges
if(!Director::is_cli() && !Permission::check("ADMIN")) return Security::permissionFailure(); if(!Director::is_cli() && !Permission::check("ADMIN")) {
return Security::permissionFailure();
}
} }
function index() { function index() {
foreach( ClassInfo::subclassesFor( $this->class ) as $subclass ) { foreach(ClassInfo::subclassesFor($this->class) as $subclass) {
echo $subclass . "\n"; echo $subclass . "\n";
$task = new $subclass(); $task = new $subclass();
$task->init(); $task->init();
$task->process(); $task->process();
@ -30,6 +32,5 @@ abstract class CliController extends Controller {
* Overload this method to contain the task logic. * Overload this method to contain the task logic.
*/ */
function process() {} function process() {}
}
?> }

View File

@ -13,4 +13,3 @@
class DailyTask extends ScheduledTask { class DailyTask extends ScheduledTask {
} }
?>

View File

@ -12,4 +12,3 @@
class HourlyTask extends ScheduledTask { class HourlyTask extends ScheduledTask {
} }
?>

View File

@ -27,4 +27,3 @@
abstract class ScheduledTask extends CliController { abstract class ScheduledTask extends CliController {
// this class exists as a logical extension // this class exists as a logical extension
} }
?>

View File

@ -12,4 +12,3 @@
class WeeklyTask extends ScheduledTask { class WeeklyTask extends ScheduledTask {
} }
?>