Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Created by JetBrains PhpStorm.
- * User: David
- * Date: 6/12/12
- * Time: 9:35 AM
- * To change this template use File | Settings | File Templates.
- */
- include_once 'Yp_cache_file.php';
- class Yp_cache_file_directory extends Yp_cache
- {
- private $dir = '';
- private $ext = 'cache';
- function get_file_full_path($key, $type='') {
- $file_name = $key;
- if($type!='') $file_name .= '-'.$type;
- $file_name = $this->getDir().'/'.$file_name.'.'.$this->getExt();
- return $file_name;
- }
- function cache_flush() {
- //delete all files
- $mask = $this->getDir().'/*.'.$this->getExt();
- array_map( "unlink", glob( $mask ) );
- }
- public function setDir($dir)
- {
- $this->dir = $dir;
- }
- public function getDir()
- {
- return $this->dir;
- }
- public function setExt($ext)
- {
- $this->ext = $ext;
- }
- public function getExt()
- {
- return $this->ext;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement