@@ -18,7 +18,7 @@ class FileRepository extends BaseRepository implements FileRepositoryInterface
1818 */
1919 public function getFileStat (string $ path ): stdClass
2020 {
21- $ file = pathinfo ($ path );
21+ $ file = str_replace ( '\\' , ' / ' , pathinfo ($ path) );
2222 $ file ['dirname ' ] = in_array ($ file ['dirname ' ], ['. ' , './ ' , '/ ' ]) ? null : trim ($ file ['dirname ' ], '/ ' ) . '/ ' ;
2323
2424 $ response = $ this ->getHttpClient ()->request ('GET ' , sprintf (
@@ -39,7 +39,7 @@ public function getFileStat(string $path): stdClass
3939 */
4040 public function getContent (string $ path ): string
4141 {
42- $ file = pathinfo ($ path );
42+ $ file = str_replace ( '\\' , ' / ' , pathinfo ($ path) );
4343 $ file ['dirname ' ] = in_array ($ file ['dirname ' ], ['. ' , './ ' , '/ ' ]) ? null : trim ($ file ['dirname ' ], '/ ' ) . '/ ' ;
4444
4545 $ response = $ this ->getHttpClient ()->request ('GET ' , sprintf (
@@ -61,7 +61,7 @@ public function getContent(string $path): string
6161 */
6262 public function putContent (string $ path , string $ content ): ResponseInterface
6363 {
64- $ file = pathinfo ($ path );
64+ $ file = str_replace ( '\\' , ' / ' , pathinfo ($ path) );
6565 $ file ['dirname ' ] = in_array ($ file ['dirname ' ], ['. ' , './ ' , '/ ' ]) ? null : trim ($ file ['dirname ' ], '/ ' ) . '/ ' ;
6666
6767 return $ this ->getHttpClient ()->request ('POST ' , 'server/file/save ' , [
@@ -100,7 +100,7 @@ public function getDirectory(string $path): array
100100 array_push ($ files , [
101101 'entry ' => $ value ->name ,
102102 'directory ' => trim ($ path , '/ ' ),
103- 'extension ' => pathinfo ($ value ->name , PATHINFO_EXTENSION ),
103+ 'extension ' => str_replace ( '\\' , ' / ' , pathinfo ($ value ->name , PATHINFO_EXTENSION ) ),
104104 'size ' => human_readable ($ value ->size ),
105105 'date ' => strtotime ($ value ->modified ),
106106 'mime ' => $ value ->mime ,
0 commit comments