-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcache.php
More file actions
executable file
·36 lines (31 loc) · 865 Bytes
/
cache.php
File metadata and controls
executable file
·36 lines (31 loc) · 865 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
<?php
require dirname(__FILE__).'/core/fanwe.php';
$fanwe = &FanweService::instance();
$fanwe->initialize();
$index = intval($_REQUEST['index']);
@set_time_limit(0);
if(function_exists('ini_set'))
ini_set('max_execution_time',0);
$limit = 500;
$shares = FDB::fetchAll('SELECT share_id,uid
FROM '.FDB::table('share').'
ORDER BY share_id ASC LIMIT '.$index.','.$limit);
if(count($shares) == 0)
{
echo "ok";
exit;
}
foreach($shares as $share)
{
$share_id = $share['share_id'];
FS('Share')->updateShareCache($share_id);
echo "创建缓存 $share_id 成功<br/>";
flush();
ob_flush();
usleep(100);
}
echo "<script type=\"text/javascript\">var fun = function(){location.href='cache.php?index=".($index + $limit)."&time=".time()."';}; setTimeout(fun,500);</script>"."\r\n";
flush();
ob_flush();
exit;
?>