File: reminders.php

package info (click to toggle)
kronolith2 2.1.4-1etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 5,560 kB
  • ctags: 2,171
  • sloc: php: 8,755; xml: 1,049; sql: 258; makefile: 65
file content (58 lines) | stat: -rwxr-xr-x 1,902 bytes parent folder | download | duplicates (2)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/php -q
<?php
/**
 * $Horde: kronolith/scripts/reminders.php,v 1.17.10.6 2006/04/18 16:26:16 jan Exp $
 *
 * Copyright 2003-2006 Charles J. Hagenbuch <chuck@horde.org>
 *
 * See the enclosed file COPYING for license information (LGPL).  If you
 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
 */

// Find the base file path of Horde.
@define('HORDE_BASE', dirname(__FILE__) . '/../..');

// Find the base file path of Kronolith.
@define('KRONOLITH_BASE', dirname(__FILE__) . '/..');

// Do CLI checks and environment setup first.
require_once HORDE_BASE . '/lib/core.php';
require_once 'Horde/CLI.php';

// Make sure no one runs this from the web.
if (!Horde_CLI::runningFromCLI()) {
    exit("Must be run from the command line\n");
}

// Load the CLI environment - make sure there's no time limit, init
// some variables, etc.
Horde_CLI::init();

// Now load the Registry and setup conf, etc.
$registry = &Registry::singleton(HORDE_SESSION_NONE);
$registry->pushApp('kronolith', false);

// Include libraries we need.
require_once 'Date/Calc.php';
require_once 'Horde/Date.php';
require_once 'Horde/Scheduler.php';
require_once KRONOLITH_BASE . '/lib/Kronolith.php';
require_once KRONOLITH_BASE . '/lib/Scheduler/kronolith.php';

// Notification instance for code that relies on it.
$notification = &Notification::singleton();

// Create a share instance. This must exist in the global scope for
// Kronolith's API calls to function properly.
require_once 'Horde/Share.php';
$shares = &Horde_Share::singleton($registry->getApp());

// Create a calendar backend object. This must exist in the global
// scope for Kronolith's API calls to function properly.
$kronolith = &Kronolith_Driver::factory();

// Get an instance of the Kronolith schedulerr.
$reminder = &Horde_Scheduler::unserialize('Horde_Scheduler_kronolith');

// Start the daemon going.
$reminder->run();