1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace WeWork\Laravel;
- use Illuminate\Support\Facades\Cache;
- use Psr\SimpleCache\CacheInterface;
- class CacheBridge implements CacheInterface
- {
- public function get($key, $default = null)
- {
- return Cache::get($key, $default);
- }
- public function set($key, $value, $ttl = null)
- {
- Cache::put($key, $value, $this->toMinutes($ttl));
- }
- public function delete($key)
- {
- //
- }
- public function clear()
- {
- //
- }
- public function getMultiple($keys, $default = null)
- {
- //
- }
- public function setMultiple($values, $ttl = null)
- {
- //
- }
- public function deleteMultiple($keys)
- {
- //
- }
- public function has($key)
- {
- return Cache::has($key);
- }
- protected function toMinutes($ttl = null)
- {
- if (!is_null($ttl)) {
- return $ttl / 60;
- }
- }
- }
|