mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Remove old snappdf installations prior to upgrading
This commit is contained in:
parent
31054c8a13
commit
cbdf0a827c
@ -135,6 +135,9 @@ class SelfUpdateController extends BaseController
|
||||
|
||||
nlog("Extracting zip");
|
||||
|
||||
//clean up old snappdf installations
|
||||
$this->cleanOldSnapChromeBinaries();
|
||||
|
||||
// try{
|
||||
// $s = new Snappdf;
|
||||
// $s->getChromiumPath();
|
||||
@ -188,6 +191,21 @@ class SelfUpdateController extends BaseController
|
||||
return response()->json(['message' => 'Update completed'], 200);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function cleanOldSnapChromeBinaries()
|
||||
{
|
||||
$current_revision = base_path('vendor/beganovich/snappdf/versions/revision.txt');
|
||||
|
||||
$directoryIterator = new \RecursiveDirectoryIterator(base_path('vendor/beganovich/snappdf/versions'), \RecursiveDirectoryIterator::SKIP_DOTS);
|
||||
|
||||
foreach (new \RecursiveIteratorIterator($directoryIterator) as $file) {
|
||||
|
||||
unlink($file->getPathName());
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function postHookUpdate()
|
||||
|
Loading…
x
Reference in New Issue
Block a user