View file stat/_core/_class/cache_pf.php

File size: 907B
<?php
class cache_pf {
	public static function get($ID) {
		$file = cache."_pf/{$ID}.data";	
		$cache = @file_get_contents($file); 	
		return unserialize($cache);
	}	

	public static function save($ID) {
		$file = cache."_pf/{$ID}.data";	
		$cache = DB :: $dbh -> queryFetch("SELECT * FROM platforms WHERE id = ? LIMIT 1;",[$ID]);        
		$cache = serialize($cache);	
		@file_put_contents($file, $cache);
	}


	public static function check($ID) {
		$file = cache."_pf/{$ID}.data";	
		if(!file_exists($file)):  	
			self::save($ID);
		endif;
		return self::get($ID);
	}

	public static function ch($ID) {
		$file = cache."_pf/{$ID}.data";	
		if(file_exists($file)):  
			return true;
		else:	
			return false;
		endif;	
	}	

	public static function update() {
		$query = DB :: $dbh -> query("SELECT id FROM platforms");			
		while ($act = $query -> fetch()):	
			self::save($act['id']);
		endwhile;
	}
}
?>