Home >Backend Development >PHP Tutorial >Product automatic connection server-side update ideas
Ideas for automatic product update
1. (User) The user starts RAW
2. (System) connects to the server and sends the current version number
3. (Server) detects the data. If it is the latest version, it returns 1, otherwise Proceed as follows:
The server-side version is stored in the following format (for example):
ID |
Version |
Date |
Con |
1 |
1.0 |
2015-1-1 |
|
2 |
1.1 |
2015-1-5 |
Index.php |
3 |
1.2 |
2015-2-5 |
Index.php|O/inc.php |
For example, the latest version is 1.2, and the version sent by the user is 1.0
Processing:
Get the ID number corresponding to 1.0
Get the ID number of the latest version
Execute the loop to get the Con of each piece of data from 1.0 to the latest version, divide the Con containing | into arrays, and merge them into one array
We got such data:
Array(0=>””,1=>”index.php”,2=>array(0=>”index.php” ,2=>”O/inc.php”))
Perform dimensionality reduction on this array and get an ordinary array:
Array(0=>””,1=>”index.php”, 3=>”index.php”,4=>” O/inc.php”)
Then remove duplicate arrays and empty arrays
to get: Array(1=>”index.php”,4=>” O/inc.php”)
Then put the corresponding Compress the files and add a configuration file to store the path of each file
After compression, put it in a public folder and return the path
When a user of the same version requests an update, it will no longer be executed. The above operation will directly return to the download path
.The above introduces the idea of automatically connecting the product to the server-side update, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.