Skip to content

Commit e9907db

Browse files
authored
[Chore] Added one time operations package (alexjustesen#1100)
1 parent da8e51e commit e9907db

File tree

3 files changed

+94
-37
lines changed

3 files changed

+94
-37
lines changed

_ide_helper.php

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4342,7 +4342,7 @@ public static function macroCall($method, $parameters)
43424342
*/
43434343
public static function lock($name, $seconds = 0, $owner = null)
43444344
{
4345-
/** @var \Illuminate\Cache\FileStore $instance */
4345+
/** @var \Illuminate\Cache\DatabaseStore $instance */
43464346
return $instance->lock($name, $seconds, $owner);
43474347
}
43484348
/**
@@ -4355,65 +4355,54 @@ public static function lock($name, $seconds = 0, $owner = null)
43554355
*/
43564356
public static function restoreLock($name, $owner)
43574357
{
4358-
/** @var \Illuminate\Cache\FileStore $instance */
4358+
/** @var \Illuminate\Cache\DatabaseStore $instance */
43594359
return $instance->restoreLock($name, $owner);
43604360
}
43614361
/**
4362-
* Remove all items from the cache.
4363-
*
4364-
* @return bool
4365-
* @static
4366-
*/
4367-
public static function flush()
4368-
{
4369-
/** @var \Illuminate\Cache\FileStore $instance */
4370-
return $instance->flush();
4371-
}
4372-
/**
4373-
* Get the full path for the given cache key.
4362+
* Remove an item from the cache if it is expired.
43744363
*
43754364
* @param string $key
4376-
* @return string
4365+
* @return bool
43774366
* @static
43784367
*/
4379-
public static function path($key)
4368+
public static function forgetIfExpired($key)
43804369
{
4381-
/** @var \Illuminate\Cache\FileStore $instance */
4382-
return $instance->path($key);
4370+
/** @var \Illuminate\Cache\DatabaseStore $instance */
4371+
return $instance->forgetIfExpired($key);
43834372
}
43844373
/**
4385-
* Get the Filesystem instance.
4374+
* Remove all items from the cache.
43864375
*
4387-
* @return \Illuminate\Filesystem\Filesystem
4376+
* @return bool
43884377
* @static
43894378
*/
4390-
public static function getFilesystem()
4379+
public static function flush()
43914380
{
4392-
/** @var \Illuminate\Cache\FileStore $instance */
4393-
return $instance->getFilesystem();
4381+
/** @var \Illuminate\Cache\DatabaseStore $instance */
4382+
return $instance->flush();
43944383
}
43954384
/**
4396-
* Get the working directory of the cache.
4385+
* Get the underlying database connection.
43974386
*
4398-
* @return string
4387+
* @return \Illuminate\Database\MySqlConnection
43994388
* @static
44004389
*/
4401-
public static function getDirectory()
4390+
public static function getConnection()
44024391
{
4403-
/** @var \Illuminate\Cache\FileStore $instance */
4404-
return $instance->getDirectory();
4392+
/** @var \Illuminate\Cache\DatabaseStore $instance */
4393+
return $instance->getConnection();
44054394
}
44064395
/**
4407-
* Set the cache directory where locks should be stored.
4396+
* Specify the name of the connection that should be used to manage locks.
44084397
*
4409-
* @param string|null $lockDirectory
4410-
* @return \Illuminate\Cache\FileStore
4398+
* @param \Illuminate\Database\ConnectionInterface $connection
4399+
* @return \Illuminate\Cache\DatabaseStore
44114400
* @static
44124401
*/
4413-
public static function setLockDirectory($lockDirectory)
4402+
public static function setLockConnection($connection)
44144403
{
4415-
/** @var \Illuminate\Cache\FileStore $instance */
4416-
return $instance->setLockDirectory($lockDirectory);
4404+
/** @var \Illuminate\Cache\DatabaseStore $instance */
4405+
return $instance->setLockConnection($connection);
44174406
}
44184407
/**
44194408
* Get the cache key prefix.
@@ -4423,7 +4412,7 @@ public static function setLockDirectory($lockDirectory)
44234412
*/
44244413
public static function getPrefix()
44254414
{
4426-
/** @var \Illuminate\Cache\FileStore $instance */
4415+
/** @var \Illuminate\Cache\DatabaseStore $instance */
44274416
return $instance->getPrefix();
44284417
}
44294418

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"livewire/livewire": "^3.4.4",
2626
"maatwebsite/excel": "^3.1.52",
2727
"maennchen/zipstream-php": "^2.4",
28-
"spatie/laravel-settings": "^2.8.3"
28+
"spatie/laravel-settings": "^2.8.3",
29+
"timokoerber/laravel-one-time-operations": "^1.4"
2930
},
3031
"require-dev": {
3132
"barryvdh/laravel-ide-helper": "^2.13",

composer.lock

Lines changed: 68 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)