forked from gizmore/phpgdo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgdo_cronjob.php
More file actions
42 lines (35 loc) · 808 Bytes
/
gdo_cronjob.php
File metadata and controls
42 lines (35 loc) · 808 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
use GDO\Core\Application;
use GDO\DB\Database;
use GDO\Core\Logger;
use GDO\Cronjob\Cronjob;
use GDO\Language\Trans;
use GDO\Core\Debug;
use GDO\CLI\CLI;
use GDO\Core\Method\Stub;
############
### Init ###
############
if (php_sapi_name() !== 'cli')
{
echo "This is a CLI application.";
die(-1);
}
require 'GDO7.php';
require 'protected/config.php';
final class gdo_cronjob extends Application
{
public function isCLI() : bool { return true; }
public function isCronjob() : bool { return true; }
}
global $me;
$me = Stub::make();
gdo_cronjob::instance();
CLI::setServerVars();
Debug::init(GDO_ERROR_DIE, GDO_ERROR_MAIL);
Logger::init('system');
Database::init();
Trans::setISO('en');
/** @var $argv string[] **/
$force = in_array('--force', $argv, true);
Cronjob::run($me && $force);