mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Ensure directories are created prior to PDF generation
This commit is contained in:
parent
06ee04ffa5
commit
7709bd32d1
@ -480,7 +480,11 @@ class CompanyExport implements ShouldQueue
|
||||
|
||||
$file_name = date('Y-m-d').'_'.str_replace(' ', '_', $this->company->present()->name() . '_' . $this->company->company_key .'.zip');
|
||||
|
||||
Storage::makeDirectory(public_path('storage/backups/'), 0775);
|
||||
$path = public_path('storage/backups/');
|
||||
|
||||
if(!Storage::exists($path))
|
||||
Storage::makeDirectory($path, 0775);
|
||||
|
||||
$zip_path = public_path('storage/backups/'.$file_name);
|
||||
$zip = new \ZipArchive();
|
||||
|
||||
|
@ -193,7 +193,8 @@ class CreateEntityPdf implements ShouldQueue
|
||||
|
||||
try{
|
||||
|
||||
nlog($file_path);
|
||||
if(!Storage::exists($path))
|
||||
Storage::makeDirectory($path, 0775);
|
||||
|
||||
Storage::disk($this->disk)->put($file_path, $pdf);
|
||||
|
||||
|
@ -106,6 +106,9 @@ class GenerateDeliveryNote
|
||||
info($maker->getCompiledHTML());
|
||||
}
|
||||
|
||||
if(!Storage::exists($this->invoice->client->invoice_filepath($invitation)))
|
||||
Storage::makeDirectory($this->invoice->client->invoice_filepath($invitation), 0775);
|
||||
|
||||
Storage::disk($this->disk)->put($file_path, $pdf);
|
||||
|
||||
return Storage::disk($this->disk)->path($file_path);
|
||||
|
@ -90,6 +90,9 @@ class Phantom
|
||||
|
||||
$this->checkMime($pdf, $invitation, $entity);
|
||||
|
||||
if(!Storage::exists($path))
|
||||
Storage::makeDirectory($path, 0775);
|
||||
|
||||
$instance = Storage::disk(config('filesystems.default'))->put($file_path, $pdf);
|
||||
|
||||
return $file_path;
|
||||
@ -118,8 +121,6 @@ class Phantom
|
||||
|
||||
$finfo = new \finfo(FILEINFO_MIME);
|
||||
|
||||
nlog($pdf);
|
||||
|
||||
if($finfo->buffer($pdf) != 'application/pdf; charset=binary')
|
||||
{
|
||||
SystemLogger::dispatch(
|
||||
|
Loading…
x
Reference in New Issue
Block a user