CacheAdapterFactory.php 294 B

1234567891011121314
  1. <?php
  2. class LtCacheAdapterFactory
  3. {
  4. public function getConnectionAdapter($adapter)
  5. {
  6. $adapterClassName = "LtCacheAdapter" . ucfirst($adapter);
  7. if(!class_exists($adapterClassName))
  8. {
  9. trigger_error("Invalid adapter: $adapter");
  10. return null;
  11. }
  12. return new $adapterClassName;
  13. }
  14. }