October\Rain\Halcyon\MemoryRepository

Source: ~/vendor/october/rain/src/Halcyon/MemoryRepository.php

Extends:

  • Illuminate\Cache\Repository

Implements:

  • ArrayAccess
  • Psr\SimpleCache\CacheInterface
  • Illuminate\Contracts\Cache\Repository

Provides a simple request-level cache.

Protected properties

protected array $cache

Values stored in memory

Show inherited protected properties

Inherited protected properties

  • protected Illuminate\Contracts\Cache\Store $store - defined in Illuminate\Cache\Repository. The cache store implementation.
  • protected Illuminate\Contracts\Events\Dispatcher $events - defined in Illuminate\Cache\Repository. The event dispatcher implementation.
  • protected float|int $default - defined in Illuminate\Cache\Repository. The default number of minutes to store items.
  • protected static array $macros - defined in Illuminate\Cache\Repository. The registered string macros.

Public methods

public int|bool decrement(string $key, mixed $value=1)

Decrement the value of an item in the cache.

Parameters
  • string $key
  • mixed $value

public bool flush()

Remove all items from the cache.

public void flushInternalCache()

Flushes the memory cache. Calling this directly is generally only useful in testing. Use flush() otherwise.

public void forever(string $key, mixed $value)

Store an item in the cache indefinitely.

Parameters
  • string $key
  • mixed $value

public bool forget(string $key)

Remove an item from the cache.

Parameters
  • string $key

public mixed get(string|array $key, mixed $default=NULL)

Retrieve an item from the cache by key.

Parameters
  • string|array $key
  • mixed $default

public mixed getFromMemoryCache($key $key)

Retrieve an item from the internal memory cache without trying the external driver. Used in testing

Parameters
  • $key $key

public string getPrefix()

Get the cache key prefix.

public int|bool increment(string $key, mixed $value=1)

Increment the value of an item in the cache.

Parameters
  • string $key
  • mixed $value

public void put(string $key, mixed $value, DateTimeInterface|\DateInterval|float|int $minutes=NULL)

Store an item in the cache.

Parameters
  • string $key
  • mixed $value
  • DateTimeInterface|\DateInterval|float|int $minutes

public void putInMemoryCache($key $key, $value $value)

Puts an item in the memory cache, but not in the external cache. Used in testing

Parameters
  • $key $key
  • $value $value

Show inherited public methods

