1+ <?php namespace Illuminate \Contracts \Filesystem ;
2+
3+ interface Filesystem {
4+
5+ /**
6+ * The public visibility setting.
7+ *
8+ * @var string
9+ */
10+ const VISIBILITY_PUBLIC = 'public ' ;
11+
12+ /**
13+ * The private visibility setting.
14+ *
15+ * @var string
16+ */
17+ const VISIBILITY_PRIVATE = 'private ' ;
18+
19+ /**
20+ * Determine if a file exists.
21+ *
22+ * @param string $path
23+ * @return bool
24+ */
25+ public function exists ($ path );
26+
27+ /**
28+ * Get the contents of a file.
29+ *
30+ * @param string $path
31+ * @return string
32+ *
33+ * @throws FileNotFoundException
34+ */
35+ public function get ($ path );
36+
37+ /**
38+ * Write the contents of a file.
39+ *
40+ * @param string $path
41+ * @param string $contents
42+ * @param string $visibility
43+ * @return bool
44+ */
45+ public function put ($ path , $ contents , $ visibility = null );
46+
47+ /**
48+ * Get the visibility for the given path.
49+ *
50+ * @param string $path
51+ * @return string
52+ */
53+ public function getVisibility ($ path );
54+
55+ /**
56+ * Set the visibility for the given path.
57+ *
58+ * @param string $path
59+ * @param string $visibility
60+ * @return void
61+ */
62+ public function setVisibility ($ path , $ visibility );
63+
64+ /**
65+ * Prepend to a file.
66+ *
67+ * @param string $path
68+ * @param string $data
69+ * @return int
70+ */
71+ public function prepend ($ path , $ data );
72+
73+ /**
74+ * Append to a file.
75+ *
76+ * @param string $path
77+ * @param string $data
78+ * @return int
79+ */
80+ public function append ($ path , $ data );
81+
82+ /**
83+ * Delete the file at a given path.
84+ *
85+ * @param string|array $paths
86+ * @return bool
87+ */
88+ public function delete ($ paths );
89+
90+ /**
91+ * Copy a file to a new location.
92+ *
93+ * @param string $from
94+ * @param string $to
95+ * @return bool
96+ */
97+ public function copy ($ from , $ to );
98+
99+ /**
100+ * Move a file to a new location.
101+ *
102+ * @param string $from
103+ * @param string $to
104+ * @return bool
105+ */
106+ public function move ($ from , $ to );
107+
108+ /**
109+ * Get the file size of a given file.
110+ *
111+ * @param string $path
112+ * @return int
113+ */
114+ public function size ($ path );
115+
116+ /**
117+ * Get the file's last modification time.
118+ *
119+ * @param string $path
120+ * @return int
121+ */
122+ public function lastModified ($ path );
123+
124+ /**
125+ * Get an array of all files in a directory.
126+ *
127+ * @param string|null $directory
128+ * @param bool $recursive
129+ * @return array
130+ */
131+ public function files ($ directory = null , $ recursive = false );
132+
133+ /**
134+ * Get all of the files from the given directory (recursive).
135+ *
136+ * @param string|null $directory
137+ * @return array
138+ */
139+ public function allFiles ($ directory = null );
140+
141+ /**
142+ * Get all of the directories within a given directory.
143+ *
144+ * @param string|null $directory
145+ * @param bool $recursive
146+ * @return array
147+ */
148+ public function directories ($ directory = null , $ recursive = false );
149+
150+ /**
151+ * Get all (recursive) of the directories within a given directory.
152+ *
153+ * @param string|null $directory
154+ * @return array
155+ */
156+ public function allDirectories ($ directory = null );
157+
158+ /**
159+ * Create a directory.
160+ *
161+ * @param string $path
162+ * @return bool
163+ */
164+ public function makeDirectory ($ path );
165+
166+ /**
167+ * Recursively delete a directory.
168+ *
169+ * @param string $directory
170+ * @return bool
171+ */
172+ public function deleteDirectory ($ directory );
173+
174+ }
0 commit comments