mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Cleaned up tabbing and code formatting in automated task classes
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@99753 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
66da3c5928
commit
f728448ab2
@ -10,16 +10,18 @@
|
||||
* @subpackage cron
|
||||
*/
|
||||
abstract class CliController extends Controller {
|
||||
|
||||
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();
|
||||
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();
|
||||
@ -30,6 +32,5 @@ abstract class CliController extends Controller {
|
||||
* Overload this method to contain the task logic.
|
||||
*/
|
||||
function process() {}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
@ -13,4 +13,3 @@
|
||||
class DailyTask extends ScheduledTask {
|
||||
|
||||
}
|
||||
?>
|
@ -12,4 +12,3 @@
|
||||
class HourlyTask extends ScheduledTask {
|
||||
|
||||
}
|
||||
?>
|
@ -27,4 +27,3 @@
|
||||
abstract class ScheduledTask extends CliController {
|
||||
// this class exists as a logical extension
|
||||
}
|
||||
?>
|
@ -12,4 +12,3 @@
|
||||
class WeeklyTask extends ScheduledTask {
|
||||
|
||||
}
|
||||
?>
|
Loading…
Reference in New Issue
Block a user