-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathe_output.php
More file actions
53 lines (40 loc) · 1.35 KB
/
e_output.php
File metadata and controls
53 lines (40 loc) · 1.35 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
<?php
if (!defined('e107_INIT')) { exit; }
if(!e107::isInstalled('static_cache'))
{
return '';
}
if( (ST_CACHE_ENABLED===1 && !USER) ){
$stcache_html = ob_get_contents();
//also load phpwee minifier...
/*
if(MVDA_CACHE_MIN_ENABLED===1){
$stcache_html = PHPWee\Minify::html($stcache_html);
}
*/
if( $resultsItem ){
$resultsItem->set($stcache_html)->expiresAfter(ST_CACHE_EXPIRATION);
$oStaticCache->save($resultsItem);
$sToDb_key = substr($resultsItem->getEncodedKey(), 0, 2).'/'.substr($resultsItem->getEncodedKey(), 2, 2).'/'.$resultsItem->getEncodedKey().'.'.$aScConfig['cacheFileExtension'];
//scdb object
$scdb = new db();
//22/06/2018 09:53:20 - oudoken
//FIX delete key if already in database
$scdb->db_Delete(
'static_cache_cpages',
'scache_key = \''.$resultsItem->getKey().'\''
);
//insert page in db
$scdb->db_Insert(
'static_cache_cpages',
array(
'scache_key' => $resultsItem->getKey(),
'scache_url' => $keyword_webpage_nu,
'scache_path' => $sToDb_key,
'scache_lastmod' => time()
)
);
ob_end_flush();
}
}
?>