1 | <?php namespace FreedomCore\TrinityCore\Support; |
||
7 | class Filesystem |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * Path to the public folder |
||
12 | * @var null|string |
||
13 | */ |
||
14 | protected $publicFolder = null; |
||
15 | |||
16 | /** |
||
17 | * Path to the storage folder |
||
18 | * @var null|string |
||
19 | */ |
||
20 | protected $storageFolder = null; |
||
21 | |||
22 | protected $dataFilesStorage = null; |
||
23 | |||
24 | /** |
||
25 | * Filesystem constructor. |
||
26 | */ |
||
27 | public function __construct() |
||
31 | |||
32 | /** |
||
33 | * Get public folder path |
||
34 | * @return string |
||
35 | */ |
||
36 | public function getPublicFolder() : string |
||
40 | |||
41 | /** |
||
42 | * Get storage folder path |
||
43 | * @return string |
||
44 | */ |
||
45 | public function getStorageFolder() : string |
||
49 | |||
50 | /** |
||
51 | * Get data store folder path |
||
52 | * @return string |
||
53 | */ |
||
54 | public function getDataStorage() : string |
||
58 | |||
59 | /** |
||
60 | * Get Structures folder path |
||
61 | * @return string |
||
62 | */ |
||
63 | public function getStructuresFolder() : string |
||
67 | |||
68 | /** |
||
69 | * Set public folder path |
||
70 | * @param string $path |
||
71 | */ |
||
72 | public function setPublicFolder(string $path) |
||
76 | |||
77 | /** |
||
78 | * Set storage folder path |
||
79 | * @param string $path |
||
80 | */ |
||
81 | public function setStorageFolder(string $path) |
||
85 | |||
86 | /** |
||
87 | * Set data store folder path |
||
88 | * @param string $path |
||
89 | */ |
||
90 | public function setDataStorage(string $path) |
||
94 | |||
95 | /** |
||
96 | * Check if file exists |
||
97 | * @param string $path |
||
98 | * @param string $fileName |
||
99 | * @return bool |
||
100 | */ |
||
101 | public static function fileExists(string $path, string $fileName = '') : bool |
||
106 | |||
107 | /** |
||
108 | * Get folders in the folder |
||
109 | * @param string $path |
||
110 | * @return array |
||
111 | */ |
||
112 | public static function foldersInFolder(string $path) : array |
||
118 | |||
119 | /** |
||
120 | * Get files in the folder |
||
121 | * @param string $path |
||
122 | * @return array |
||
123 | */ |
||
124 | public static function filesInFolder(string $path) : array |
||
130 | |||
131 | /** |
||
132 | * Initialize required variables. |
||
133 | */ |
||
134 | private function initializeVariables() |
||
145 | } |
||
146 |