1 | <?php |
||
12 | class SyncHandler implements iHandler |
||
13 | { |
||
14 | /** @var $fs \samsonphp\fs\FileService Pointer to module controller */ |
||
15 | public $fs; |
||
16 | |||
17 | /** |
||
18 | * Server Handler constructor |
||
19 | * @param null $fs FileSystem module |
||
20 | */ |
||
21 | public function __construct($fs = null) |
||
25 | |||
26 | /** |
||
27 | * Get file name from $_FILES array |
||
28 | * @param string $name Name of post file (for using $_FILES array) |
||
29 | * @return string Name of uploaded file |
||
30 | */ |
||
31 | public function name($name = null) |
||
35 | |||
36 | /** |
||
37 | * Get file size from $_FILES array |
||
38 | * @param string $name Name of post file (for using $_FILES array) |
||
39 | * @return integer Size of uploaded file |
||
40 | */ |
||
41 | public function size($name = null) |
||
45 | |||
46 | /** |
||
47 | * Get file type from $_FILES array |
||
48 | * @param string $name Name of post file (for using $_FILES array) |
||
49 | * @return string Mime type of uploaded file |
||
50 | */ |
||
51 | public function type($name = null) |
||
55 | |||
56 | /** |
||
57 | * Get file content from $_FILES array |
||
58 | * @param string $name Name of post file (for using $_FILES array) |
||
59 | * @return string File content |
||
60 | */ |
||
61 | public function file($name = null) |
||
65 | |||
66 | /** |
||
67 | * Write file in servers file system |
||
68 | * @param $file mixed File content |
||
69 | * @param $fileName string File name |
||
70 | * @param $uploadDir string Catalog for uploading on server |
||
71 | * @return bool|string Path to file or false if some errors found |
||
72 | */ |
||
73 | public function write($file, $fileName, $uploadDir) |
||
77 | } |
||
78 |