1 | <?php |
||
13 | class FileManagerService extends Filesystem implements FileManager |
||
14 | { |
||
15 | /** @var LoggerInterface */ |
||
16 | private $logger; |
||
17 | |||
18 | 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 | public function filePutContent(string $path, string $content) : bool |
||
37 | |||
38 | /** |
||
39 | * Uses file_get_contents method to get data from file. |
||
40 | * |
||
41 | * @throws FileNotFoundException |
||
42 | */ |
||
43 | public function fileGetContent(string $path) : string |
||
52 | |||
53 | /** |
||
54 | * Uses Symfony Filesystem method to remove file. |
||
55 | */ |
||
56 | public function removeFile(string $path) : bool |
||
66 | |||
67 | /** |
||
68 | * Combines filepath from given params. |
||
69 | */ |
||
70 | public function combineFilepath(string $homedir, string $ticketKey, string $filename) : string |
||
74 | |||
75 | /** |
||
76 | * Checks wether passed file path is valid. |
||
77 | */ |
||
78 | public function fileExists(string $path) : bool |
||
82 | |||
83 | /** |
||
84 | * Creates directory from passed path. |
||
85 | */ |
||
86 | public function createDir(string $path) : bool |
||
96 | |||
97 | /** |
||
98 | * Changes working directory to passed in param. |
||
99 | * |
||
100 | * @throws DirectoryNotFoundException |
||
101 | */ |
||
102 | public function changeDir(string $path) : bool |
||
110 | |||
111 | /** |
||
112 | * Uses Symfony Filesystem method to create symlinks. |
||
113 | * |
||
114 | * @throws IOException |
||
115 | */ |
||
116 | public function createSymlink(string $source, string $target) : bool |
||
122 | } |
||
123 |