mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Merge pull request #1464 from Flynsarmy/useFileFacade
Use correct folder permissions in ThemeImport/Export
This commit is contained in:
commit
6b3d82d10f
@ -86,10 +86,10 @@ class ThemeExport extends Model
|
||||
$zipName = uniqid('oc');
|
||||
$zipPath = temp_path().'/'.$zipName;
|
||||
|
||||
if (!@mkdir($tempPath))
|
||||
if (!File::makeDirectory($tempPath))
|
||||
throw new ApplicationException('Unable to create directory '.$tempPath);
|
||||
|
||||
if (!@mkdir($metaPath = $tempPath . '/meta'))
|
||||
if (!File::makeDirectory($metaPath = $tempPath . '/meta'))
|
||||
throw new ApplicationException('Unable to create directory '.$metaPath);
|
||||
|
||||
File::copy($themePath.'/theme.yaml', $tempPath.'/theme.yaml');
|
||||
@ -133,7 +133,7 @@ class ThemeExport extends Model
|
||||
$headers = Response::download($zipPath, $outputName)->headers->all();
|
||||
$result = Response::make(File::get($zipPath), 200, $headers);
|
||||
|
||||
@unlink($zipPath);
|
||||
@File::delete($zipPath);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ class ThemeImport extends Model
|
||||
|
||||
File::put($zipPath, $file->getContents());
|
||||
|
||||
if (!@mkdir($tempPath))
|
||||
if (!File::makeDirectory($tempPath))
|
||||
throw new ApplicationException('Unable to create directory '.$tempPath);
|
||||
|
||||
Zip::extract($zipPath, $tempPath);
|
||||
|
Loading…
x
Reference in New Issue
Block a user