-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.php
More file actions
28 lines (27 loc) · 825 Bytes
/
init.php
File metadata and controls
28 lines (27 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php defined('SYSPATH') or die('No direct script access.');
/**
* The daemon initializer.
*
* @package Daemon
* @uses Event
* @author Oliver Morgan
* @copyright (c) 2009 Oliver Morgan
* @license MIT
*
* 2010-02-20 changed to config file task definition (R. Blumenthal)
*
* // add this to the bootstrap file to check/run events
* // has to be after module definition
* // has to be after route settings in case callbacks uses routing
* foreach (Daemon::all() as $daemon)
* $daemon->update();
*
*/
// get task definition from config and define events
if ( $tasks = Kohana::config( 'daemon.tasks' ))
foreach ($tasks as $name => $task)
{
Daemon::instance()->task(
Event::instance( $name )
->callback( $task[ 'callback' ] ), $task[ 'interval' ] );
}