App.php
2 years ago
Artisan.php
2 years ago
Auth.php
2 years ago
Blade.php
2 years ago
Broadcast.php
2 years ago
Bus.php
2 years ago
Cache.php
2 years ago
Config.php
2 years ago
Cookie.php
2 years ago
Crypt.php
2 years ago
DB.php
2 years ago
Date.php
2 years ago
Event.php
2 years ago
Facade.php
2 years ago
File.php
2 years ago
Gate.php
2 years ago
Hash.php
2 years ago
Http.php
2 years ago
Lang.php
2 years ago
Log.php
2 years ago
Mail.php
2 years ago
Notification.php
2 years ago
ParallelTesting.php
2 years ago
Password.php
2 years ago
Queue.php
2 years ago
RateLimiter.php
2 years ago
Redirect.php
2 years ago
Redis.php
2 years ago
Request.php
2 years ago
Response.php
2 years ago
Route.php
2 years ago
Schema.php
2 years ago
Session.php
2 years ago
Storage.php
2 years ago
URL.php
2 years ago
Validator.php
2 years ago
View.php
2 years ago
Storage.php
91 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP_SCOPED\Illuminate\Support\Facades; |
| 4 | |
| 5 | use IAWP_SCOPED\Illuminate\Filesystem\Filesystem; |
| 6 | /** |
| 7 | * @method static \Illuminate\Contracts\Filesystem\Filesystem assertExists(string|array $path) |
| 8 | * @method static \Illuminate\Contracts\Filesystem\Filesystem assertMissing(string|array $path) |
| 9 | * @method static \Illuminate\Contracts\Filesystem\Filesystem cloud() |
| 10 | * @method static \Illuminate\Contracts\Filesystem\Filesystem build(string|array $root) |
| 11 | * @method static \Illuminate\Contracts\Filesystem\Filesystem disk(string|null $name = null) |
| 12 | * @method static \Illuminate\Filesystem\FilesystemManager extend(string $driver, \Closure $callback) |
| 13 | * @method static \Symfony\Component\HttpFoundation\StreamedResponse download(string $path, string|null $name = null, array|null $headers = []) |
| 14 | * @method static \Symfony\Component\HttpFoundation\StreamedResponse response(string $path, string|null $name = null, array|null $headers = [], string|null $disposition = 'inline') |
| 15 | * @method static array allDirectories(string|null $directory = null) |
| 16 | * @method static array allFiles(string|null $directory = null) |
| 17 | * @method static array directories(string|null $directory = null, bool $recursive = false) |
| 18 | * @method static array files(string|null $directory = null, bool $recursive = false) |
| 19 | * @method static bool append(string $path, string $data) |
| 20 | * @method static bool copy(string $from, string $to) |
| 21 | * @method static bool delete(string|array $paths) |
| 22 | * @method static bool deleteDirectory(string $directory) |
| 23 | * @method static bool exists(string $path) |
| 24 | * @method static bool makeDirectory(string $path) |
| 25 | * @method static bool missing(string $path) |
| 26 | * @method static bool move(string $from, string $to) |
| 27 | * @method static bool prepend(string $path, string $data) |
| 28 | * @method static bool put(string $path, \Psr\Http\Message\StreamInterface|\Illuminate\Http\File|\Illuminate\Http\UploadedFile|string|resource $contents, mixed $options = []) |
| 29 | * @method static bool setVisibility(string $path, string $visibility) |
| 30 | * @method static bool writeStream(string $path, resource $resource, array $options = []) |
| 31 | * @method static int lastModified(string $path) |
| 32 | * @method static int size(string $path) |
| 33 | * @method static resource|null readStream(string $path) |
| 34 | * @method static string get(string $path) |
| 35 | * @method static string getVisibility(string $path) |
| 36 | * @method static string path(string $path) |
| 37 | * @method static string temporaryUrl(string $path, \DateTimeInterface $expiration, array $options = []) |
| 38 | * @method static string url(string $path) |
| 39 | * @method static string|false mimeType(string $path) |
| 40 | * @method static string|false putFile(string $path, \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $file, mixed $options = []) |
| 41 | * @method static string|false putFileAs(string $path, \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $file, string $name, mixed $options = []) |
| 42 | * @method static void macro(string $name, object|callable $macro) |
| 43 | * @method static void buildTemporaryUrlsUsing(\Closure $callback) |
| 44 | * |
| 45 | * @see \Illuminate\Filesystem\FilesystemManager |
| 46 | * @internal |
| 47 | */ |
| 48 | class Storage extends Facade |
| 49 | { |
| 50 | /** |
| 51 | * Replace the given disk with a local testing disk. |
| 52 | * |
| 53 | * @param string|null $disk |
| 54 | * @param array $config |
| 55 | * @return \Illuminate\Contracts\Filesystem\Filesystem |
| 56 | */ |
| 57 | public static function fake($disk = null, array $config = []) |
| 58 | { |
| 59 | $disk = $disk ?: static::$app['config']->get('filesystems.default'); |
| 60 | $root = storage_path('framework/testing/disks/' . $disk); |
| 61 | if ($token = ParallelTesting::token()) { |
| 62 | $root = "{$root}_test_{$token}"; |
| 63 | } |
| 64 | (new Filesystem())->cleanDirectory($root); |
| 65 | static::set($disk, $fake = static::createLocalDriver(\array_merge($config, ['root' => $root]))); |
| 66 | return $fake; |
| 67 | } |
| 68 | /** |
| 69 | * Replace the given disk with a persistent local testing disk. |
| 70 | * |
| 71 | * @param string|null $disk |
| 72 | * @param array $config |
| 73 | * @return \Illuminate\Contracts\Filesystem\Filesystem |
| 74 | */ |
| 75 | public static function persistentFake($disk = null, array $config = []) |
| 76 | { |
| 77 | $disk = $disk ?: static::$app['config']->get('filesystems.default'); |
| 78 | static::set($disk, $fake = static::createLocalDriver(\array_merge($config, ['root' => storage_path('framework/testing/disks/' . $disk)]))); |
| 79 | return $fake; |
| 80 | } |
| 81 | /** |
| 82 | * Get the registered name of the component. |
| 83 | * |
| 84 | * @return string |
| 85 | */ |
| 86 | protected static function getFacadeAccessor() |
| 87 | { |
| 88 | return 'filesystem'; |
| 89 | } |
| 90 | } |
| 91 |