mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 03:17:35 -05:00 
			
		
		
		
	Self updater
This commit is contained in:
		
							parent
							
								
									d25002501e
								
							
						
					
					
						commit
						51371674fc
					
				@ -87,6 +87,28 @@ class SelfUpdateController extends BaseController
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function new_update()
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        $contents = file_get_contents($this->getDownloadUrl());
 | 
			
		||||
 | 
			
		||||
        Storage::disk('local')->put('invoiceninja.zip', $contents);
 | 
			
		||||
 | 
			
		||||
        $file = Storage::disk('local')->path('invoiceninja.zip');
 | 
			
		||||
 | 
			
		||||
        $zipFile = new \PhpZip\ZipFile();
 | 
			
		||||
 | 
			
		||||
        $zipFile->openFile($file);
 | 
			
		||||
 | 
			
		||||
        $zipFile->extractTo('/home/david/Downloads/1/');
 | 
			
		||||
 | 
			
		||||
        $zipFile->close();
 | 
			
		||||
 | 
			
		||||
        unlink($file);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private function testWritable()
 | 
			
		||||
    {
 | 
			
		||||
        $directoryIterator = new \RecursiveDirectoryIterator(base_path(), \RecursiveDirectoryIterator::SKIP_DOTS);
 | 
			
		||||
@ -118,6 +140,6 @@ class SelfUpdateController extends BaseController
 | 
			
		||||
    {
 | 
			
		||||
        $version = $this->checkVersion();
 | 
			
		||||
 | 
			
		||||
        return "https://github.com/invoiceninja/invoiceninja/releases/download/v{$verion}/invoiceninja.zip"
 | 
			
		||||
        return "https://github.com/invoiceninja/invoiceninja/releases/download/v{$version}/invoiceninja.zip"
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user