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 (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:
parent
5986bd859d
commit
df405f2ecd
@ -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() {}
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
}
|
@ -13,4 +13,3 @@
|
|||||||
class DailyTask extends ScheduledTask {
|
class DailyTask extends ScheduledTask {
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
|
@ -12,4 +12,3 @@
|
|||||||
class HourlyTask extends ScheduledTask {
|
class HourlyTask extends ScheduledTask {
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
|
@ -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
|
||||||
}
|
}
|
||||||
?>
|
|
@ -12,4 +12,3 @@
|
|||||||
class WeeklyTask extends ScheduledTask {
|
class WeeklyTask extends ScheduledTask {
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
|
Loading…
Reference in New Issue
Block a user