scratch – Blame information for rev 120
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
120 | office | 1 | <?php |
2 | |||
3 | /* |
||
4 | * This file is part of TemporaryFilesystem. |
||
5 | * |
||
6 | * (c) Romain Neutron <imprec@gmail.com> |
||
7 | * |
||
8 | * For the full copyright and license information, please view the LICENSE |
||
9 | * file that was distributed with this source code. |
||
10 | */ |
||
11 | |||
12 | namespace Neutron\TemporaryFilesystem; |
||
13 | |||
14 | use Symfony\Component\Filesystem\Exception\IOException; |
||
15 | |||
16 | interface TemporaryFilesystemInterface |
||
17 | { |
||
18 | /** |
||
19 | * Creates a temporary directory. |
||
20 | * |
||
21 | * @param octal $mode The directory mode |
||
22 | * @param integer $maxTry The maximum number of trials |
||
23 | * @param string $prefix The directory prefix |
||
24 | * |
||
25 | * @return string The name of the created directory |
||
26 | * |
||
27 | * @throws IOException In case the directory could not be created |
||
28 | */ |
||
29 | public function createTemporaryDirectory($mode = 0777, $maxTry = 65536, $prefix = null); |
||
30 | |||
31 | /** |
||
32 | * Creates an array of temporary files. |
||
33 | * |
||
34 | * Temporary files are created inside the system temporary folder. You must |
||
35 | * removed them manually at the end of use. |
||
36 | * |
||
37 | * @param integer $quantity The quantity of temporary files requested |
||
38 | * @param string $prefix The prefix of the files |
||
39 | * @param string $suffix The suffix of the files |
||
40 | * @param string $extension The extension of the files |
||
41 | * @param integer $maxTry The maximum number of trials to create one temporary file |
||
42 | * |
||
43 | * @return array An array of filenames |
||
44 | * |
||
45 | * @throws \InvalidArgumentException In case you provide a wrong argument |
||
46 | * @throws IOException In case of failure |
||
47 | */ |
||
48 | public function createTemporaryFiles($quantity = 1, $prefix = null, $suffix = null, $extension = null, $maxTry = 65536); |
||
49 | |||
50 | /** |
||
51 | * Creates a temporary file. |
||
52 | * |
||
53 | * Temporary files are created inside the system temporary folder. You must |
||
54 | * removed them manually at the end of use. |
||
55 | * |
||
56 | * @param string $prefix The prefix of the files |
||
57 | * @param string $suffix The suffix of the files |
||
58 | * @param string $extension The extension of the files |
||
59 | * @param integer $maxTry The maximum number of trials to create one temporary file |
||
60 | * |
||
61 | * @return array An array of filenames |
||
62 | * |
||
63 | * @throws \InvalidArgumentException In case you provide a wrong argument |
||
64 | * @throws IOException In case of failure |
||
65 | */ |
||
66 | public function createTemporaryFile($prefix = null, $suffix = null, $extension = null, $maxTry = 65536); |
||
67 | |||
68 | /** |
||
69 | * Create an empty file in the specified directory. |
||
70 | * |
||
71 | * The new file is created in the requested directory and will fit the |
||
72 | * the given parameters. Please note that the filename contains some |
||
73 | * random caracters. |
||
74 | * |
||
75 | * @param string $basePath The directory where to create the file |
||
76 | * @param string $prefix The prefix of the file |
||
77 | * @param string $suffix The suffix of the file |
||
78 | * @param string $extension The extension of the file |
||
79 | * @param integer $maxTry The maximum number of trials to create the file |
||
80 | * |
||
81 | * @return string The path of the created file |
||
82 | * |
||
83 | * @throws IOException in case of failure |
||
84 | */ |
||
85 | public function createEmptyFile($basePath, $prefix = null, $suffix = null, $extension = null, $maxTry = 65536); |
||
86 | } |