-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtools.php
More file actions
109 lines (88 loc) · 2.58 KB
/
tools.php
File metadata and controls
109 lines (88 loc) · 2.58 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
require_once 'lib/MemDb.lib.php';
require_once ('public/public.php');
$bClear = isset($_GET['clear'])? $_GET['clear']:false;
$strSet = isset($_GET['set'])? $_GET['set']:'';
$strGet = isset($_GET['get'])? $_GET['get']:'';
$bGetIp = isset($_GET['getip'])? $_GET['getip']:0;
$strGetIp = isset($_GET['getips'])? $_GET['getips']:'';
$strUpdateMark = (int)(isset($_GET['mark']) ? $_GET['mark'] : 0);
$strUpdatePrice = (int)(isset($_GET['price']) ? $_GET['price'] : 0);
$memcached = new MemDb();
if(!$memcached){
echo "New MemDb failed";
exit();
}
global $g_arr_memcache_config;
$memcached->connectMemcached($g_arr_memcache_config);
if($bClear){
$result = $memcached->clearMemcache();
if(!$result){
echo get_rsp_result(0);
exit();
}
echo get_rsp_result(1).'clear mem';
}
if(!empty($strSet)){
$bResult = $memcached->setSearchResult('4a03c8f22641741b6e1d35b87d71a571', $strSet);
if(!$bResult){
echo "MemDb:setSearchResult() failed";
exit();
}
$bResult = $memcached->getSearchResult('4a03c8f22641741b6e1d35b87d71a571');
if(!$bResult){
echo "getSearchResult() failed";
exit();
}
echo get_rsp_result(1).'set mem'.$bResult;
}
if(!empty($strGet)){
$bResult = $memcached->getSearchResult($strGet);
if(!$bResult){
echo "getSearchResult() failed";
exit();
}
echo get_rsp_result(1).'get mem:'.$bResult;
}
if($bGetIp){
$arr_memcache1['memcache'] = array(
array('host'=>'127.0.0.1', 'port'=>'11211', 'persistent'=>true,'weight'=>2),
);
$arr_memcache2['memcache'] = array(
array('host'=>'127.0.0.1', 'port'=>'11211', 'persistent'=>true,'weight'=>2),
);
if($bGetIp == 1){
$arr_memcache = $arr_memcache1;
}
if($bGetIp == 2){
$arr_memcache = $arr_memcache2;
}
$memcached = new MemDb();
$memcached->setConnect($arr_memcache);
$bResult = $memcached->getSearchResult($strGetIp);
if(!$bResult){
echo "getSearchResult() failed";
exit();
}
echo get_rsp_result(1).'get mem:'.$bResult;
}
if ($strUpdateMark) {
require_once 'tasks/CoolShow/MarkDb.class.php';
$mark = new MarkDb();
$bResult = $mark->updateMarkList();
if (! $bResult) {
Log::write("update fail", "log");
exit("Fail");
}
exit("SUCCESS");
}
if ($strUpdatePrice) {
require_once 'tasks/CoolShow/PriceTagDb.class.php';
$price = new PriceTagDb();
$bResult = $price->updatePriceTagList();
if (! $bResult) {
Log::write("update fail", "log");
exit("Fail");
}
exit("SUCCESS");
}