The product automatically connects to the server to update ideas, and the server to update ideas
Idea of automatic product update
1. The (User) user starts RAW
2. (system) connect to the server and send the current version number
3. Check data on the server side. If the latest version is used, 1 is returned. Otherwise, the following processing is performed:
The server version is stored in the following format (for example ):
ID |
Version |
Date |
Con |
1 |
1.0 |
2015-1-1 |
|
2 |
1.1 |
|
Index. php |
3 |
1.2 |
|
Index. php | O/inc. php |
For example, the latest version is 1.2, and the version sent from the user is 1.0.
Processing:
Get the ID number corresponding to 1.0
Obtain the ID number of the latest version.
Execute a loop to obtain the Con of each data entry from 1.0 to the latest version, split the Con containing | into arrays, and combine them into an array.
The following data is obtained:
Array (0 => ", 1 =>" index. php ", 2 => array (0 =>" index. php ", 2 =>" O/inc. php "))
Perform the dimension reduction operation on this array to obtain a common array:
Array (0 => "", 1 => "index. php", 3 => "index. php", 4 => "O/inc. php ")
Then remove the repeated array and empty array
Get: Array (1 => "index. php", 4 => "O/inc. php ")
Compress the corresponding files and add a configuration file to store the path of each file.
Compress the data to a public folder and return the path.
When a user of the same version requests an update, the above operations are not executed and the download path is directly returned.