Webylon 3.1 API Docs
  • Package
  • Class
  • Tree
  • Deprecated
  • Download
Version: current
  • 3.2
  • 3.1

Packages

  • auth
  • Booking
  • cart
    • shipping
    • steppedcheckout
  • Catalog
  • cms
    • assets
    • batchaction
    • batchactions
    • bulkloading
    • comments
    • content
    • core
    • export
    • newsletter
    • publishers
    • reports
    • security
    • tasks
  • Dashboard
  • DataObjectManager
  • event
  • faq
  • forms
    • actions
    • core
    • fields-basic
    • fields-dataless
    • fields-datetime
    • fields-files
    • fields-formatted
    • fields-formattedinput
    • fields-relational
    • fields-structural
    • transformations
    • validators
  • googlesitemaps
  • guestbook
  • installer
  • newsletter
  • None
  • photo
    • gallery
  • PHP
  • polls
  • recaptcha
  • sapphire
    • api
    • bulkloading
    • control
    • core
    • cron
    • dev
    • email
    • fields-formattedinput
    • filesystem
    • formatters
    • forms
    • i18n
    • integration
    • misc
    • model
    • parsers
    • search
    • security
    • tasks
    • testing
    • tools
    • validation
    • view
    • widgets
  • seo
    • open
      • graph
  • sfDateTimePlugin
  • spamprotection
  • stealth
    • captha
  • subsites
  • userform
    • pagetypes
  • userforms
  • webylon
  • widgets

Classes

  • CliController
  • CorrectBadFoldersTask
  • DailyTask
  • DeleteEmptyAssociatedFoldersTask
  • FindCyrillic
  • HourlyTask
  • MonthlyTask
  • PostVKNotificationQueueTask
  • QuarterHourlyTask
  • RealtyXMLImportTask
  • ScheduledTask
  • WeeklyTask
  • YearlyTask
 1 <?php
 2 /**
 3  * Base class invoked from CLI rather than the webserver (Cron jobs, handling email bounces).
 4  * You can call subclasses of CliController directly, which will trigger a
 5  * call to {@link process()} on every sub-subclass. For instance, calling
 6  * "sake DailyTask" from the commandline will call {@link process()} on every subclass
 7  * of DailyTask.
 8  * 
 9  * @package sapphire
10  * @subpackage cron
11  */
12 abstract class CliController extends Controller {
13 
14     function init() {
15         parent::init();
16         // Unless called from the command line, all CliControllers need ADMIN privileges
17         if(!Director::is_cli() && !Permission::check("ADMIN")) {
18             return Security::permissionFailure();
19         }
20     }
21 
22     function index() {
23         foreach(ClassInfo::subclassesFor($this->class) as $subclass) {
24             echo $subclass . "\n";
25             $task = new $subclass();
26             $task->init();
27             $task->process();
28         }
29     }
30 
31     /**
32      * Overload this method to contain the task logic.
33      */
34     function process() {}
35 
36 }
[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -
Webylon 3.1 API Docs API documentation generated by ApiGen 2.8.0