LazyCron class

Provides hooks that are automatically executed at various intervals. It is called 'lazy' because it's triggered by a pageview, so the interval is guaranteed to be at least the time requested, rather than exactly the time requested. This is fine for most cases, but you can make it not lazy by connecting this to a real CRON job. See the module file for details.

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the LazyCron class also inherits all the methods and properties of: WireData and Wire.

Show class?             Show args?        

Common

NameReturnSummary 
LazyCron::afterPageView(HookEvent $e)
(nothing)Function triggered after every page view. 
LazyCron::every10Minutes($seconds)
(nothing)
LazyCron::every12Hours($seconds)
(nothing)
LazyCron::every15Minutes($seconds)
(nothing)
LazyCron::every2Days($seconds)
(nothing)
LazyCron::every2Hours($seconds)
(nothing)
LazyCron::every2Minutes($seconds)
(nothing)
LazyCron::every2Weeks($seconds)
(nothing)
LazyCron::every30Minutes($seconds)
(nothing)
LazyCron::every30Seconds(int $seconds)
(nothing)One or more of the following functions is called if the given interval has passed.
LazyCron::every3Minutes($seconds)
(nothing)
LazyCron::every45Minutes($seconds)
(nothing)
LazyCron::every4Days($seconds)
(nothing)
LazyCron::every4Hours($seconds)
(nothing)
LazyCron::every4Minutes($seconds)
(nothing)
LazyCron::every4Weeks($seconds)
(nothing)
LazyCron::every5Minutes($seconds)
(nothing)
LazyCron::every6Hours($seconds)
(nothing)
LazyCron::everyDay($seconds)
(nothing)
LazyCron::everyHour($seconds)
(nothing)
LazyCron::everyMinute($seconds)
(nothing)
LazyCron::everyWeek($seconds)
(nothing)
LazyCron::getTimeFuncName(int $seconds)
stringGet name of time function to hook for given number of seconds 
LazyCron::getTimeFuncSeconds(string $timeFuncName)
intGet number of seconds for given time function name or 0 if not found 
LazyCron::getTimeFuncs()
stringGet hookable time functions that are allowed, indexed by number of seconds they use 

Additional methods and properties

In addition to the methods and properties above, LazyCron also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.244

Latest news

  • ProcessWire Weekly #558
    In the 558th issue of ProcessWire Weekly we'll check out the blog post that introduces ProcessWire 3.0.244, share some recent ProcessWire highlights, and more. Read on!
    Weekly.pw / 18 January 2025
  • ProcessWire 3.0.244 new main/master version
    ProcessWire 3.0.244 is our newest main/master/stable version. It's been more than a year in the making and is packed with tons of new features, issue fixes, optimizations and more. This post covers all the details.
    Blog / 18 January 2025
  • Subscribe to weekly ProcessWire news

“We chose ProcessWire because of its excellent architecture, modular extensibility and the internal API. The CMS offers the necessary flexibility and performance for such a complex website like superbude.de. ProcessWire offers options that are only available for larger systems, such as Drupal, and allows a much slimmer development process.” —xport communication GmbH