1 | <?php namespace Arcanesoft\Media; |
||
14 | class Media implements MediaContract |
||
15 | { |
||
16 | /* ----------------------------------------------------------------- |
||
17 | | Properties |
||
18 | | ----------------------------------------------------------------- |
||
19 | */ |
||
20 | /** |
||
21 | * The application instance. |
||
22 | * |
||
23 | * @var \Illuminate\Contracts\Foundation\Application |
||
24 | */ |
||
25 | protected $app; |
||
26 | |||
27 | /* ----------------------------------------------------------------- |
||
28 | | Constructor |
||
29 | | ----------------------------------------------------------------- |
||
30 | */ |
||
31 | /** |
||
32 | * Media constructor. |
||
33 | * |
||
34 | 6 | * @param \Illuminate\Contracts\Foundation\Application $app |
|
35 | */ |
||
36 | 6 | public function __construct(Application $app) |
|
40 | |||
41 | /* ----------------------------------------------------------------- |
||
42 | | Getters & Setters |
||
43 | | ----------------------------------------------------------------- |
||
44 | */ |
||
45 | /** |
||
46 | * Get the Filesystem Manager instance. |
||
47 | * |
||
48 | 3 | * @return \Illuminate\Contracts\Filesystem\Factory |
|
49 | */ |
||
50 | 3 | public function filesystem() |
|
54 | |||
55 | /** |
||
56 | * Get the Config Repository. |
||
57 | * |
||
58 | 3 | * @return \Illuminate\Contracts\Config\Repository |
|
59 | */ |
||
60 | 3 | protected function config() |
|
64 | |||
65 | /** |
||
66 | * Get the default disk name. |
||
67 | * |
||
68 | * @return string |
||
69 | */ |
||
70 | public function getDefaultDiskName() |
||
74 | 3 | ||
75 | /* ----------------------------------------------------------------- |
||
76 | 3 | | Main Methods |
|
77 | | ----------------------------------------------------------------- |
||
78 | */ |
||
79 | /** |
||
80 | * Get a filesystem adapter. |
||
81 | * |
||
82 | * @param string|null $driver |
||
83 | * |
||
84 | 3 | * @return \Illuminate\Filesystem\FilesystemAdapter|\Illuminate\Contracts\Filesystem\Filesystem |
|
85 | */ |
||
86 | 3 | public function disk($driver = null) |
|
90 | |||
91 | /** |
||
92 | * Get the default filesystem adapter. |
||
93 | * |
||
94 | * @return \Illuminate\Filesystem\FilesystemAdapter|\Illuminate\Contracts\Filesystem\Filesystem |
||
95 | */ |
||
96 | public function defaultDisk() |
||
100 | |||
101 | /** |
||
102 | * Get all of the directories within a given directory. |
||
103 | * |
||
104 | * @param string $directory |
||
105 | * |
||
106 | * @return \Arcanesoft\Media\Entities\DirectoryCollection |
||
107 | */ |
||
108 | public function directories($directory) |
||
119 | |||
120 | /** |
||
121 | * Get a collection of all files in a directory. |
||
122 | * |
||
123 | * @param string $directory |
||
124 | * |
||
125 | * @return \Arcanesoft\Media\Entities\FileCollection |
||
126 | */ |
||
127 | public function files($directory) |
||
146 | |||
147 | /** |
||
148 | * Get all the directories & files from a given location. |
||
149 | * |
||
150 | * @param string $directory |
||
151 | * |
||
152 | * @return array |
||
153 | */ |
||
154 | public function all($directory) |
||
166 | |||
167 | /** |
||
168 | * Store an array of files. |
||
169 | * |
||
170 | * @param string $directory |
||
171 | * @param array $files |
||
172 | */ |
||
173 | public function storeMany($directory, array $files) |
||
179 | |||
180 | /** |
||
181 | * Store a file. |
||
182 | * |
||
183 | * @param string $directory |
||
184 | * @param \Illuminate\Http\UploadedFile $file |
||
185 | * |
||
186 | * @return string|false |
||
187 | */ |
||
188 | public function store($directory, UploadedFile $file) |
||
192 | |||
193 | /** |
||
194 | * Create a directory. |
||
195 | * |
||
196 | * @param string $path |
||
197 | * |
||
198 | * @return bool |
||
199 | */ |
||
200 | public function makeDirectory($path) |
||
204 | |||
205 | /** |
||
206 | * Move a file to a new location. |
||
207 | * |
||
208 | * @param string $from |
||
209 | * @param string $to |
||
210 | * |
||
211 | * @return bool |
||
212 | */ |
||
213 | public function move($from, $to) |
||
217 | } |
||
218 |