AbstractStorage.Class.php 615 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Mall\Framework\Cache;
  3. abstract class AbstractStorage implements StorageInterface
  4. {
  5. protected $prefix = 'mallguang::';
  6. protected $options = array();
  7. protected $ttl = 0;
  8. public function __construct($options = null)
  9. {
  10. if (!is_array($options)) {
  11. throw new \Exception('Cache options cannot be found');
  12. }
  13. $this->options = $options;
  14. $prefix = FALSE;
  15. if ($this->options['prefix']) {
  16. $prefix = str_replace(':', '', $this->options['prefix']) . '::';
  17. }
  18. $this->prefix = $prefix ?: $this->prefix;
  19. }
  20. }