File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 16
16
*/
17
17
class FileServer implements Server
18
18
{
19
+ public ?int $ filePermissions = null ;
20
+ public ?int $ dirPermissions = null ;
19
21
private string $ root ;
20
22
21
23
@@ -59,6 +61,9 @@ public function readFile(string $remote, string $local): void
59
61
public function writeFile (string $ local , string $ remote , callable $ progress = null ): void
60
62
{
61
63
Safe::copy ($ local , $ this ->root . $ remote );
64
+ if ($ this ->filePermissions ) {
65
+ $ this ->chmod ($ remote , $ this ->filePermissions );
66
+ }
62
67
}
63
68
64
69
@@ -91,7 +96,7 @@ public function renameFile(string $old, string $new): void
91
96
public function createDir (string $ dir ): void
92
97
{
93
98
if (trim ($ dir , '/ ' ) !== '' && !file_exists ($ path = $ this ->root . $ dir )) {
94
- Safe::mkdir ($ path , 0777 , true );
99
+ Safe::mkdir ($ path , $ this -> dirPermissions ?? 0777 , true );
95
100
}
96
101
}
97
102
You can’t perform that action at this time.
0 commit comments