-
Notifications
You must be signed in to change notification settings - Fork 1
/
helpers.php
50 lines (44 loc) · 1.48 KB
/
helpers.php
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
<?php
use GrapheneNodeClient\Connectors\Http\SteemitHttpJsonRpcConnector as Steemit;
use GrapheneNodeClient\Connectors\Http\HiveHttpJsonRpcConnector as Hive;
use GrapheneNodeClient\Connectors\Http\SereyHttpJsonRpcConnector as Serey;use GrapheneNodeClient\Connectors\Http\VizHttpJsonRpcConnector as Viz;
use GrapheneNodeClient\Connectors\Http\GolosHttpJsonRpcConnector as Golos;
define('CONNECTORS_MAP', [
'hive' => Hive::class,
'serey' => Serey::class,
'golos' => Golos::class,
'viz' => Viz::class,
'steem' => Steemit::class,
]);
define('MONTHS', [
'01' => 'января',
'02' => 'февраля',
'03' => 'марта',
'04' => 'апреля',
'05' => 'мая',
'06' => 'июня',
'07' => 'июля',
'08' => 'августа',
'09' => 'сентября',
'10' => 'октября',
'11' => 'ноября',
'12' => 'декабря',
]);
function getWord($number, $suffix)
{
$keys = array(2, 0, 1, 1, 1, 2);
if ($number < 0) $number = 0;
$mod = $number % 100;
$suffix_key = ($mod > 7 && $mod < 20) ? 2 : $keys[min($mod % 10, 5)];
if ($suffix_key < 0) $suffix_key = 0;
return $suffix[$suffix_key];
}
function noCache()
{
header('Expires: Thu, 19 Feb 1998 13:24:18 GMT');
header('Last-Modified: '.gmdate("D, d M Y H:i:s")." GMT");
header('Cache-Control: no-cache, must-revalidate');
header('Cache-Control: post-check=0,pre-check=0');
header('Cache-Control: max-age=0');
header('Pragma: no-cache');
}