Login   Register  
PHP Classes
elePHPant
Icontem

File: src/PHPVideoToolkit/CacheAbstract.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Oliver Lillie  >  PHP Video Toolkit  >  src/PHPVideoToolkit/CacheAbstract.php  >  Download  
File: src/PHPVideoToolkit/CacheAbstract.php
Role: Class source
Content type: text/plain
Description: Class source
Class: PHP Video Toolkit
Manipulate and convert videos with ffmpeg program
Author: By
Last change: updated copy right years and a incorrect version number
updated version number in class files
Date: 2 months ago
Size: 1,569 bytes
 

Contents

Class file image Download
<?php
    
    
/**
     * This file is part of the PHP Video Toolkit v2 package.
     *
     * @author Oliver Lillie (aka buggedcom) <publicmail@buggedcom.co.uk>
     * @license Dual licensed under MIT and GPLv2
     * @copyright Copyright (c) 2008-2014 Oliver Lillie <http://www.buggedcom.co.uk>
     * @package PHPVideoToolkit V2
     * @version 2.1.1
     * @uses ffmpeg http://ffmpeg.sourceforge.net/
     */
     
    
namespace PHPVideoToolkit;

    
/**
     * @access public
     * @author Oliver Lillie
     * @package default
     */
    
abstract class CacheAbstract implements CacheInterface
    
{
        protected 
$_cache_object;
        
        private 
$_key_prefix 'phpvideotoolkit_v2/';
        
        final public function 
__construct(CacheInterface $cache_object)
        {
            
$this->_cache_object $cache_object;
        }
        
        final public function 
set($key$value$expiration=null)
        {
            
$this->_cache[$key] = $value;
            
            return 
$this->_set($this->_key_prefix.$key$value$expiration);
        }
        
        final public function 
get($key$default_value=null)
        {
            
$key $this->_key_prefix.$key;
            
            if(
$this->_isMiss($key) === true)
            {
                return 
$default_value;
            }
            return 
$this->_get($key);
        }
        
        abstract protected function 
_get($key);
        abstract protected function 
_isMiss($key);
        abstract protected function 
_set($key$value$expiration=null);
    }