1 | <?php |
||
13 | class FileManagerService extends Filesystem implements FileManager |
||
14 | { |
||
15 | /** @var LoggerInterface */ |
||
16 | private $logger; |
||
17 | |||
18 | 8 | public function __construct(LoggerInterface $logger) |
|
22 | |||
23 | /** |
||
24 | * Uses Symfony Filesystem method to put data into file. |
||
25 | * Creates file if it does not exist. |
||
26 | * |
||
27 | * @throws IOException |
||
28 | */ |
||
29 | 3 | public function filePutContent(string $path, string $content) : bool |
|
35 | |||
36 | /** |
||
37 | * Uses file_get_contents method to get data from file. |
||
38 | * |
||
39 | * @throws FileNotFoundException |
||
40 | */ |
||
41 | 1 | public function fileGetContent(string $path) : string |
|
50 | |||
51 | /** |
||
52 | * Uses Symfony Filesystem method to remove file. |
||
53 | */ |
||
54 | 1 | public function removeFile(string $path) : bool |
|
64 | |||
65 | /** |
||
66 | * Combines filepath from given params. |
||
67 | */ |
||
68 | public function combineFilepath(string $homedir, string $ticketKey, string $filename) : string |
||
72 | |||
73 | /** |
||
74 | * Checks wether passed file path is valid. |
||
75 | */ |
||
76 | 2 | public function fileExists(string $path) : bool |
|
80 | |||
81 | /** |
||
82 | * Creates directory from passed path. |
||
83 | */ |
||
84 | 1 | public function createDir(string $path) : bool |
|
94 | |||
95 | /** |
||
96 | * Changes working directory to passed in param. |
||
97 | * |
||
98 | * @throws DirectoryNotFoundException |
||
99 | */ |
||
100 | 1 | public function changeDir(string $path) : bool |
|
108 | |||
109 | /** |
||
110 | * Uses Symfony Filesystem method to create symlinks. |
||
111 | * |
||
112 | * @throws IOException |
||
113 | */ |
||
114 | public function createSymlink(string $source, string $target) : bool |
||
120 | } |
||
121 |