gyro/core/controller/base/cachemanager/headermanager/cacheheadermanager.factory.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * Simple factory for cache header manager 00004 */ 00005 class CacheHeaderManagerFactory { 00006 /** 00007 * Create instance from class name stub. 00008 * 00009 * Stub is class name without CacheHeaderManager, e.g. FullCache for FullCacheCacheHeaderManager 00010 * 00011 * @return ICacheHeaderManager 00012 */ 00013 public static function create($stub) { 00014 $cls = $stub . 'CacheHeaderManager'; 00015 if (class_exists($cls)) { 00016 return new $cls(); 00017 } 00018 throw new Exception('Unknown cache header manager: ' . $stub); 00019 } 00020 }