File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
wcfsetup/install/files/lib/data/file Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,8 @@ public static function createFromTemporary(FileTemporary $fileTemporary): File
117117 public static function createFromExistingFile (
118118 string $ pathname ,
119119 string $ originalFilename ,
120- string $ objectTypeName
120+ string $ objectTypeName ,
121+ bool $ copy = false
121122 ): ?File {
122123 if (!\is_readable ($ pathname )) {
123124 return null ;
@@ -174,10 +175,11 @@ public static function createFromExistingFile(
174175 \mkdir ($ filePath , recursive: true );
175176 }
176177
177- \rename (
178- $ pathname ,
179- $ filePath . $ file ->getSourceFilename ()
180- );
178+ if ($ copy ) {
179+ \copy ($ pathname , $ filePath . $ file ->getSourceFilename ());
180+ } else {
181+ \rename ($ pathname , $ filePath . $ file ->getSourceFilename ());
182+ }
181183
182184 return $ file ;
183185 }
You can’t perform that action at this time.
0 commit comments