Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / mikey179 / vfsStream / src / main / php / org / bovigo / vfs / vfsStreamContent.php
1 <?php
2 /**
3  * This file is part of vfsStream.
4  *
5  * For the full copyright and license information, please view the LICENSE
6  * file that was distributed with this source code.
7  *
8  * @package  org\bovigo\vfs
9  */
10 namespace org\bovigo\vfs;
11 /**
12  * Interface for stream contents.
13  */
14 interface vfsStreamContent
15 {
16     /**
17      * stream content type: file
18      *
19      * @see  getType()
20      */
21     const TYPE_FILE = 0100000;
22     /**
23      * stream content type: directory
24      *
25      * @see  getType()
26      */
27     const TYPE_DIR  = 0040000;
28     /**
29      * stream content type: symbolic link
30      *
31      * @see  getType();
32      */
33     #const TYPE_LINK = 0120000;
34
35     /**
36      * stream content type: block
37      *
38      * @see getType()
39      */
40     const TYPE_BLOCK = 0060000;
41
42     /**
43      * returns the file name of the content
44      *
45      * @return  string
46      */
47     public function getName();
48
49     /**
50      * renames the content
51      *
52      * @param  string  $newName
53      */
54     public function rename($newName);
55
56     /**
57      * checks whether the container can be applied to given name
58      *
59      * @param   string  $name
60      * @return  bool
61      */
62     public function appliesTo($name);
63
64     /**
65      * returns the type of the container
66      *
67      * @return  int
68      */
69     public function getType();
70
71     /**
72      * returns size of content
73      *
74      * @return  int
75      */
76     public function size();
77
78     /**
79      * sets the last modification time of the stream content
80      *
81      * @param   int  $filemtime
82      * @return  vfsStreamContent
83      */
84     public function lastModified($filemtime);
85
86     /**
87      * returns the last modification time of the stream content
88      *
89      * @return  int
90      */
91     public function filemtime();
92
93     /**
94      * adds content to given container
95      *
96      * @param   vfsStreamContainer  $container
97      * @return  vfsStreamContent
98      */
99     public function at(vfsStreamContainer $container);
100
101     /**
102      * change file mode to given permissions
103      *
104      * @param   int  $permissions
105      * @return  vfsStreamContent
106      */
107     public function chmod($permissions);
108
109     /**
110      * returns permissions
111      *
112      * @return  int
113      */
114     public function getPermissions();
115
116     /**
117      * checks whether content is readable
118      *
119      * @param   int   $user   id of user to check for
120      * @param   int   $group  id of group to check for
121      * @return  bool
122      */
123     public function isReadable($user, $group);
124
125     /**
126      * checks whether content is writable
127      *
128      * @param   int   $user   id of user to check for
129      * @param   int   $group  id of group to check for
130      * @return  bool
131      */
132     public function isWritable($user, $group);
133
134     /**
135      * checks whether content is executable
136      *
137      * @param   int   $user   id of user to check for
138      * @param   int   $group  id of group to check for
139      * @return  bool
140      */
141     public function isExecutable($user, $group);
142
143     /**
144      * change owner of file to given user
145      *
146      * @param   int  $user
147      * @return  vfsStreamContent
148      */
149     public function chown($user);
150
151     /**
152      * checks whether file is owned by given user
153      *
154      * @param   int  $user
155      * @return  bool
156      */
157     public function isOwnedByUser($user);
158
159     /**
160      * returns owner of file
161      *
162      * @return  int
163      */
164     public function getUser();
165
166     /**
167      * change owner group of file to given group
168      *
169      * @param   int  $group
170      * @return  vfsStreamContent
171      */
172     public function chgrp($group);
173
174     /**
175      * checks whether file is owned by group
176      *
177      * @param   int   $group
178      * @return  bool
179      */
180     public function isOwnedByGroup($group);
181
182     /**
183      * returns owner group of file
184      *
185      * @return  int
186      */
187     public function getGroup();
188
189     /**
190      * sets parent path
191      *
192      * @param  string  $parentPath
193      * @internal  only to be set by parent
194      * @since   1.2.0
195      */
196     public function setParentPath($parentPath);
197
198     /**
199      * returns path to this content
200      *
201      * @return  string
202      * @since   1.2.0
203      */
204     public function path();
205
206     /**
207      * returns complete vfsStream url for this content
208      *
209      * @return  string
210      * @since   1.2.0
211      */
212     public function url();
213 }