How to download and install zip service pack

Hi guys, I know how to write a script update for my project, the easiest way is to write a file and transfer it to the user and ask him to go to it. but I want to update his site automatically.

just like Wordpress, as you can see that the user can click the button and the script will take the following steps.

The problem is how to download the zip file from the target server, extract it to the user's host, and install it automatically

Maybe I can write this script myself, but I thought maybe at the moment we have some classes to do this in php

early

+4
source share
3 answers

The new and brilliant php-5.3 offers the .phar extension, which chips. And you don’t even need to β€œunpack” it.

+1
source

As you can see, if you are using the version of wordpress downloadabe (I mean the one you download and host on your hosting), it asks the FTP user and password: wp uses php FTP .

I found a good tutorial for using FTP throught curl: here it is.

Then you need to unzip it: php has a zip extension for you

-one
source

you can use cURL to upload a file and php zip function to unzip

-2
source

Source: https://habr.com/ru/post/1299105/


All Articles