The product automatically connects to the server to update ideas, and the server to update ideas

Source: Internet
Author: User

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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.