Offline and online PHP application [duplicate]

1

I wanted to know if it is possible, and if so, what technologies can I use to create an application that runs offline and when the user has a connection to the net, the data is taken to the server automatically? >     

asked by anonymous 19.07.2016 / 22:21

3 answers

0

sqlite follows the same principle as mysql , as you use php , an example: link , in your case you would make a if checking for connectivity, starting from this idea there are two ways to track this request:

  • Set in sqlite when offline and when the connection occurs it sends to the server.
  • Or, you go all offline and only when you want or by user definition sync.

More about Sqlite: link .

    
19.07.2016 / 22:37
0

Summary

It is impracticable to answer because there are several ways to solve and there is no way to determine which technique is most appropriate for your specific case. To determine you need to do a full analysis of your project and still there may be conflicts of opinions about what is most appropriate or not. In short, too broad and opinion-based theme

Yes! We Can!

But if you really want to know if it's possible, yes, it's possible.

You can run the offline PHP application on the client's local machine and have the same application online on a server. You can even install MySQL on the client. Anyway, the client itself would be the server for the offline version at the same time.

Perhaps the most critical point is to synchronize offline data with online data.

If the application is unique to a single client (a single computer), this will not be a problem, but if there is more than one client, it is more complicated because you should be more careful about duplicate keys, p>

Even if you are only one customer, you should take this care.

Case study

Another example is, if there is more than one user, suppose one of them has deleted a record and synchronized. The next day the other user who is offline needs this registration. In his PC the registry still exists so he makes the firells he needs to do and synchronize. Then it starts to stick at everything because the other user had deleted it the day before.

Dealing with unique keys is easy. But as you can see, in this small example of exclusion the thing begins to complicate.

Conclusion

So, I repeat what I mentioned above, without analyzing the complete project there is no way to indicate in an appropriate way what can be best applied.

The key to all this is logistics. Think about the logistics and the project itself to determine what might be feasible.

    
19.07.2016 / 23:38
-1

PHP is a server-side language, that is, you need to send data to the server, which will return a response. Soon PHP can not run on a machine without a web service running.

At the very least you would need to have an apache, nginx, or localhost (wamp / xammp / lamp) running on every machine that wants to use your site offline, it would need to be entirely stored in the browser cache. You would need to store data in cookies, etc ...

Possible up to is, but may be unfeasible depending on the type of service you intend to offer

    
19.07.2016 / 22:45