-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProcess.php
More file actions
81 lines (62 loc) · 1.99 KB
/
Process.php
File metadata and controls
81 lines (62 loc) · 1.99 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
/**
* Elite Dangerous Star Map
* @link https://www.edsm.net/
*/
namespace Process;
abstract class Process
{
public static $sendTweet = false;
protected static $databaseCache = null;
protected static $databaseFileCache = null;
abstract static function run();
protected static function log($str)
{
// Old CRON compatibility
if(function_exists('echoLog'))
{
return echoLog($str);
}
return \EDSM_Api_Logger::log($str);
}
protected static function endLog()
{
static::log('');
static::log('');
static::log('----------------------------------------------------------------------------------------------------------------');
static::log('');
static::log('');
}
protected static function sendReloadSignal()
{
static::log('');
static::log('<span class="text-danger">Reload signal (' . APPLICATION_ENV . ')</span>');
exit();
}
protected static function getDatabaseCache()
{
if(is_null(static::$databaseCache))
{
$bootstrap = \Zend_Registry::get('Zend_Application');
$cacheManager = $bootstrap->getResource('cachemanager');
static::$databaseCache = $cacheManager->getCache('database');
unset($bootstrap, $cacheManager);
}
return static::$databaseCache;
}
protected static function getDatabaseFileCache()
{
if(is_null(static::$databaseFileCache))
{
$bootstrap = \Zend_Registry::get('Zend_Application');
$cacheManager = $bootstrap->getResource('cachemanager');
static::$databaseFileCache = $cacheManager->getCache('databaseFile');
unset($bootstrap, $cacheManager);
}
return static::$databaseFileCache;
}
public static function setSendTweetStatus($bool)
{
static::$sendTweet = $bool;
}
}