-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsc_dcache.php
More file actions
44 lines (38 loc) · 990 Bytes
/
sc_dcache.php
File metadata and controls
44 lines (38 loc) · 990 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
43
44
<?php
/*
*
*/
require_once('../../class2.php');
if (!getperms('P'))
{
e107::redirect('home');
exit;
}
//$pref = e107::getPref();
//get db object
$oSql = e107::getDb();
$edit_id = $_POST['id'];
if( $edit_id!='' ){
//
if($edit_id=='all'){
//remove all items
$oStaticCache->clear();
$del_where = null;
}else{
$oSql->select('static_cache_cpages', 'scache_key', 'scache_id='.$edit_id);
$rowScache = $oSql->fetch();
$sCacheKey = $rowScache['scache_key'];
//delete cache with key method
$oStaticCache->deleteItem($sCacheKey);
$del_where = 'scache_id='.$edit_id;
//unlink ( string $filename [, resource $context ] )
}
if($oSql->delete('static_cache_cpages', $del_where)){
echo json_encode( array('err_code'=>'0', 'err_desc'=>'no error' ) );
}else{
echo json_encode( array('err_code'=>'1', 'err_desc'=>'error while updating' ) );
}
}else{
echo json_encode( array('err_code'=>'1', 'err_desc'=>'error while updating' ) );
}
?>