1 | <?php |
||
15 | class AsyncHandler implements iHandler |
||
16 | { |
||
17 | /** @var $fs \samsonphp\fs\FileService Pointer to module controller */ |
||
18 | public $fs; |
||
19 | |||
20 | /** |
||
21 | * Server Handler constructor |
||
22 | * @param null $fs FileSystem module |
||
23 | */ |
||
24 | public function __construct($fs = null) |
||
28 | |||
29 | /** |
||
30 | * Get file name from $_SERVER array |
||
31 | * @param string $name Name of post file (for using $_FILES array) |
||
32 | * @return string Name of uploaded file |
||
33 | */ |
||
34 | public function name($name = null) |
||
38 | |||
39 | /** |
||
40 | * Get file size from $_SERVER array |
||
41 | * @param string $name Name of post file (for using $_FILES array) |
||
42 | * @return integer Size of uploaded file |
||
43 | */ |
||
44 | public function size($name = null) |
||
48 | |||
49 | /** |
||
50 | * Get file type from $_SERVER array |
||
51 | * @param string $name Name of post file (for using $_FILES array) |
||
52 | * @return string Mime type of uploaded file |
||
53 | */ |
||
54 | public function type($name = null) |
||
58 | |||
59 | /** |
||
60 | * Get file content from php input socket |
||
61 | * @param string $name Name of post file (for using $_FILES array) |
||
62 | * @return string File content |
||
63 | */ |
||
64 | public function file($name = null) |
||
68 | |||
69 | /** |
||
70 | * Write file in servers file system |
||
71 | * @param $file mixed File content |
||
72 | * @param $fileName string File name |
||
73 | * @param $uploadDir string Catalog for uploading on server |
||
74 | * @return bool|string Path to file or false if some errors found |
||
75 | */ |
||
76 | public function write($file, $fileName, $uploadDir) |
||
80 | } |
||
81 |