Skip to content

Commit

Permalink
[11.x] Add setters to cache stores (#50912)
Browse files Browse the repository at this point in the history
* Add setPrefix() to ApcStore and DatabaseStore

* Add setDirectory() setter to FileStore
  • Loading branch information
stancl authored Apr 4, 2024
1 parent 982c494 commit 3002511
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Illuminate/Cache/ApcStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,15 @@ public function getPrefix()
{
return $this->prefix;
}

/**
* Set the cache key prefix.
*
* @param string $prefix
* @return void
*/
public function setPrefix($prefix)
{
$this->prefix = $prefix;
}
}
11 changes: 11 additions & 0 deletions src/Illuminate/Cache/DatabaseStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,17 @@ public function getPrefix()
return $this->prefix;
}

/**
* Set the cache key prefix.
*
* @param string $prefix
* @return void
*/
public function setPrefix($prefix)
{
$this->prefix = $prefix;
}

/**
* Serialize the given value.
*
Expand Down
13 changes: 13 additions & 0 deletions src/Illuminate/Cache/FileStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,19 @@ public function getDirectory()
return $this->directory;
}

/**
* Set the working directory of the cache.
*
* @param string $directory
* @return $this
*/
public function setDirectory($directory)
{
$this->directory = $directory;

return $this;
}

/**
* Set the cache directory where locks should be stored.
*
Expand Down

0 comments on commit 3002511

Please sign in to comment.