Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.4] Add ability to keep old files when testing uploads [second attempt] #19859

Merged
merged 3 commits into from
Jul 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/Illuminate/Support/Facades/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
class Storage extends Facade
{
/**
* Replace the given disk with a local, testing disk.
* Replace the given disk with a local testing disk.
*
* @param string $disk
*
* @return void
*/
public static function fake($disk)
Expand All @@ -24,6 +25,19 @@ public static function fake($disk)
static::set($disk, self::createLocalDriver(['root' => $root]));
}

/**
* Replace the given disk with a persistent local testing disk.
*
* @param string $disk
* @return void
*/
public static function persistentFake($disk)
{
static::set($disk, self::createLocalDriver([
'root' => storage_path('framework/testing/disks/' . $disk)
]));
}

/**
* Get the registered name of the component.
*
Expand Down