I do a lot of coding in PHP and MySQL, but I'm looking at moving my applications to a desktop environment in order to allow users to access the data offline, and periodically receive updates from a central online database.
For the time being, however, I'm looking for a decent tutorial on how to convert PHP applications to Cocoa, and how to store the data I currently have in MySQL in a fashion that will be usable by the application. Does anyone know of a go开发者_如何学编程od starting place?
I think you're asking the wrong question. Per sjobe, a straight "conversion" would likely be a bad idea and unnecessary to accomplish your aim of local access to data normally provided by a server reached over the Internet.
You provide two requirements:
- users must be able to access their data offline
- users must be able to sync that data with the online data store
You should think harder about how to accomplish these aims, then return to answering this question only if necessary.
You can doubtless find enough "Cocoa" applications out there that are only nominally Cocoa applications by the dubitable virtue of linking against the Cocoa framework. Cocoa is a means to an end: providing a seamless experience with your application to a Mac OS X user. If you can come up with better way to do that given your requirements and any other constraints, by all means, do it that way, Cocoa be damned.
Adobe Air is directed towards use of Flex and ActionScript. Google Web Toolkit uses Java to accomplish similar aims. There might be a good, ready-to-go option for running PHP web apps on the desktop; I don't know.
Another option might be simply having the users run your PHP web app on a local web server (Mac OS X comes with Apache and PHP). This is the route that Aigaion, which lets you manage a bibliography database, takes. The twist would be syncing with the server's data store.
In brief: don't look to "convert a PHP application to a Cocoa application"; look to satisfy your needs within the constraints of the Mac OS X platform (or the Windows platform, or the Haiku platform, or…).
I dont know if "converting" your app is really the way to do. I'd advise you to learn Cocoa, learn the way things are done with it, read the user interface guidelines ,decide what functionality is important for offline use, then implement them. Different languages/platforms have different strengths, so trying to duplicate/convert everything your php application does is not generally a good idea.
There are other alternatives that will let you deploy rich internet applications to desktop environments if all you really want is to be able to run your web app locally, Adobe Air is one of these although I don't know about how well it supports php.
精彩评论