Inherited public methods

  • public mixed __call(string $method, array $parameters) - defined in Illuminate\Cache\Repository. Handle dynamic calls into macros or pass missing methods to the store.
  • public static mixed __callStatic(string $method, array $parameters) - defined in Illuminate\Cache\Repository. Dynamically handle calls to the class.
  • public void __clone() - defined in Illuminate\Cache\Repository. Clone cache repository instance.
  • public void __construct(Illuminate\Contracts\Cache\Store $store) - defined in Illuminate\Cache\Repository. Create a new cache repository instance.
  • public bool add(string $key, mixed $value, DateTimeInterface|\DateInterval|float|int $minutes) - defined in Illuminate\Cache\Repository. Store an item in the cache if the key does not exist.
  • public void clear() - defined in Illuminate\Cache\Repository. {@inheritdoc}.
  • public void delete($key) - defined in Illuminate\Cache\Repository. {@inheritdoc}.
  • public void deleteMultiple($keys) - defined in Illuminate\Cache\Repository. {@inheritdoc}.
  • public float|int getDefaultCacheTime() - defined in Illuminate\Cache\Repository. Get the default cache time.
  • public void getMultiple($keys, $default=NULL) - defined in Illuminate\Cache\Repository. {@inheritdoc}.
  • public Illuminate\Contracts\Cache\Store getStore() - defined in Illuminate\Cache\Repository. Get the cache store implementation.
  • public bool has(string $key) - defined in Illuminate\Cache\Repository. Determine if an item exists in the cache.
  • public static bool hasMacro(string $name) - defined in Illuminate\Cache\Repository. Checks if macro is registered.
  • public static void macro(string $name, object|callable $macro) - defined in Illuminate\Cache\Repository. Register a custom macro.
  • public mixed macroCall(string $method, array $parameters) - defined in Illuminate\Cache\Repository. Dynamically handle calls to the class.
  • public array many(array $keys) - defined in Illuminate\Cache\Repository. Retrieve multiple items from the cache by key.
  • public static void mixin(object $mixin) - defined in Illuminate\Cache\Repository. Mix another object into the class.
  • public bool offsetExists(string $key) - defined in Illuminate\Cache\Repository. Determine if a cached value exists.
  • public mixed offsetGet(string $key) - defined in Illuminate\Cache\Repository. Retrieve an item from the cache by key.
  • public void offsetSet(string $key, mixed $value) - defined in Illuminate\Cache\Repository. Store an item in the cache for the default time.
  • public void offsetUnset(string $key) - defined in Illuminate\Cache\Repository. Remove an item from the cache.
  • public mixed pull(string $key, mixed $default=NULL) - defined in Illuminate\Cache\Repository. Retrieve an item from the cache and delete it.
  • public void putMany(array $values, DateTimeInterface|\DateInterval|float|int $minutes) - defined in Illuminate\Cache\Repository. Store multiple items in the cache for a given number of minutes.
  • public mixed remember(string $key, DateTimeInterface|\DateInterval|float|int $minutes, Closure $callback) - defined in Illuminate\Cache\Repository. Get an item from the cache, or store the default value.
  • public mixed rememberForever(string $key, Closure $callback) - defined in Illuminate\Cache\Repository. Get an item from the cache, or store the default value forever.
  • public mixed sear(string $key, Closure $callback) - defined in Illuminate\Cache\Repository. Get an item from the cache, or store the default value forever.
  • public void set($key, $value, $ttl=NULL) - defined in Illuminate\Cache\Repository. {@inheritdoc}.
  • public $this setDefaultCacheTime(float|int $minutes) - defined in Illuminate\Cache\Repository. Set the default cache time in minutes.
  • public void setEventDispatcher(Illuminate\Contracts\Events\Dispatcher $events) - defined in Illuminate\Cache\Repository. Set the event dispatcher instance.
  • public void setMultiple($values, $ttl=NULL) - defined in Illuminate\Cache\Repository. {@inheritdoc}.
  • public Illuminate\Cache\TaggedCache tags(array|mixed $names) - defined in Illuminate\Cache\Repository. Begin executing a new tags operation if the store supports it.

Protected methods

Show inherited protected methods

Inherited protected methods

  • protected int availableAt(DateTimeInterface|\DateInterval|int $delay=0) - defined in Illuminate\Cache\Repository. Get the "available at" UNIX timestamp.
  • protected int currentTime() - defined in Illuminate\Cache\Repository. Get the current system time as a UNIX timestamp.
  • protected void event(string $event) - defined in Illuminate\Cache\Repository. Fire an event for this cache instance.
  • protected float|int|null getMinutes(DateTimeInterface|\DateInterval|float|int $duration) - defined in Illuminate\Cache\Repository. Calculate the number of minutes with the given duration.
  • protected mixed handleManyResult(array $keys, string $key, mixed $value) - defined in Illuminate\Cache\Repository. Handle a result for the "many" method.
  • protected string itemKey(string $key) - defined in Illuminate\Cache\Repository. Format the key for a cache item.
  • protected DateTimeInterface|int parseDateInterval(DateTimeInterface|\DateInterval|int $delay) - defined in Illuminate\Cache\Repository. If the given value is an interval, convert it to a DateTime instance.
  • protected int secondsUntil(DateTimeInterface|\DateInterval|int $delay) - defined in Illuminate\Cache\Repository. Get the number of seconds until the given DateTime.